]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: use subtests for mountpoint(1)
authorKarel Zak <kzak@redhat.com>
Wed, 7 Aug 2019 09:45:57 +0000 (11:45 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 7 Aug 2019 09:45:57 +0000 (11:45 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/misc/mountpoint
tests/expected/misc/mountpoint-default [new file with mode: 0644]
tests/expected/misc/mountpoint-mutually-exclusive [new file with mode: 0644]
tests/expected/misc/mountpoint-nofollow [new file with mode: 0644]
tests/ts/misc/mountpoint

index e7c20cd25e3a81fb3226df7002be08a3f26b60f3..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,9 +0,0 @@
-default
-./symlink-to-root is a mountpoint
-0
-try --nofollow
-./symlink-to-root is not a mountpoint
-1
-mutually exclusive
-mountpoint: --devno and --nofollow are mutually exclusive
-1
diff --git a/tests/expected/misc/mountpoint-default b/tests/expected/misc/mountpoint-default
new file mode 100644 (file)
index 0000000..9a7ac6a
--- /dev/null
@@ -0,0 +1,2 @@
+./symlink-to-root is a mountpoint
+0
diff --git a/tests/expected/misc/mountpoint-mutually-exclusive b/tests/expected/misc/mountpoint-mutually-exclusive
new file mode 100644 (file)
index 0000000..38c36f1
--- /dev/null
@@ -0,0 +1,2 @@
+mountpoint: --devno and --nofollow are mutually exclusive
+1
diff --git a/tests/expected/misc/mountpoint-nofollow b/tests/expected/misc/mountpoint-nofollow
new file mode 100644 (file)
index 0000000..1ba1749
--- /dev/null
@@ -0,0 +1,2 @@
+./symlink-to-root is not a mountpoint
+1
index 0b93a9c36228d67a1c7131de812c4d1f8725d551..03c1ccc3ee700942ed540ef63119934d5d0e894e 100755 (executable)
@@ -10,18 +10,20 @@ ts_check_test_command "$TS_CMD_MOUNTPOINT"
 
 ln -s / ./symlink-to-root
 
-echo "default" >> $TS_OUTPUT 2>&1
+ts_init_subtest "default"
 $TS_CMD_MOUNTPOINT ./symlink-to-root >> $TS_OUTPUT 2>&1
 echo $? >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
 
-echo "try --nofollow" >> $TS_OUTPUT 2>&1
+ts_init_subtest "nofollow"
 $TS_CMD_MOUNTPOINT --nofollow ./symlink-to-root >> $TS_OUTPUT 2>&1
 echo $? >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
 
-echo "mutually exclusive" >> $TS_OUTPUT 2>&1
+ts_init_subtest "mutually-exclusive"
 $TS_CMD_MOUNTPOINT --devno --nofollow / >> $TS_OUTPUT 2>&1
 echo $? >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
 
 rm -f ./symlink-to-root
-
 ts_finalize