From: Karel Zak Date: Mon, 19 Jan 2009 23:50:01 +0000 (+0100) Subject: tests: cleanup ts/mount X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43d1d9c749d59b4c1d90f3f18f27a1fb7a087cce;p=util-linux tests: cleanup ts/mount Signed-off-by: Karel Zak --- diff --git a/tests/ts/mount/devname b/tests/ts/mount/devname index f0661f32..64b79036 100755 --- a/tests/ts/mount/devname +++ b/tests/ts/mount/devname @@ -15,12 +15,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh -TS_COMPONENT="mount" -TS_DESC="devname" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by devname" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-devname b/tests/ts/mount/fstab-devname index 87483afd..1a2494de 100755 --- a/tests/ts/mount/fstab-devname +++ b/tests/ts/mount/fstab-devname @@ -15,12 +15,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="devname" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by devname (fstab)" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-devname2label b/tests/ts/mount/fstab-devname2label index 575acaa7..053213f2 100755 --- a/tests/ts/mount/fstab-devname2label +++ b/tests/ts/mount/fstab-devname2label @@ -15,14 +15,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="devname2label" - +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by devname (fstab label)" LABEL="testMountD2L" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-devname2uuid b/tests/ts/mount/fstab-devname2uuid index d6bf72b9..5cab621e 100755 --- a/tests/ts/mount/fstab-devname2uuid +++ b/tests/ts/mount/fstab-devname2uuid @@ -15,12 +15,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="devname2uuid" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by devname (fstab uuid)" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-label b/tests/ts/mount/fstab-label index d47fbb16..375a1ba7 100755 --- a/tests/ts/mount/fstab-label +++ b/tests/ts/mount/fstab-label @@ -15,14 +15,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="label" - +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by label (fstab)" LABEL="testFstabLabel" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-label2devname b/tests/ts/mount/fstab-label2devname index a6e1e7a9..f53de4fb 100755 --- a/tests/ts/mount/fstab-label2devname +++ b/tests/ts/mount/fstab-label2devname @@ -15,14 +15,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="label2devname" - +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by label (fstab devname)" LABEL="testMountL2D" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-label2uuid b/tests/ts/mount/fstab-label2uuid index 18960164..1c90c2ed 100755 --- a/tests/ts/mount/fstab-label2uuid +++ b/tests/ts/mount/fstab-label2uuid @@ -15,14 +15,12 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="label2uuid" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by label (fstab uuid)" LABEL="testMountL2U" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-symlink b/tests/ts/mount/fstab-symlink index f567e8fd..98797a7f 100755 --- a/tests/ts/mount/fstab-symlink +++ b/tests/ts/mount/fstab-symlink @@ -15,18 +15,17 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh -TS_COMPONENT="fstab" -TS_DESC="symlink" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by devname (fstab symlink)" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot set -o pipefail -LINKNAME="$(pwd)/$TS_OUTDIR/${TS_NS}_lnk" +LINKNAME="$TS_OUTDIR/${TS_TESTNAME}_lnk" DEVICE=$(ts_device_init) [ "$?" == 0 ] || ts_die "Cannot init device" diff --git a/tests/ts/mount/fstab-uuid b/tests/ts/mount/fstab-uuid index bdd56d77..7f78e45e 100755 --- a/tests/ts/mount/fstab-uuid +++ b/tests/ts/mount/fstab-uuid @@ -15,12 +15,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="uuid" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by uuid (fstab)" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-uuid2devname b/tests/ts/mount/fstab-uuid2devname index 5feac01c..b1d2e777 100755 --- a/tests/ts/mount/fstab-uuid2devname +++ b/tests/ts/mount/fstab-uuid2devname @@ -15,12 +15,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="uuid2devname" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by uuid (fstab devname)" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/fstab-uuid2label b/tests/ts/mount/fstab-uuid2label index fff28ef2..7b21dfa2 100755 --- a/tests/ts/mount/fstab-uuid2label +++ b/tests/ts/mount/fstab-uuid2label @@ -15,14 +15,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="fstab" -TS_DESC="uuid2label" - +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by uuid (fstab label)" LABEL="testMountU2L" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/label b/tests/ts/mount/label index a5b28fa9..05df26ac 100755 --- a/tests/ts/mount/label +++ b/tests/ts/mount/label @@ -15,14 +15,12 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="mount" -TS_DESC="label" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by label" LABEL="testMountLabel" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/move b/tests/ts/mount/move index 7e579921..660ef436 100755 --- a/tests/ts/mount/move +++ b/tests/ts/mount/move @@ -15,20 +15,16 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="mount" -TS_DESC="move " +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="move" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot -PWD=$(pwd) - -DIR_SRC="$PWD/$TS_OUTDIR/mnt-move-src" -DIR_A="$PWD/$TS_OUTDIR/mnt-move-A" -DIR_B="$PWD/$TS_OUTDIR/mnt-move-B" +DIR_SRC="$TS_OUTDIR/mnt-move-src" +DIR_A="$TS_OUTDIR/mnt-move-A" +DIR_B="$TS_OUTDIR/mnt-move-B" [ -d $DIR_SRC ] || mkdir $DIR_SRC [ -d $DIR_A ] || mkdir $DIR_A diff --git a/tests/ts/mount/mtablock b/tests/ts/mount/mtablock index b2f989ed..137e1a2a 100755 --- a/tests/ts/mount/mtablock +++ b/tests/ts/mount/mtablock @@ -15,12 +15,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="mount" -TS_DESC="mtablock" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="mtab lock" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/noncanonical b/tests/ts/mount/noncanonical index c732e1bb..d9be68be 100755 --- a/tests/ts/mount/noncanonical +++ b/tests/ts/mount/noncanonical @@ -15,17 +15,13 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="mount" +TS_TOPDIR="$(dirname $0)/../.." TS_DESC="non canonical path" +. $TS_TOPDIR/functions.sh ts_init "$*" -if [ ! -e "/etc" ]; then - ts_skip "/etc not such file of directory" -fi +[ ! -e "/etc" ] && ts_skip "/etc not such file of directory" # Don't canonicalize SPEC for cifs, nfs, smbfs, ... $TS_CMD_MOUNT -v -v -v -f -i -n -t cifs //etc /foo | grep "spec:" >> $TS_OUTPUT 2>&1 diff --git a/tests/ts/mount/paths b/tests/ts/mount/paths index d77e87b6..93b44ae9 100755 --- a/tests/ts/mount/paths +++ b/tests/ts/mount/paths @@ -14,13 +14,11 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# -. ./commands.sh -. ./functions.sh -TS_COMPONENT="mount" +TS_TOPDIR="$(dirname $0)/../.." TS_DESC="basic paths" +. $TS_TOPDIR/functions.sh ts_init "$*" $TS_CMD_MOUNT -n -f -v -v -v /dev/dummy /mnt &> $TS_OUTPUT diff --git a/tests/ts/mount/remount b/tests/ts/mount/remount index 96d9b9b4..57dd074c 100755 --- a/tests/ts/mount/remount +++ b/tests/ts/mount/remount @@ -15,12 +15,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="mount" +TS_TOPDIR="$(dirname $0)/../.." TS_DESC="remount" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/special b/tests/ts/mount/special index 9ec78836..f31154ec 100755 --- a/tests/ts/mount/special +++ b/tests/ts/mount/special @@ -15,14 +15,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="mount" -TS_DESC="special program" - +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="call mount." MOUNTER="/sbin/mount.mytest" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot diff --git a/tests/ts/mount/uuid b/tests/ts/mount/uuid index ee186f07..e4611031 100755 --- a/tests/ts/mount/uuid +++ b/tests/ts/mount/uuid @@ -15,12 +15,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -. ./commands.sh -. ./functions.sh - -TS_COMPONENT="mount" -TS_DESC="uuid" +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="by uuid" +. $TS_TOPDIR/functions.sh ts_init "$*" ts_skip_nonroot