diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/01_symlink_diff.sh | 6 | ||||
-rwxr-xr-x | tests/04_fifo_add_remove.sh | 29 | ||||
-rwxr-xr-x | tests/run_tests.sh | 2 | ||||
-rw-r--r-- | tests/test_lib.sh | 3 |
4 files changed, 34 insertions, 6 deletions
diff --git a/tests/01_symlink_diff.sh b/tests/01_symlink_diff.sh index 4246865..4181a30 100755 --- a/tests/01_symlink_diff.sh +++ b/tests/01_symlink_diff.sh @@ -1,6 +1,6 @@ #!/bin/bash -TEST_ID="02" +TEST_ID="01" TEST_NAME="Symlink add/remove" CREATE=`pwd`/$1 @@ -18,8 +18,8 @@ function setup { } function check_results { - test -L $ORIGIN/a && \ - check_symlink $ORIGIN/a "/bar" && \ + test -L $ORIGIN/a && \ + check_symlink $ORIGIN/a "/bar" && \ check_group $ORIGIN/a cdrom && \ check_same_mtime $ORIGIN/a $TARGET/a && \ check_same_uidgid $ORIGIN/a $TARGET/a diff --git a/tests/04_fifo_add_remove.sh b/tests/04_fifo_add_remove.sh new file mode 100755 index 0000000..ebea443 --- /dev/null +++ b/tests/04_fifo_add_remove.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +TEST_ID="04" +TEST_NAME="Named pipe (FIFO) add remove test" + +CREATE=`pwd`/$1 +DEPLOY=`pwd`/$2 +TEST_TOOLS=$3 + +. ./test_lib.sh + +############# Test specific code ############ + +function setup { + mkfifo $ORIGIN/remove && \ + mkfifo $TARGET/add && \ + chmod 707 $TARGET/add && \ + chown -h :cdrom $TARGET/add +} + +function check_results { + test -p $ORIGIN/add && \ + test ! -p $ORIGIN/remove && \ + check_same_mtime $ORIGIN/add $TARGET/add && \ + check_same_uidgid $ORIGIN/add $TARGET/add +} + +############################################# +main $@ diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 873d2eb..889f5f4 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -17,7 +17,7 @@ ALLTESTSDIR=`pwd` for i in [0-9][0-9]* do cd $ALLTESTSDIR - ./$i ../tbdiff-create ../tbdiff-deploy + fakeroot -- ./$i ../tbdiff-create ../tbdiff-deploy if [ $? -ne 0 ] then echo "Test program $i failed" 1>&2 diff --git a/tests/test_lib.sh b/tests/test_lib.sh index 6d431d0..d9c30d9 100644 --- a/tests/test_lib.sh +++ b/tests/test_lib.sh @@ -83,7 +83,6 @@ function main { $DEPLOY $IMGFILE && \ RETVAL=$? cd $CWD - if test "x$RETVAL" != "x0" then echo $FAIL @@ -94,7 +93,7 @@ function main { echo -n "$TEST_ID Checking $TEST_NAME results: " check_results - if test "x$RETVAL" != "x0" + if test "x$?" != "x0" then echo $FAIL echo "Applying image did not produce the expected results" 1>&2 |