diff --git a/check b/check index 9cef58b4..f8db3cd6 100755 --- a/check +++ b/check @@ -70,6 +70,7 @@ check options -overlay test overlay -pvfs2 test PVFS2 -tmpfs test TMPFS + -ubifs test ubifs -l line mode diff -udiff show unified diff (default) -n show me, do not run tests @@ -267,6 +268,7 @@ while [ $# -gt 0 ]; do -overlay) FSTYP=overlay; export OVERLAY=true ;; -pvfs2) FSTYP=pvfs2 ;; -tmpfs) FSTYP=tmpfs ;; + -ubifs) FSTYP=ubifs ;; -g) group=$2 ; shift ; GROUP_LIST="$GROUP_LIST ${group//,/ }" diff --git a/common/config b/common/config index 090e9117..5091db9d 100644 --- a/common/config +++ b/common/config @@ -199,6 +199,7 @@ export TIMEOUT_PROG="`set_prog_path timeout`" export MAN_PROG="`set_prog_path man`" export NFS4_SETFACL_PROG="`set_prog_path nfs4_setfacl`" export NFS4_GETFACL_PROG="`set_prog_path nfs4_getfacl`" +export UBIUPDATEVOL_PROG="`set_prog_path ubiupdatevol`" # use 'udevadm settle' or 'udevsettle' to wait for lv to be settled. # newer systems have udevadm command but older systems like RHEL5 don't. @@ -323,6 +324,9 @@ _mount_opts() # We need to specify the size at mount, use 1G by default export MOUNT_OPTIONS="-o size=1G $TMPFS_MOUNT_OPTIONS" ;; + ubifs) + export MOUNT_OPTIONS=$UBIFS_MOUNT_OPTIONS + ;; *) ;; esac @@ -458,13 +462,20 @@ _check_device() return 0 fi - if [ "$FSTYP" == "overlay" ]; then + case "$FSTYP" in + overlay) if [ ! -d "$dev" ]; then _fatal "common/config: $name ($dev) is not a directory for overlay" fi - else + ;; + ubifs) + if [ ! -c "$dev" ]; then + _fatal "common/config: $name ($dev) is not a character device" + fi + ;; + *) _fatal "common/config: $name ($dev) is not a block device or a network filesystem" - fi + esac } # check and return a canonical mount point path diff --git a/common/encrypt b/common/encrypt index 723f1b11..a6fd89d9 100644 --- a/common/encrypt +++ b/common/encrypt @@ -71,6 +71,10 @@ _scratch_mkfs_encrypted() ext4|f2fs) _scratch_mkfs -O encrypt ;; + ubifs) + # erase the UBI volume; reformated automatically on next mount + $UBIUPDATEVOL_PROG ${SCRATCH_DEV} -t + ;; *) _notrun "No encryption support for $FSTYP" ;; diff --git a/common/rc b/common/rc index d4d2633e..ff1b75c9 100644 --- a/common/rc +++ b/common/rc @@ -177,6 +177,9 @@ case "$FSTYP" in ;; pvfs2) ;; + ubifs) + [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found" + ;; esac if [ ! -z "$REPORT_LIST" ]; then @@ -813,6 +816,11 @@ _scratch_mkfs() # do nothing for tmpfs return 0 ;; + ubifs) + # erase the UBI volume; reformated automatically on next mount + $UBIUPDATEVOL_PROG ${SCRATCH_DEV} -t + return 0 + ;; ext4) _scratch_mkfs_ext4 $* return $? @@ -1576,6 +1584,15 @@ _require_scratch_nocheck() _notrun "this test requires a valid \$SCRATCH_MNT and unique $SCRATCH_DEV" fi ;; + ubifs) + # ubifs needs an UBI volume. This will be a char device, not a block device. + if [ ! -c "$SCRATCH_DEV" ]; then + _notrun "this test requires a valid UBI volume for \$SCRATCH_DEV" + fi + if [ ! -d "$SCRATCH_MNT" ]; then + _notrun "this test requires a valid \$SCRATCH_MNT" + fi + ;; *) if [ -z "$SCRATCH_DEV" -o "`_is_block_dev "$SCRATCH_DEV"`" = "" ] then @@ -1670,6 +1687,15 @@ _require_test() _notrun "this test requires a valid \$TEST_DIR and unique $TEST_DEV" fi ;; + ubifs) + # ubifs needs an UBI volume. This will be a char device, not a block device. + if [ ! -c "$TEST_DEV" ]; then + _notrun "this test requires a valid UBI volume for \$TEST_DEV" + fi + if [ ! -d "$TEST_DIR" ]; then + _notrun "this test requires a valid \$TEST_DIR" + fi + ;; *) if [ -z "$TEST_DEV" ] || [ "`_is_block_dev "$TEST_DEV"`" = "" ] then @@ -2555,6 +2581,9 @@ _check_test_fs() tmpfs) # no way to check consistency for tmpfs ;; + ubifs) + # there is no fsck program for ubifs yet + ;; *) _check_generic_filesystem $TEST_DEV ;; @@ -2604,6 +2633,9 @@ _check_scratch_fs() tmpfs) # no way to check consistency for tmpfs ;; + ubifs) + # there is no fsck program for ubifs yet + ;; *) _check_generic_filesystem $device ;;