From d87214a104e4296fdab67f3abdf8f2863862dbb4 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 3 Mar 2021 13:24:24 -0300 Subject: io: Use temporary directory and file for ftwtest-sh It allows run it in parallel. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- io/ftwtest-sh | 242 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 119 insertions(+), 123 deletions(-) (limited to 'io') diff --git a/io/ftwtest-sh b/io/ftwtest-sh index a9ae33ff30..b0d1389a73 100644 --- a/io/ftwtest-sh +++ b/io/ftwtest-sh @@ -43,15 +43,11 @@ export LC_ALL # First create our scenario: tmp=${objpfx}io -tmpdir=$tmp/ftwtest.d +tmpdir=$(mktemp -d $tmp/ftwtest.d.XXXXXX) +ftwtest=$(basename $tmpdir) trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 0 1 2 3 15 -if test -d $tmpdir; then - chmod -fR a+x $tmpdir - rm -fr $tmpdir -fi -mkdir $tmpdir mkdir $tmpdir/foo mkdir $tmpdir/bar echo > $tmpdir/baz @@ -67,24 +63,24 @@ ln -s $tmpdir/foo/lvl1/lvl2/lvl3/lvl4 $tmpdir/foo/lvl1/link@1 echo > $tmpdir/bar/xo chmod a-x,a+r $tmpdir/bar -testout=$tmp/ftwtest-tmp.out +testout=$(mktemp $tmp/ftwtest-tmp-XXXXXX.out) $testprogram $tmpdir | sort > $testout cat < $testout cat < $testout cat </dev/null` cat </dev/null` cd "$tmp" -$testprogram --chdir ftwtest.d | +$testprogram --chdir $ftwtest | sort > $testout cd "$curwd" cat < $testout cd "$curwd" cat </dev/null` cd "$tmp" -$testprogram --chdir ftwtest.d/foo/lvl1/link@1 | +$testprogram --chdir $ftwtest/foo/lvl1/link@1 | sort > $testout cd "$curwd" cat < $testout cat < $testout cat <