diff options
-rwxr-xr-x | tests/10_blockdev_diff.sh | 26 | ||||
-rwxr-xr-x | tests/11_blockdev_add_remove.sh | 27 |
2 files changed, 53 insertions, 0 deletions
diff --git a/tests/10_blockdev_diff.sh b/tests/10_blockdev_diff.sh new file mode 100755 index 0000000..2565ba4 --- /dev/null +++ b/tests/10_blockdev_diff.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +TEST_ID="10" +TEST_NAME="Block device difference" + +CREATE=`pwd`/$1 +DEPLOY=`pwd`/$2 +TEST_TOOLS=$3 + +. ./test_lib.sh + +############# Test specific code ############ + +setup () { + mknod $ORIGIN/tochange b `stat /dev/null -c '%t %T'` + mknod $TARGET/tochange b `stat /dev/full -c '%t %T'` +} + +check_results () { + test -b $ORIGIN/tochange && + test "`stat -c '%t %T' $ORIGIN/tochange`" = \ + "`stat -c '%t %T' $TARGET/tochange`" +} + +############################################# +main $@ diff --git a/tests/11_blockdev_add_remove.sh b/tests/11_blockdev_add_remove.sh new file mode 100755 index 0000000..4fa7f5a --- /dev/null +++ b/tests/11_blockdev_add_remove.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +TEST_ID="11" +TEST_NAME="Block device add and remove" + +CREATE=`pwd`/$1 +DEPLOY=`pwd`/$2 +TEST_TOOLS=$3 + +. ./test_lib.sh + +############# Test specific code ############ + +setup () { + #make a node with the same numbers as /dev/null + setup_block_major_minor="`stat /dev/null -c '%t %T'`" + mknod $ORIGIN/toremove b $setup_block_major_minor + mknod $TARGET/toadd b $setup_block_major_minor +} + +check_results () { + test -b $ORIGIN/toadd && + test ! -b $ORIGIN/toremove +} + +############################################# +main $@ |