diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 02:42:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 02:42:50 +0000 |
commit | 8cb83eee5a58b1fad74c34094ce3afb9e430b5a4 (patch) | |
tree | a9b2e7baeca1be40eb734371e3c8b11b02294497 /tests/ts/libmount/tabfiles-py | |
parent | Initial commit. (diff) | |
download | util-linux-8cb83eee5a58b1fad74c34094ce3afb9e430b5a4.tar.xz util-linux-8cb83eee5a58b1fad74c34094ce3afb9e430b5a4.zip |
Adding upstream version 2.33.1.upstream/2.33.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | tests/ts/libmount/tabfiles-py | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/tests/ts/libmount/tabfiles-py b/tests/ts/libmount/tabfiles-py new file mode 100755 index 0000000..b157460 --- /dev/null +++ b/tests/ts/libmount/tabfiles-py @@ -0,0 +1,75 @@ +#!/bin/bash + +# Copyright (C) 2010 Karel Zak <kzak@redhat.com> + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="tab files-py" + +. $TS_TOPDIR/functions.sh +ts_init "$*" +ts_init_py libmount + +if [ -f "$ASAN_SYMBOLIZER_PATH" ]; then + TS_KNOWN_FAIL="yes" +fi + +PYDBG="$PYTHON -m pdb" +TESTPROG="$TS_HELPER_PYLIBMOUNT_TAB" +[ -x $TESTPROG ] || ts_die "test script missing" + +ts_init_subtest "parse-fstab" +$PYTHON $TESTPROG --parse "$TS_SELF/files/fstab" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "parse-fstab-full" +$PYTHON $TESTPROG --parse "$TS_SELF/files/fstab.comment" --comments &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "parse-mtab" +$PYTHON $TESTPROG --parse "$TS_SELF/files/mtab" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "parse-fstab-broken" +$PYTHON $TESTPROG --parse "$TS_SELF/files/fstab.broken" &> $TS_OUTPUT +sed -i -e 's/.*fstab.broken:[[:digit:]]*: parse error//g; s/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "parse-mountinfo" +$PYTHON $TESTPROG --parse "$TS_SELF/files/mountinfo" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "copy" +$PYTHON $TESTPROG --copy-fs "$TS_SELF/files/fstab" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "find-source" +$PYTHON $TESTPROG --find-forward "$TS_SELF/files/fstab" source UUID=fef7ccb3-821c-4de8-88dc-71472be5946f &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "find-target" +$PYTHON $TESTPROG --find-forward "$TS_SELF/files/fstab" target /home/foo &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "find-target2" +$PYTHON $TESTPROG --find-forward "$TS_SELF/files/fstab" target /any/foo &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "find-target3" +$PYTHON $TESTPROG --find-forward "$TS_SELF/files/fstab" target /any/foo/ &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "find-pair" +$PYTHON $TESTPROG --find-pair "$TS_SELF/files/mtab" /dev/mapper/kzak-home /home/kzak &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_finalize |