From fe5c38aac196b1c698cc7031a6639ee72cd8a68b Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Tue, 29 Jul 2008 22:27:08 -0400 Subject: [PATCH] cache coherency tests for unionfs regression suite Signed-off-by: Erez Zadok --- default.conf | 7 +--- t-cache.sh | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++ thor.conf | 7 +--- 3 files changed, 106 insertions(+), 12 deletions(-) create mode 100755 t-cache.sh diff --git a/default.conf b/default.conf index 4c692d1..f6f26e3 100644 --- a/default.conf +++ b/default.conf @@ -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 index 0000000..54af6e9 --- /dev/null +++ b/t-cache.sh @@ -0,0 +1,104 @@ +#!/bin/sh +# cache coherency tests + +source scaffold + +# initial directories +function directories { +cat < /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 diff --git a/thor.conf b/thor.conf index 0511036..fe30a5f 100644 --- 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} -- 2.43.0