From cfe5e3905201349e9cf3f95d52ff4bd100bde37d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 21:10:49 +0200 Subject: Adding upstream version 2.39.3. Signed-off-by: Daniel Baumann --- tests/ts/libmount/tabfiles | 85 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 tests/ts/libmount/tabfiles (limited to 'tests/ts/libmount/tabfiles') diff --git a/tests/ts/libmount/tabfiles b/tests/ts/libmount/tabfiles new file mode 100755 index 0000000..1de740e --- /dev/null +++ b/tests/ts/libmount/tabfiles @@ -0,0 +1,85 @@ +#!/bin/bash + +# Copyright (C) 2010 Karel Zak + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="tab files" + +. "$TS_TOPDIR"/functions.sh +ts_init "$*" + +TESTPROG="$TS_HELPER_LIBMOUNT_TAB" + +[ -x $TESTPROG ] || ts_skip "test not compiled" + +ts_init_subtest "parse-fstab" +ts_run $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" +ts_run $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" +ts_run $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" +ts_run $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" +ts_run $TESTPROG --parse "$TS_SELF/files/mountinfo" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "parse-mountinfo-nosrc" +ts_run $TESTPROG --parse "$TS_SELF/files/mountinfo_nosrc" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "parse-swaps" +ts_run $TESTPROG --parse "$TS_SELF/files/swaps" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "copy" +ts_run $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" +ts_run $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" +ts_run $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" +ts_run $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" +ts_run $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" +ts_run $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_init_subtest "find-fs" +ts_run $TESTPROG --find-fs "$TS_SELF/files/mountinfo" /home/kzak &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_finalize -- cgit v1.2.3