summaryrefslogtreecommitdiffstats
path: root/tests/ts/libmount/tabfiles-py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ts/libmount/tabfiles-py')
-rwxr-xr-xtests/ts/libmount/tabfiles-py75
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