From: Karel Zak Date: Wed, 31 Jan 2007 15:45:01 +0000 (+0100) Subject: namei: new regression test X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db4f8e3b381accb46f31dec5767241782953fa2;p=util-linux namei: new regression test Signed-off-by: Karel Zak --- diff --git a/tests/commands.sh.in b/tests/commands.sh.in index 92deda21..061b42b9 100644 --- a/tests/commands.sh.in +++ b/tests/commands.sh.in @@ -13,3 +13,7 @@ TS_CMD_SWAPOFF=${TS_CMD_MOUNT:-"$TOPDIR/mount/swapoff"} TS_CMD_IPCS=${TS_CMD_IPCS:-"$TOPDIR/sys-utils/ipcs"} TS_CMD_COL=${TS_CMD_COL:-"$TOPDIR/text-utils/col"} + +TS_CMD_NAMEI=${TS_CMD_NAMEI-"$TOPDIR/misc-utils/namei"} + + diff --git a/tests/expected/ts-namei-logic b/tests/expected/ts-namei-logic new file mode 100644 index 00000000..b8624621 --- /dev/null +++ b/tests/expected/ts-namei-logic @@ -0,0 +1,19 @@ +f: output/namei/namei1/namei2/a + d output + d namei + d namei1 + d namei2 + - a +f: output/namei/namei1/namei2/b + d output + d namei + d namei1 + d namei2 + - b +f: output/namei/namei1/namei2/a/b + d output + d namei + d namei1 + d namei2 + - a + ? b - No such file or directory (2) diff --git a/tests/functions.sh b/tests/functions.sh index 8e8b34f7..6c6fa959 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -1,8 +1,8 @@ -TS_OUTDIR="$TS_TOPDIR/output" -TS_DIFFDIR="$TS_TOPDIR/diff" -TS_EXPECTEDDIR="$TS_TOPDIR/expected" -TS_INPUTDIR="$TS_TOPDIR/input" +TS_OUTDIR="output" +TS_DIFFDIR="diff" +TS_EXPECTEDDIR="expected" +TS_INPUTDIR="input" function ts_skip { echo " IGNORE ($1)" diff --git a/tests/ts-namei-logic b/tests/ts-namei-logic new file mode 100755 index 00000000..55cd7579 --- /dev/null +++ b/tests/ts-namei-logic @@ -0,0 +1,23 @@ +#!/bin/bash + +. commands.sh +. functions.sh + +TS_COMPONENT="namei" +TS_DESC="logic" + +ts_init + +SANDBOX="$TS_OUTDIR/namei" + +mkdir -p $SANDBOX/namei1/namei2 +touch $SANDBOX/namei1/namei2/a $SANDBOX/namei1/namei2/b + +touch $TS_OUTPUT + +$TS_CMD_NAMEI $SANDBOX/namei1/namei2/a >> $TS_OUTPUT 2>&1 +$TS_CMD_NAMEI $SANDBOX/namei1/namei2/b >> $TS_OUTPUT 2>&1 +$TS_CMD_NAMEI $SANDBOX/namei1/namei2/a/b >> $TS_OUTPUT 2>&1 + +ts_finalize +