fix some sh portability fixes

Replace bash specific way with POSIX one.

Signed-off-by: OBATA Akio <obache@wizdas.com>
(cherry picked from commit 0009cb8171)
r14.0.x
OBATA Akio 5 years ago committed by Slávek Banko
parent 0e5f517eb7
commit e951a69396
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save