cache coherency tests for unionfs regression suite
authorErez Zadok <ezk@cs.sunysb.edu>
Wed, 30 Jul 2008 02:27:08 +0000 (22:27 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Wed, 30 Jul 2008 02:27:08 +0000 (22:27 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
default.conf
t-cache.sh [new file with mode: 0755]
thor.conf

index 4c692d18affbb2ada4b16c807a6d8b16585a5110..f6f26e35c88ef2ecf6da978b51fe9a68b1d7605b 100644 (file)
@@ -5,6 +5,7 @@
 # Note: you can give full name of test (t-chmod.sh) or short (chmod)
 ALL_TESTS="
        t-brm.sh
+       t-cache.sh
        t-chmod.sh
        t-creat-open.sh
        t-create.sh
@@ -29,12 +30,6 @@ ALL_TESTS="
        t-unlink-whiteout.sh
 "
 
-# The branch-management test is "broken" and needs to be rewritten to
-# support the new remount-style -ezk.
-BROKEN_TESTS="
-       t-branchman.sh
-       t-incgen.sh
-"
 # names of tests to run (change as you like)
 # Will take $MYTESTS list of tests from the environment
 TESTS2RUN=${MYTESTS:-$ALL_TESTS}
diff --git a/t-cache.sh b/t-cache.sh
new file mode 100755 (executable)
index 0000000..54af6e9
--- /dev/null
@@ -0,0 +1,104 @@
+#!/bin/sh
+# cache coherency tests
+
+source scaffold
+
+# initial directories
+function directories {
+cat <<FILES
+d $TOP_LOWER_DIR
+d $LOWER_DIR0
+d $LOWER_DIR1
+
+FILES
+}
+
+# initial set of files
+function beforefiles {
+cat <<FILES
+
+f $LOWER_DIR0/f0
+d $LOWER_DIR1/d1
+f $LOWER_DIR1/f1
+
+FILES
+}
+
+function afterfiles {
+cat <<FILES
+f $LOWER_DIR0/f0
+f $LOWER_DIR0/f0b
+d $LOWER_DIR0/d0
+
+d $LOWER_DIR2
+d $LOWER_DIR3
+
+FILES
+}
+
+##### simple tests
+( directories ; beforefiles) | create_hierarchy
+
+mount_union "" $LOWER_DIR0 $LOWER_DIR1
+
+##############################################################################
+
+function test_ls {
+    ls -lR $MOUNTPOINT > /dev/null 2>&1
+    echo -n "[ls] "
+}
+
+function test_touch {
+    touch $LOWER_DIR0/f0 || exit $?
+    sleep 5
+    test -f $MOUNTPOINT/f0 || exit $?
+    echo -n "[touch] "
+}
+
+function test_creat {
+    touch $LOWER_DIR0/f0b || exit $?
+    sleep 5
+    test -f $MOUNTPOINT/f0b || exit $?
+    echo -n "[creat] "
+}
+
+function test_mkdir {
+    mkdir -p $LOWER_DIR0/d0 || exit $?
+    sleep 5
+    test -d $MOUNTPOINT/d0 || exit $?
+    echo -n "[mkdir] "
+}
+
+function test_rm {
+    rm -f $LOWER_DIR1/f1 || exit $?
+    sync
+    sleep 5
+    test -f $MOUNTPOINT/f1 && exit $?
+    echo -n "[rm] "
+}
+
+function test_rmdir {
+    rmdir $LOWER_DIR1/d1 || exit $?
+    sync
+    sleep 5
+    test -d $MOUNTPOINT/d1 && exit $?
+    echo -n "[rmdir] "
+}
+
+function test_append {
+    date >> $LOWER_DIR0/f0 || exit $?
+    sleep 5
+    test -s $MOUNTPOINT/f0 || exit $?
+    echo -n "[append] "
+}
+
+LIST="ls touch creat mkdir rm rmdir append"
+
+for t in $LIST ; do
+    eval "test_${t}" || exit $?
+done
+
+unmount_union
+( directories ; afterfiles )  | check_hierarchy $TOP_LOWER_DIR
+
+complete_test
index 05110364379027172181bdc3d1fa0b2d099e9f13..fe30a5f78582255baf9c6545224fb80c44d54507 100644 (file)
--- a/thor.conf
+++ b/thor.conf
@@ -4,6 +4,7 @@
 # Note: you can give full name of test (t-chmod.sh) or short (chmod)
 ALL_TESTS="
        t-brm.sh
+       t-cache.sh
        t-chmod.sh
        t-creat-open.sh
        t-create.sh
@@ -28,12 +29,6 @@ ALL_TESTS="
        t-unlink-whiteout.sh
 "
 
-# The branch-management test is "broken" and needs to be rewritten to
-# support the new remount-style -ezk.
-BROKEN_TESTS="
-       t-branchman.sh
-       t-incgen.sh
-"
 # names of tests to run (change as you like)
 # Will take $MYTESTS list of tests from the environment
 TESTS2RUN=${MYTESTS:-$ALL_TESTS}