diff options
Diffstat (limited to 'tests/ts')
-rwxr-xr-x | tests/ts/column/table | 8 | ||||
-rwxr-xr-x | tests/ts/fdisk/mbr-nondos-mode | 7 | ||||
-rwxr-xr-x | tests/ts/libmount/context | 7 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/data-string-empty | 10 | ||||
-rwxr-xr-x | tests/ts/libsmartcols/fromfile | 46 | ||||
-rwxr-xr-x | tests/ts/misc/mountpoint | 29 | ||||
-rwxr-xr-x | tests/ts/partx/partx | 9 |
7 files changed, 106 insertions, 10 deletions
diff --git a/tests/ts/column/table b/tests/ts/column/table index bd1f16f3f..e64dee746 100755 --- a/tests/ts/column/table +++ b/tests/ts/column/table @@ -116,4 +116,12 @@ ts_init_subtest "empty-column" printf ':a:b\n' | $TS_CMD_COLUMN --table --separator ':' --output-separator ':' >> $TS_OUTPUT 2>&1 ts_finalize_subtest +ts_init_subtest "empty-column-at-eol" +printf '|' | $TS_CMD_COLUMN --separator '|' --output-separator '|' --table >> $TS_OUTPUT 2>&1 +ts_finalize_subtest + +ts_init_subtest "empty-column-at-eol2" +printf '||' | $TS_CMD_COLUMN --separator '|' --output-separator '|' --table >> $TS_OUTPUT 2>&1 +ts_finalize_subtest + ts_finalize diff --git a/tests/ts/fdisk/mbr-nondos-mode b/tests/ts/fdisk/mbr-nondos-mode index d3b35fa39..8fb09f1ce 100755 --- a/tests/ts/fdisk/mbr-nondos-mode +++ b/tests/ts/fdisk/mbr-nondos-mode @@ -37,19 +37,16 @@ FDISK_CMD_DELETE_1PRIMARY="d\n1\n" # delete first primary FDISK_CMD_DELETE_2PRIMARY="d\n2\n" # delete first primary FDISK_CMD_DELETE_EXTENDED="d\n3\n" # delete second primary -# Sparc uses SUN disk labels by default and thus has a different output +# ignore architectures where MBR is not a default ARCH=$(uname -m) case $ARCH in *sparc* ) - ARCH_EXT=".sparc" + ts_skip "unsupported" ;; *) - ARCH_EXT="" ;; esac -TS_EXPECTED+="${ARCH_EXT}" - function print_layout { echo -ne "\n---layout----------\n" >> $TS_OUTPUT $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} >> $TS_OUTPUT diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context index 3750c701f..6dd35b193 100755 --- a/tests/ts/libmount/context +++ b/tests/ts/libmount/context @@ -146,8 +146,8 @@ is_mounted $MOUNTPOINT && echo "$MOUNTPOINT still mounted" >> $TS_OUTPUT 2>&1 ts_finalize_subtest -# deprecated -ts_init_subtest "x-mount.mkdir" +# deprecated (x-* mount option maintained in userspace (e.g. utab) +ts_init_subtest "x-permanent" TS_NOEXIST="$TS_OUTDIR/${TS_TESTNAME}-${TS_SUBNAME}-noex" [ -d $TS_NOEXIST ] && rmdir $TS_NOEXIST @@ -159,7 +159,8 @@ $TS_CMD_UMOUNT $TS_NOEXIST rmdir $TS_NOEXIST -ts_init_subtest "X-mount.mkdir" +# X-* comment +ts_init_subtest "X-comment" TS_NOEXIST="$TS_OUTDIR/${TS_TESTNAME}-${TS_SUBNAME}-noex" [ -d $TS_NOEXIST ] && rmdir $TS_NOEXIST diff --git a/tests/ts/libsmartcols/files/data-string-empty b/tests/ts/libsmartcols/files/data-string-empty new file mode 100644 index 000000000..1f8ad34e5 --- /dev/null +++ b/tests/ts/libsmartcols/files/data-string-empty @@ -0,0 +1,10 @@ +aaaa +bbb +ccccc +dddddd +ee + +gggggg +hhh +iiiiii +jj diff --git a/tests/ts/libsmartcols/fromfile b/tests/ts/libsmartcols/fromfile index 274081ea0..20994d661 100755 --- a/tests/ts/libsmartcols/fromfile +++ b/tests/ts/libsmartcols/fromfile @@ -114,6 +114,52 @@ ts_run $TESTPROG --nlines 10 --maxout --width 80\ >> $TS_OUTPUT 2>&1 ts_finalize_subtest +ts_init_subtest "padding-default" +export LIBSMARTCOLS_DEBUG_PADDING=on +ts_run $TESTPROG --nlines 10 --width 80 \ + --column $TS_SELF/files/col-name \ + --column $TS_SELF/files/col-number \ + --column $TS_SELF/files/col-string \ + --column $TS_SELF/files/col-string \ + $TS_SELF/files/data-string \ + $TS_SELF/files/data-number \ + $TS_SELF/files/data-string-empty \ + $TS_SELF/files/data-string-empty \ + >> $TS_OUTPUT 2> /dev/null +ts_finalize_subtest + +ts_init_subtest "padding-maxout" +export LIBSMARTCOLS_DEBUG_PADDING=on +ts_run $TESTPROG --nlines 10 --width 80 \ + --maxout \ + --column $TS_SELF/files/col-name \ + --column $TS_SELF/files/col-number \ + --column $TS_SELF/files/col-string \ + --column $TS_SELF/files/col-string \ + $TS_SELF/files/data-string \ + $TS_SELF/files/data-number \ + $TS_SELF/files/data-string-empty \ + $TS_SELF/files/data-string-empty \ + >> $TS_OUTPUT 2> /dev/null +ts_finalize_subtest + +ts_init_subtest "padding-minout" +export LIBSMARTCOLS_DEBUG_PADDING=on +ts_run $TESTPROG --nlines 10 --width 80 \ + --minout \ + --column $TS_SELF/files/col-name \ + --column $TS_SELF/files/col-number \ + --column $TS_SELF/files/col-string \ + --column $TS_SELF/files/col-string \ + $TS_SELF/files/data-string \ + $TS_SELF/files/data-number \ + $TS_SELF/files/data-string-empty \ + $TS_SELF/files/data-string-empty \ + >> $TS_OUTPUT 2> /dev/null +ts_finalize_subtest + +unset LIBSMARTCOLS_DEBUG_PADDING + ts_init_subtest "strictwidth" ts_run $TESTPROG --nlines 10 \ --column $TS_SELF/files/col-name \ diff --git a/tests/ts/misc/mountpoint b/tests/ts/misc/mountpoint new file mode 100755 index 000000000..03c1ccc3e --- /dev/null +++ b/tests/ts/misc/mountpoint @@ -0,0 +1,29 @@ +#!/bin/bash + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="mountpoint" + +. $TS_TOPDIR/functions.sh +ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNTPOINT" + +ln -s / ./symlink-to-root + +ts_init_subtest "default" +$TS_CMD_MOUNTPOINT ./symlink-to-root >> $TS_OUTPUT 2>&1 +echo $? >> $TS_OUTPUT 2>&1 +ts_finalize_subtest + +ts_init_subtest "nofollow" +$TS_CMD_MOUNTPOINT --nofollow ./symlink-to-root >> $TS_OUTPUT 2>&1 +echo $? >> $TS_OUTPUT 2>&1 +ts_finalize_subtest + +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 diff --git a/tests/ts/partx/partx b/tests/ts/partx/partx index b21dc44ef..84c286a94 100755 --- a/tests/ts/partx/partx +++ b/tests/ts/partx/partx @@ -137,9 +137,14 @@ udevadm settle ts_init_subtest "delete-non-existent" #attempt to remove it again { + # remove non-existing partitions (ENXIO) is not error + # + # see ab025087f91b66ee8e23a16bc49eb0d9bd421d65 and + # 53ae7d60cfeacd4e87bfe6fcc015b58b78ef4555 + # $TS_CMD_PARTX -d --nr $PARTS $TS_DEVICE && - echo "partx failed: removed non-existing partition" || - echo "partx: OK" + echo "partx: OK" || + echo "partx failed: removed non-existing partition" } >$TS_OUTPUT 2>&1 ts_finalize_subtest |