more randomconfig testsuite fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-05-10 11:00:11 +02:00
parent e3d90a90d4
commit 8e3aff0ce0
6 changed files with 60 additions and 52 deletions

View File

@ -3,52 +3,52 @@
test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
# cd to objtree
cd "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
cd -- "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
srctree="$1"
find -type d | while read; do
d="$REPLY"
d="$REPLY"
src="$srctree/$d/Kbuild.src"
dst="$d/Kbuild"
if test -f "$src"; then
echo " CHK $dst"
src="$srctree/$d/Kbuild.src"
dst="$d/Kbuild"
if test -f "$src"; then
echo " CHK $dst"
s=`sed -n 's@^//kbuild:@@p' "$srctree/$d"/*.c`
echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp"
while read; do
test x"$REPLY" = x"INSERT" && REPLY="$s"
printf "%s\n" "$REPLY"
done <"$src" >>"$dst.$$.tmp"
s=`sed -n 's@^//kbuild:@@p' -- "$srctree/$d"/*.c`
echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp"
while read; do
test x"$REPLY" = x"INSERT" && REPLY="$s"
printf "%s\n" "$REPLY"
done <"$src" >>"$dst.$$.tmp"
if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
rm "$dst.$$.tmp"
else
echo " GEN $dst"
mv "$dst.$$.tmp" "$dst"
if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
rm -- "$dst.$$.tmp"
else
echo " GEN $dst"
mv -- "$dst.$$.tmp" "$dst"
fi
fi
fi
src="$srctree/$d/Config.src"
dst="$d/Config.in"
if test -f "$src"; then
echo " CHK $dst"
src="$srctree/$d/Config.src"
dst="$d/Config.in"
if test -f "$src"; then
echo " CHK $dst"
s=`sed -n 's@^//config:@@p' "$srctree/$d"/*.c`
echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp"
while read; do
test x"$REPLY" = x"INSERT" && REPLY="$s"
printf "%s\n" "$REPLY"
done <"$src" >>"$dst.$$.tmp"
s=`sed -n 's@^//config:@@p' -- "$srctree/$d"/*.c`
echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp"
while read; do
test x"$REPLY" = x"INSERT" && REPLY="$s"
printf "%s\n" "$REPLY"
done <"$src" >>"$dst.$$.tmp"
if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
rm "$dst.$$.tmp"
else
echo " GEN $dst"
mv "$dst.$$.tmp" "$dst"
if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
rm -- "$dst.$$.tmp"
else
echo " GEN $dst"
mv -- "$dst.$$.tmp" "$dst"
fi
fi
fi
done

View File

@ -33,7 +33,7 @@ testing "awk long field sep" "awk -F-- '{ print NF, length(\$NF), \$NF }'" \
testing "awk gsub falls back to non-extended-regex" \
"awk 'gsub(\"@(samp|code|file)\{\",\"\");'; echo \$?" "0\n" "" "Hi\n"
optional FEATURE_SEAMLESS_BZ2
optional TAR BUNZIP2 FEATURE_SEAMLESS_BZ2
test x"$SKIP" != x"1" && tar xjf awk_t1.tar.bz2
testing "awk 'gcc build bug'" \
"awk -f awk_t1_opt-functions.awk -f awk_t1_opth-gen.awk <awk_t1_input | md5sum" \

View File

@ -69,7 +69,7 @@ ln cpio.testdir/empty cpio.testdir/empty1
ln cpio.testdir/nonempty cpio.testdir/nonempty1
mkdir cpio.testdir2
optional FEATURE_CPIO_O
optional FEATURE_CPIO_O LONG_OPTS
testing "cpio extracts zero-sized hardlinks 2" \
"find cpio.testdir | cpio -H newc --create | (cd cpio.testdir2 && cpio -i 2>&1); echo \$?;
ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \

View File

@ -16,7 +16,7 @@ FILTER_LS2="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-4,9-"
rm -rf makedevs.testdir
mkdir makedevs.testdir
optional FEATURE_LS_RECURSIVE
optional FEATURE_MAKEDEVS_TABLE FEATURE_FIND_NOT FEATURE_FIND_TYPE FEATURE_LS_RECURSIVE
testing "makedevs -d ../makedevs.device_table.txt ." \
"(cd makedevs.testdir && makedevs -d ../makedevs.device_table.txt . 2>&1);
find makedevs.testdir ! -type d | sort | xargs ls -lnR | $FILTER_LS" \

View File

@ -27,6 +27,7 @@ echo "8:0" >mdev.testdir/sys/block/sda/dev
# env - PATH=$PATH: on some systems chroot binary won't otherwise be found
optional STATIC
testing "mdev add /block/sda" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \
@ -34,11 +35,13 @@ testing "mdev add /block/sda" \
brw-rw---- 1 0 0 8,0 sda
" \
"" ""
SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo ".* 1:1 666" >mdev.testdir/etc/mdev.conf
echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf
optional STATIC FEATURE_MDEV_CONF
testing "mdev stops on first rule" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \
@ -46,11 +49,13 @@ testing "mdev stops on first rule" \
brw-rw-rw- 1 1 1 8,0 sda
" \
"" ""
SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "-.* 1:1 666" >mdev.testdir/etc/mdev.conf
echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf
optional STATIC FEATURE_MDEV_CONF
testing "mdev does not stop on dash-rule" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \
@ -58,12 +63,14 @@ testing "mdev does not stop on dash-rule" \
br--r--r-- 1 2 2 8,0 sda
" \
"" ""
SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "\$MODALIAS=qw 1:1 666" >mdev.testdir/etc/mdev.conf
echo "\$MODALIAS=qw. 2:2 444" >>mdev.testdir/etc/mdev.conf
echo "\$MODALIAS=qw. 3:3 400" >>mdev.testdir/etc/mdev.conf
optional STATIC FEATURE_MDEV_CONF
testing "mdev \$ENVVAR=regex match" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda MODALIAS=qwe chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \
@ -71,11 +78,12 @@ testing "mdev \$ENVVAR=regex match" \
br--r--r-- 1 2 2 8,0 sda
" \
"" ""
SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf
optional FEATURE_LS_RECURSIVE
optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE
testing "mdev move/symlink rule '>bar/baz'" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \
@ -93,7 +101,7 @@ SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "sda 0:0 444 >disk/" >mdev.testdir/etc/mdev.conf
optional FEATURE_LS_RECURSIVE
optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE
testing "mdev move/symlink rule '>bar/'" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \
@ -112,7 +120,7 @@ SKIP=
rm -rf mdev.testdir/dev/*
# here we complicate things by having non-matching group 1 and using %0
echo "s([0-9])*d([a-z]+) 0:0 644 >sd/%2_%0" >mdev.testdir/etc/mdev.conf
optional FEATURE_LS_RECURSIVE
optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE
testing "mdev regexp substring match + replace" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \
@ -130,7 +138,7 @@ SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf
optional FEATURE_LS_RECURSIVE
optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE
testing "mdev command" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS" \
@ -145,7 +153,7 @@ SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "sda 0:0 644 =block/ @echo @echo TEST:\$MDEV" >mdev.testdir/etc/mdev.conf
optional FEATURE_LS_RECURSIVE
optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE
testing "mdev move and command" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \
@ -163,7 +171,7 @@ SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "@8,0 0:1 644" >mdev.testdir/etc/mdev.conf
optional FEATURE_LS_RECURSIVE
optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE
testing "mdev #maj,min and no explicit uid" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS" \
@ -186,7 +194,7 @@ echo "capi 0:0 0660 =capi20" >mdev.testdir/etc/mdev.conf
echo "capi([0-9]) 0:0 0660 =capi20.0%1" >>mdev.testdir/etc/mdev.conf
echo "capi([0-9]*) 0:0 0660 =capi20.%1" >>mdev.testdir/etc/mdev.conf
# mdev invocation with DEVPATH=/class/tty/capi20 was deleting /dev/capi20
optional FEATURE_LS_RECURSIVE
optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE
testing "move rule does not delete node with name == device_name" \
"\
env - PATH=$PATH ACTION=add DEVPATH=/class/tty/capi chroot mdev.testdir /mdev 2>&1;

View File

@ -54,14 +54,14 @@ test x"$ECHO" != x"" || {
optional()
{
option=`echo ":$OPTIONFLAGS:" | grep ":$1:"`
# Not set?
if [ -z "$1" ] || [ -z "$OPTIONFLAGS" ] || [ ${#option} -ne 0 ]
then
SKIP=
return
fi
SKIP=1
SKIP=
while test "$1"; do
if test x"${OPTIONFLAGS/*:$1:*/y}" != x"y"; then
SKIP=1
return
fi
shift
done
}
# The testing function