+2008-03-25 Erez Zadok <ezk@cs.sunysb.edu>
+
+ * {default,thor}.conf (ALL_TESTS): add t-brm.sh test.
+
+ * brm.conf: remove unnecessary config file.
+
+ * t-brm.sh: simple branch management test
+
2007-06-27 Erez Zadok <ezk@shekel.local>
* run-tests: support ext4 (needs an ext3 mkfs and currently the f/s
+++ /dev/null
-# default Unionfs 2.0 regression configuration file
-
-# names of all possible tests
-# Note: you can give full name of test (t-chmod.sh) or short (chmod)
-ALL_TESTS="
- t-chmod.sh
- t-creat-open.sh
- t-create.sh
- t-flock.sh
- t-fsync.sh
- t-ioctl.sh
- t-link-rename.sh
- t-link.sh
- t-lookup-opaque.sh
- t-lookup.sh
- t-mkdir.sh
- t-mknod.sh
- t-open-unlink.sh
- t-open.sh
- t-readdir.sh
- t-rename-matrix.sh
- t-rename-whiteout.sh
- t-rmdir.sh
- t-symlink.sh
- t-truncate-all.sh
- t-unlink-whiteout.sh
-"
-
-# The branchman and incgen tests are "broken" and need 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}
-
-# name of four devices to use
-DEV0=/dev/loop1
-DEV1=/dev/loop2
-DEV2=/dev/loop3
-DEV3=/dev/loop4
-
-# Name of file systems to format your device. Supported file systems
-# Include the following:
-# 1. Disk based: ext2, ext3, ext4, reiserfs, reiser4, and xfs.
-# 2. Network: nfs, nfs2, and nfs3 (nfs4 support pending).
-# 3. Special: jffs2, ramfs, tmpfs, cramfs, and squashfs.
-case ${MYFS} in
- # jffs2 is special: only the leftmost filesystem uses it
- jffs* | ramfs | tmpfs )
- FS0=${MYFS}
- FS1=ext2
- FS2=ext2
- FS3=ext2
- ;;
-# cramfs is special: only thek rightmost filesystem uses it but the cramfs
-# will be generated *inside* run-tests, because this is a read-only file
-# system and each test has a different configuration.
- cramfs | squashfs )
- SPECIAL_FS=${MYFS}
- FS0=tmpfs
- FS1=ext2
- FS2=ext2
- FS3=ext2
- ;;
- * )
- FS0=${MYFS}
- FS1=${MYFS}
- FS2=${MYFS}
- FS3=${MYFS}
- ;;
-esac
-
-# delay between each test (in seconds, optional)
-DELAY=${MYDELAY:-0.1}
-
-# Echo the command being executed to a file/device (optional) This is useful
-# when unionfs printk's some debugging output which may go to a log file,
-# console, or syslog. With this you can show command in your logs before it
-# runs.
-#ECHODEV=/var/log/all
-ECHODEV=/dev/console
-
-# ANSI color codes, concatenated by ';'
-#
-# 00 for normal display (or just 0)
-# 01 for bold on (or just 1)
-# 02 faint (or just 2)
-# 03 standout (or just 3)
-# 04 underline (or just 4)
-# 05 blink on (or just 5)
-# 07 reverse video on (or just 7)
-# 08 nondisplayed (invisible) (or just 8)
-# 22 normal
-# 23 no-standout
-# 24 no-underline
-# 25 no-blink
-# 27 no-reverse
-# 30 black foreground
-# 31 red foreground
-# 32 green foreground
-# 33 yellow foreground
-# 34 blue foreground
-# 35 magenta foreground
-# 36 cyan foreground
-# 37 white foreground
-# 39 default foreground
-# 40 black background
-# 41 red background
-# 42 green background
-# 43 yellow background
-# 44 blue background
-# 45 magenta background
-# 46 cyan background
-# 47 white background
-# 49 default background
-OUTPUT_COLOR="1;32"
--- /dev/null
+#!/bin/sh
+# simple branch management test
+
+source scaffold
+
+# initial directories
+function directories {
+cat <<FILES
+d $TOP_LOWER_DIR
+d $LOWER_DIR0
+d $LOWER_DIR1
+d $LOWER_DIR2
+d $LOWER_DIR3
+
+FILES
+}
+
+# initial set of files
+function beforefiles {
+cat <<FILES
+
+f $LOWER_DIR0/f0
+f $LOWER_DIR1/f1
+f $LOWER_DIR2/f2
+f $LOWER_DIR3/f3
+
+FILES
+}
+
+function afterfiles {
+cat <<FILES
+f $LOWER_DIR0/f0
+f $LOWER_DIR1/f1
+f $LOWER_DIR2/f2
+f $LOWER_DIR3/f3
+
+FILES
+}
+
+##### simple tests
+( directories ; beforefiles) | create_hierarchy
+
+mount_union "" $LOWER_DIR0
+mount -t unionfs -o remount,add=$LOWER_DIR1 none $MOUNTPOINT || exit $?
+mount -t unionfs -o remount,add=:$LOWER_DIR2=ro none $MOUNTPOINT || exit $?
+mount -t unionfs -o remount,del=$LOWER_DIR1,add=$LOWER_DIR3 none $MOUNTPOINT || exit $?
+mount -t unionfs -o remount,mode=$LOWER_DIR0=ro,del=$LOWER_DIR2 none $MOUNTPOINT || exit $?
+
+# test if the union contains only f0 and f3
+test -f $MOUNTPOINT/f0 || exit $?
+test -f $MOUNTPOINT/f1 && exit $?
+test -f $MOUNTPOINT/f2 && exit $?
+test -f $MOUNTPOINT/f3 || exit $?
+
+unmount_union
+( directories ; afterfiles ) | check_hierarchy $TOP_LOWER_DIR
+
+complete_test