tests: use subtests for mountpoint(1)

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-08-07 11:45:57 +02:00
parent cd38987bf4
commit 11aaedf574
5 changed files with 12 additions and 13 deletions

View 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

View File

@ -0,0 +1,2 @@
./symlink-to-root is a mountpoint
0

View File

@ -0,0 +1,2 @@
mountpoint: --devno and --nofollow are mutually exclusive
1

View File

@ -0,0 +1,2 @@
./symlink-to-root is not a mountpoint
1

View File

@ -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