work on adding testsuite runs to randomconfig test builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -311,6 +311,7 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
/* no parameters */
|
/* no parameters */
|
||||||
opt_complementary = "=0";
|
opt_complementary = "=0";
|
||||||
opt = getopt32(argv, OPTION_STR, &cpio_filename);
|
opt = getopt32(argv, OPTION_STR, &cpio_filename);
|
||||||
|
argv += optind;
|
||||||
if (opt & CPIO_OPT_FILE) { /* -F */
|
if (opt & CPIO_OPT_FILE) { /* -F */
|
||||||
xmove_fd(xopen(cpio_filename, O_RDONLY), STDIN_FILENO);
|
xmove_fd(xopen(cpio_filename, O_RDONLY), STDIN_FILENO);
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ lib-$(CONFIG_CATV) += catv.o
|
|||||||
lib-$(CONFIG_CHGRP) += chgrp.o chown.o
|
lib-$(CONFIG_CHGRP) += chgrp.o chown.o
|
||||||
lib-$(CONFIG_CHMOD) += chmod.o
|
lib-$(CONFIG_CHMOD) += chmod.o
|
||||||
lib-$(CONFIG_CHOWN) += chown.o
|
lib-$(CONFIG_CHOWN) += chown.o
|
||||||
|
lib-$(CONFIG_ADDUSER) += chown.o # used by adduser
|
||||||
lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser
|
lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser
|
||||||
lib-$(CONFIG_CHROOT) += chroot.o
|
lib-$(CONFIG_CHROOT) += chroot.o
|
||||||
lib-$(CONFIG_CKSUM) += cksum.o
|
lib-$(CONFIG_CKSUM) += cksum.o
|
||||||
|
@ -227,7 +227,7 @@ make_new_session(
|
|||||||
IF_NOT_FEATURE_TELNETD_STANDALONE(void)
|
IF_NOT_FEATURE_TELNETD_STANDALONE(void)
|
||||||
) {
|
) {
|
||||||
#if !ENABLE_FEATURE_TELNETD_STANDALONE
|
#if !ENABLE_FEATURE_TELNETD_STANDALONE
|
||||||
enum { sock = 0 );
|
enum { sock = 0 };
|
||||||
#endif
|
#endif
|
||||||
const char *login_argv[2];
|
const char *login_argv[2];
|
||||||
struct termios termbuf;
|
struct termios termbuf;
|
||||||
|
@ -1,86 +1,88 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Select which libc to build against
|
# If not specified in environment...
|
||||||
libc="glibc" # assumed native
|
if ! test "$LIBC"; then
|
||||||
# static, cross-compilation
|
# Select which libc to build against
|
||||||
libc="uclibc"
|
LIBC="glibc"
|
||||||
|
LIBC="uclibc"
|
||||||
|
fi
|
||||||
# x86 32-bit:
|
# x86 32-bit:
|
||||||
uclibc_cross="i486-linux-uclibc-"
|
#CROSS_COMPILER_PREFIX="i486-linux-uclibc-"
|
||||||
# My system has strange prefix for x86 64-bit uclibc:
|
# My system has strange prefix for x86 64-bit uclibc:
|
||||||
#uclibc_cross="x86_64-pc-linux-gnu-"
|
#CROSS_COMPILER_PREFIX="x86_64-pc-linux-gnu-"
|
||||||
|
|
||||||
test -d tree || exit 1
|
if test $# -lt 2 || ! test -d "$1" || test -e "$2"; then
|
||||||
|
echo "Usage: $0 SRC_DIR TMP_DIR"
|
||||||
|
echo
|
||||||
|
echo "SRC_DIR will be copied to TMP_DIR directory."
|
||||||
|
echo "Then a random build will be performed."
|
||||||
|
echo
|
||||||
|
echo "Useful variables:"
|
||||||
|
echo "\$LIBC, \$CROSS_COMPILER_PREFIX, \$MAKEOPTS"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
dir=test.$$
|
cp -dpr -- "$1" "$2" || { echo "copy error"; exit 1; }
|
||||||
while test -e "$dir" -o -e failed."$dir"; do
|
cd -- "$2" || { echo "cd $dir error"; exit 1; }
|
||||||
dir=test."$RANDOM"
|
|
||||||
done
|
|
||||||
|
|
||||||
cp -dpr tree "$dir" || exit 1
|
# Generate random config
|
||||||
cd "$dir" || exit 1
|
make randconfig >/dev/null || { echo "randconfig error"; exit 1; }
|
||||||
|
|
||||||
echo "Running randconfig test in $dir..." >&2
|
|
||||||
|
|
||||||
make randconfig >/dev/null || exit 1
|
|
||||||
|
|
||||||
|
# Tweak resulting config
|
||||||
cat .config \
|
cat .config \
|
||||||
| grep -v ^CONFIG_DEBUG_PESSIMIZE= \
|
| grep -v CONFIG_DEBUG_PESSIMIZE \
|
||||||
| grep -v CONFIG_WERROR \
|
| grep -v CONFIG_WERROR \
|
||||||
| cat >.config.new
|
| grep -v CONFIG_CROSS_COMPILER_PREFIX \
|
||||||
mv .config.new .config
|
|
||||||
#echo CONFIG_WERROR=y >>.config
|
|
||||||
echo '# CONFIG_WERROR is not set' >>.config
|
|
||||||
|
|
||||||
test "$libc" = glibc && {
|
|
||||||
cat .config \
|
|
||||||
| grep -v CONFIG_STATIC \
|
|
||||||
| grep -v CONFIG_SELINUX \
|
| grep -v CONFIG_SELINUX \
|
||||||
| grep -v CONFIG_EFENCE \
|
| grep -v CONFIG_EFENCE \
|
||||||
| grep -v CONFIG_DMALLOC \
|
| grep -v CONFIG_DMALLOC \
|
||||||
| cat >.config.new
|
\
|
||||||
|
| grep -v CONFIG_RFKILL \
|
||||||
|
>.config.new
|
||||||
mv .config.new .config
|
mv .config.new .config
|
||||||
echo '# CONFIG_STATIC is not set' >>.config
|
echo '# CONFIG_DEBUG_PESSIMIZE is not set' >>.config
|
||||||
}
|
echo '# CONFIG_WERROR is not set' >>.config
|
||||||
|
echo "CONFIG_CROSS_COMPILER_PREFIX=\"${CROSS_COMPILER_PREFIX}\"" >>.config
|
||||||
|
|
||||||
test "$libc" = uclibc && {
|
# If glibc, don't build static
|
||||||
cat .config \
|
if test x"$LIBC" = x"glibc"; then
|
||||||
| grep -v ^CONFIG_SELINUX= \
|
cat .config \
|
||||||
| grep -v ^CONFIG_EFENCE= \
|
| grep -v CONFIG_STATIC \
|
||||||
| grep -v ^CONFIG_DMALLOC= \
|
>.config.new
|
||||||
| grep -v ^CONFIG_BUILD_LIBBUSYBOX= \
|
mv .config.new .config
|
||||||
| grep -v ^CONFIG_PAM= \
|
echo '# CONFIG_STATIC is not set' >>.config
|
||||||
| grep -v ^CONFIG_TASKSET= \
|
fi
|
||||||
| grep -v ^CONFIG_UNICODE_SUPPORT= \
|
|
||||||
| grep -v ^CONFIG_PIE= \
|
|
||||||
| grep -v CONFIG_STATIC \
|
|
||||||
| grep -v CONFIG_CROSS_COMPILER_PREFIX \
|
|
||||||
| cat >.config.new
|
|
||||||
mv .config.new .config
|
|
||||||
echo 'CONFIG_CROSS_COMPILER_PREFIX="'"$uclibc_cross"'"' >>.config
|
|
||||||
echo 'CONFIG_STATIC=y' >>.config
|
|
||||||
}
|
|
||||||
|
|
||||||
# If STATIC, remove some things
|
# If glibc, build static, and remove some things
|
||||||
|
# likely to not work on uclibc.
|
||||||
|
if test x"$LIBC" = x"uclibc"; then
|
||||||
|
cat .config \
|
||||||
|
| grep -v CONFIG_STATIC \
|
||||||
|
| grep -v CONFIG_BUILD_LIBBUSYBOX \
|
||||||
|
| grep -v CONFIG_TASKSET \
|
||||||
|
| grep -v CONFIG_UNICODE_SUPPORT \
|
||||||
|
| grep -v CONFIG_PIE \
|
||||||
|
>.config.new
|
||||||
|
mv .config.new .config
|
||||||
|
echo 'CONFIG_STATIC=y' >>.config
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If STATIC, remove some things.
|
||||||
# PAM with static linking is probably pointless
|
# PAM with static linking is probably pointless
|
||||||
# (but I need to try - now I don't have libpam.a on my system, only libpam.so)
|
# (but I need to try - now I don't have libpam.a on my system, only libpam.so)
|
||||||
grep -q ^CONFIG_STATIC= .config && {
|
if grep -q "^CONFIG_STATIC=y" .config; then
|
||||||
cat .config \
|
cat .config \
|
||||||
| grep -v ^CONFIG_PAM= \
|
| grep -v CONFIG_PAM \
|
||||||
| cat >.config.new
|
>.config.new
|
||||||
mv .config.new .config
|
mv .config.new .config
|
||||||
}
|
fi
|
||||||
|
|
||||||
# Regenerate .config with default answers for yanked-off options
|
# Regenerate .config with default answers for yanked-off options
|
||||||
{ yes "" | make oldconfig >/dev/null; } || exit 1
|
# (most of default answers are "no").
|
||||||
|
{ yes "" | make oldconfig >/dev/null; } || { echo "oldconfig error"; exit 1; }
|
||||||
|
|
||||||
nice -n 10 make $MAKEOPTS 2>&1 | tee -a make.log
|
# Build!
|
||||||
|
nice -n 10 make $MAKEOPTS 2>&1 | tee make.log
|
||||||
|
|
||||||
test -x busybox && {
|
# Return exitcode 1 if busybox executable does not exist
|
||||||
cd ..
|
test -x busybox
|
||||||
rm -rf "$dir"
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
mv "$dir" "failed.$dir"
|
|
||||||
exit 1
|
|
||||||
|
@ -1,10 +1,38 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
|
||||||
|
test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
|
||||||
|
|
||||||
|
export LIBC="uclibc"
|
||||||
|
export CROSS_COMPILER_PREFIX="i486-linux-uclibc-"
|
||||||
|
export MAKEOPTS="-j9"
|
||||||
|
|
||||||
cnt=0
|
cnt=0
|
||||||
fail=0
|
fail=0
|
||||||
|
|
||||||
while sleep 1; do
|
while sleep 1; do
|
||||||
echo "Passes: $cnt Failures: $fail"
|
echo "Passes: $cnt Failures: $fail"
|
||||||
./randomtest >/dev/null || exit #let fail++
|
dir="test.$$"
|
||||||
let cnt++
|
while test -e "$dir" -o -e "failed.$dir"; do
|
||||||
|
dir="test.$$.$RANDOM"
|
||||||
|
done
|
||||||
|
echo "Running randconfig test in $dir..."
|
||||||
|
if ! "$1/scripts/randomtest" "$1" "$dir" >/dev/null; then
|
||||||
|
mv -- "$dir" "failed.$dir"
|
||||||
|
echo "Failed build in: failed.$dir"
|
||||||
|
exit 1 # you may comment this out...
|
||||||
|
let fail++
|
||||||
|
else
|
||||||
|
(
|
||||||
|
cd -- "$dir/testsuite" || exit 1
|
||||||
|
echo "Running testsuite in $dir..."
|
||||||
|
SKIP_KNOWN_BUGS=1 SKIP_INTERNET_TESTS=1 ./runtest -v >runtest.log 2>&1
|
||||||
|
)
|
||||||
|
if test $? != 0; then
|
||||||
|
echo "Failed runtest in $dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
tail -n10 -- "$dir/testsuite/runtest.log"
|
||||||
|
rm -rf -- "$dir"
|
||||||
|
fi
|
||||||
|
let cnt++
|
||||||
done
|
done
|
||||||
|
@ -9,6 +9,10 @@
|
|||||||
|
|
||||||
test -f "$bindir/.config" && . "$bindir/.config"
|
test -f "$bindir/.config" && . "$bindir/.config"
|
||||||
|
|
||||||
|
test x"CONFIG_SCRIPT" = x"y" || exit 0
|
||||||
|
test x"CONFIG_HEXDUMP" = x"y" || exit 0
|
||||||
|
test x"CONFIG_FEATURE_DEVPTS" = x"y" || exit 0
|
||||||
|
|
||||||
# testing "test name" "options" "expected result" "file input" "stdin"
|
# testing "test name" "options" "expected result" "file input" "stdin"
|
||||||
|
|
||||||
if test x"$CONFIG_UNICODE_PRESERVE_BROKEN" = x"y"; then
|
if test x"$CONFIG_UNICODE_PRESERVE_BROKEN" = x"y"; then
|
||||||
|
@ -69,6 +69,7 @@ ln cpio.testdir/empty cpio.testdir/empty1
|
|||||||
ln cpio.testdir/nonempty cpio.testdir/nonempty1
|
ln cpio.testdir/nonempty cpio.testdir/nonempty1
|
||||||
mkdir cpio.testdir2
|
mkdir cpio.testdir2
|
||||||
|
|
||||||
|
optional FEATURE_CPIO_O
|
||||||
testing "cpio extracts zero-sized hardlinks 2" \
|
testing "cpio extracts zero-sized hardlinks 2" \
|
||||||
"find cpio.testdir | cpio -H newc --create | (cd cpio.testdir2 && cpio -i 2>&1); echo \$?;
|
"find cpio.testdir | cpio -H newc --create | (cd cpio.testdir2 && cpio -i 2>&1); echo \$?;
|
||||||
ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \
|
ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \
|
||||||
@ -82,10 +83,12 @@ ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \
|
|||||||
-rw-r--r-- 1 $user $group 0 solo
|
-rw-r--r-- 1 $user $group 0 solo
|
||||||
" \
|
" \
|
||||||
"" ""
|
"" ""
|
||||||
|
SKIP=
|
||||||
|
|
||||||
|
|
||||||
# Was trying to create "/usr/bin", correct is "usr/bin".
|
# Was trying to create "/usr/bin", correct is "usr/bin".
|
||||||
rm -rf cpio.testdir
|
rm -rf cpio.testdir
|
||||||
|
optional FEATURE_CPIO_P
|
||||||
testing "cpio -p with absolute paths" \
|
testing "cpio -p with absolute paths" \
|
||||||
"echo /usr/bin | cpio -dp cpio.testdir 2>&1; echo \$?;
|
"echo /usr/bin | cpio -dp cpio.testdir 2>&1; echo \$?;
|
||||||
ls cpio.testdir" \
|
ls cpio.testdir" \
|
||||||
@ -95,6 +98,7 @@ ls cpio.testdir" \
|
|||||||
usr
|
usr
|
||||||
" \
|
" \
|
||||||
"" ""
|
"" ""
|
||||||
|
SKIP=
|
||||||
|
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
|
Reference in New Issue
Block a user