fix some sh portability fixes

Replace bash specific way with POSIX one.

Signed-off-by: OBATA Akio <obache@wizdas.com>
pull/32/head
OBATA Akio 5 years ago
parent c349db5d27
commit 0009cb8171

@ -1,7 +1,7 @@
# Expects karm test file in $TESTFILE # Expects karm test file in $TESTFILE
# Returns dcop id in $DCOP_ID # Returns dcop id in $DCOP_ID
function set_up() set_up()
{ {
DCOPID=`dcop 2>/dev/null | grep karm` DCOPID=`dcop 2>/dev/null | grep karm`
@ -44,7 +44,7 @@ function set_up()
then then
break break
else else
let "idx += 1" idx=$(( idx + 1 ))
fi fi
sleep 1 sleep 1
done done
@ -64,12 +64,12 @@ function set_up()
fi fi
} }
function test_func() test_func()
{ {
echo "Yep, that works." echo "Yep, that works."
} }
function tear_down() tear_down()
{ {
if [ -n "$DCOPID" ]; then dcop "$DCOPID" KarmDCOPIface quit; fi; if [ -n "$DCOPID" ]; then dcop "$DCOPID" KarmDCOPIface quit; fi;

@ -2,7 +2,7 @@
TESTFILE="/tmp/testkarm1.ics" TESTFILE="/tmp/testkarm1.ics"
source __lib.sh . ./__lib.sh
set_up set_up
@ -13,7 +13,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface bookTime $TASKID notadate 360 2>/dev/null`
tear_down tear_down
EXPECTED=5 EXPECTED=5
if [ "$RVAL" == "$EXPECTED" ]; then if [ "$RVAL" = "$EXPECTED" ]; then
echo "PASS $0" echo "PASS $0"
exit 0; exit 0;
else else

@ -2,7 +2,7 @@
TESTFILE="/tmp/testkarm1.ics" TESTFILE="/tmp/testkarm1.ics"
source __lib.sh . ./__lib.sh
set_up set_up
@ -13,7 +13,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface bookTime $TASKID 20050619 notanumber 2>/dev/nul
tear_down tear_down
EXPECTED=7 EXPECTED=7
if [ "$RVAL" == "$EXPECTED" ]; then if [ "$RVAL" = "$EXPECTED" ]; then
echo "PASS $0" echo "PASS $0"
exit 0; exit 0;
else else

@ -2,7 +2,7 @@
TESTFILE="/tmp/testkarm1.ics" TESTFILE="/tmp/testkarm1.ics"
source __lib.sh . ./__lib.sh
set_up set_up
@ -13,7 +13,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface bookTime $TASKID 20050619Tabc 360 2>/dev/null`
tear_down tear_down
EXPECTED=5 EXPECTED=5
if [ "$RVAL" == "$EXPECTED" ]; then if [ "$RVAL" = "$EXPECTED" ]; then
echo "PASS $0" echo "PASS $0"
exit 0; exit 0;
else else

@ -4,7 +4,7 @@
TESTFILE="/tmp/testkarm1.ics" TESTFILE="/tmp/testkarm1.ics"
source __lib.sh . ./__lib.sh
set_up set_up
@ -13,7 +13,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface bookTime bad-uid 20050619 360 2>/dev/null`
tear_down tear_down
EXPECTED=4 EXPECTED=4
if [ "$RVAL" == "$EXPECTED" ]; then if [ "$RVAL" = "$EXPECTED" ]; then
echo "PASS $0" echo "PASS $0"
exit 0; exit 0;
else else

@ -2,7 +2,7 @@
TESTFILE="/tmp/testkarm1.ics" TESTFILE="/tmp/testkarm1.ics"
source __lib.sh . ./__lib.sh
set_up set_up
@ -21,7 +21,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface totalMinutesForTaskId $TASKID 2>/dev/null`
SKIP_TESTFILE_DELETE=true SKIP_TESTFILE_DELETE=true
tear_down tear_down
if [ "x$RVAL" == "x$DURATION" ]; then if [ "x$RVAL" = "x$DURATION" ]; then
echo "PASS $0" echo "PASS $0"
exit 0; exit 0;
else else

@ -8,7 +8,7 @@ exec >>check.log 2>&1
TESTFILE="testkarm.ics" TESTFILE="testkarm.ics"
TESTTODO="testtodo" TESTTODO="testtodo"
source __lib.sh . ./__lib.sh
set_up set_up

@ -7,7 +7,7 @@ exec >> check.log 2>&1
TESTFILE="/tmp/testkarm1.ics" TESTFILE="/tmp/testkarm1.ics"
rm $TESTFILE rm $TESTFILE
source __lib.sh . ./__lib.sh
set_up set_up
@ -24,7 +24,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface version 2>/dev/null`
tear_down tear_down
if [ "$RVAL" == "" ]; then if [ "$RVAL" = "" ]; then
echo "FAIL $0: got no version." echo "FAIL $0: got no version."
exit 1; exit 1;
else else

@ -6,7 +6,7 @@
exec >>check.log 2>&1 exec >>check.log 2>&1
source __lib.sh . /__lib.sh
TESTFILE="/tmp/testkarm.ics" TESTFILE="/tmp/testkarm.ics"
@ -48,7 +48,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface taskIdFromName $TODO_NAME`
tear_down tear_down
# check that todo was found # check that todo was found
if [ "$RVAL" == "$TODO_UID" ]; then if [ "$RVAL" = "$TODO_UID" ]; then
echo "PASS $0" echo "PASS $0"
exit 0; exit 0;
else else

@ -7,7 +7,7 @@ exec >>check.log 2>&1
TESTFILE="/tmp/testkarm1.ics" TESTFILE="/tmp/testkarm1.ics"
VERSION="1.6.0" VERSION="1.6.0"
source __lib.sh . ./__lib.sh
set_up set_up
@ -15,7 +15,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface version 2>/dev/null`
tear_down tear_down
if [ "$RVAL" == "$VERSION" ]; then if [ "$RVAL" = "$VERSION" ]; then
echo "PASS $0" echo "PASS $0"
exit 0; exit 0;
else else

@ -4,7 +4,7 @@
exec >>check.log 2>&1 exec >>check.log 2>&1
source __lib.sh . ./__lib.sh
# check for required perl stuff # check for required perl stuff
perl -e "use Net::DAV::Server;" > /dev/null 2>&1 perl -e "use Net::DAV::Server;" > /dev/null 2>&1

Loading…
Cancel
Save