aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archival/cpio.c1
-rw-r--r--coreutils/Kbuild1
-rw-r--r--networking/telnetd.c2
-rwxr-xr-xscripts/randomtest130
-rwxr-xr-xscripts/randomtest.loop36
-rwxr-xr-xtestsuite/ash.tests4
-rwxr-xr-xtestsuite/cpio.tests4
7 files changed, 109 insertions, 69 deletions
diff --git a/archival/cpio.c b/archival/cpio.c
index 2698f0791..e0ca7fa5c 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -311,6 +311,7 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
311 /* no parameters */ 311 /* no parameters */
312 opt_complementary = "=0"; 312 opt_complementary = "=0";
313 opt = getopt32(argv, OPTION_STR, &cpio_filename); 313 opt = getopt32(argv, OPTION_STR, &cpio_filename);
314 argv += optind;
314 if (opt & CPIO_OPT_FILE) { /* -F */ 315 if (opt & CPIO_OPT_FILE) { /* -F */
315 xmove_fd(xopen(cpio_filename, O_RDONLY), STDIN_FILENO); 316 xmove_fd(xopen(cpio_filename, O_RDONLY), STDIN_FILENO);
316 } 317 }
diff --git a/coreutils/Kbuild b/coreutils/Kbuild
index 460d62d3f..ee22a3f7b 100644
--- a/coreutils/Kbuild
+++ b/coreutils/Kbuild
@@ -17,6 +17,7 @@ lib-$(CONFIG_CATV) += catv.o
17lib-$(CONFIG_CHGRP) += chgrp.o chown.o 17lib-$(CONFIG_CHGRP) += chgrp.o chown.o
18lib-$(CONFIG_CHMOD) += chmod.o 18lib-$(CONFIG_CHMOD) += chmod.o
19lib-$(CONFIG_CHOWN) += chown.o 19lib-$(CONFIG_CHOWN) += chown.o
20lib-$(CONFIG_ADDUSER) += chown.o # used by adduser
20lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser 21lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser
21lib-$(CONFIG_CHROOT) += chroot.o 22lib-$(CONFIG_CHROOT) += chroot.o
22lib-$(CONFIG_CKSUM) += cksum.o 23lib-$(CONFIG_CKSUM) += cksum.o
diff --git a/networking/telnetd.c b/networking/telnetd.c
index a8c86b62f..ea66a25c0 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -227,7 +227,7 @@ make_new_session(
227 IF_NOT_FEATURE_TELNETD_STANDALONE(void) 227 IF_NOT_FEATURE_TELNETD_STANDALONE(void)
228) { 228) {
229#if !ENABLE_FEATURE_TELNETD_STANDALONE 229#if !ENABLE_FEATURE_TELNETD_STANDALONE
230 enum { sock = 0 ); 230 enum { sock = 0 };
231#endif 231#endif
232 const char *login_argv[2]; 232 const char *login_argv[2];
233 struct termios termbuf; 233 struct termios termbuf;
diff --git a/scripts/randomtest b/scripts/randomtest
index 6b7db9239..8d0d79e64 100755
--- a/scripts/randomtest
+++ b/scripts/randomtest
@@ -1,86 +1,88 @@
1#!/bin/sh 1#!/bin/sh
2 2
3# Select which libc to build against 3# If not specified in environment...
4libc="glibc" # assumed native 4if ! test "$LIBC"; then
5# static, cross-compilation 5 # Select which libc to build against
6libc="uclibc" 6 LIBC="glibc"
7 LIBC="uclibc"
8fi
7# x86 32-bit: 9# x86 32-bit:
8uclibc_cross="i486-linux-uclibc-" 10#CROSS_COMPILER_PREFIX="i486-linux-uclibc-"
9# My system has strange prefix for x86 64-bit uclibc: 11# My system has strange prefix for x86 64-bit uclibc:
10#uclibc_cross="x86_64-pc-linux-gnu-" 12#CROSS_COMPILER_PREFIX="x86_64-pc-linux-gnu-"
11 13
12test -d tree || exit 1 14if test $# -lt 2 || ! test -d "$1" || test -e "$2"; then
15 echo "Usage: $0 SRC_DIR TMP_DIR"
16 echo
17 echo "SRC_DIR will be copied to TMP_DIR directory."
18 echo "Then a random build will be performed."
19 echo
20 echo "Useful variables:"
21 echo "\$LIBC, \$CROSS_COMPILER_PREFIX, \$MAKEOPTS"
22 exit 1
23fi
13 24
14dir=test.$$ 25cp -dpr -- "$1" "$2" || { echo "copy error"; exit 1; }
15while test -e "$dir" -o -e failed."$dir"; do 26cd -- "$2" || { echo "cd $dir error"; exit 1; }
16 dir=test."$RANDOM"
17done
18 27
19cp -dpr tree "$dir" || exit 1 28# Generate random config
20cd "$dir" || exit 1 29make randconfig >/dev/null || { echo "randconfig error"; exit 1; }
21
22echo "Running randconfig test in $dir..." >&2
23
24make randconfig >/dev/null || exit 1
25 30
31# Tweak resulting config
26cat .config \ 32cat .config \
27| grep -v ^CONFIG_DEBUG_PESSIMIZE= \ 33| grep -v CONFIG_DEBUG_PESSIMIZE \
28| grep -v CONFIG_WERROR \ 34| grep -v CONFIG_WERROR \
29| cat >.config.new 35| grep -v CONFIG_CROSS_COMPILER_PREFIX \
30mv .config.new .config
31#echo CONFIG_WERROR=y >>.config
32echo '# CONFIG_WERROR is not set' >>.config
33
34test "$libc" = glibc && {
35cat .config \
36| grep -v CONFIG_STATIC \
37| grep -v CONFIG_SELINUX \ 36| grep -v CONFIG_SELINUX \
38| grep -v CONFIG_EFENCE \ 37| grep -v CONFIG_EFENCE \
39| grep -v CONFIG_DMALLOC \ 38| grep -v CONFIG_DMALLOC \
40| cat >.config.new 39\
40| grep -v CONFIG_RFKILL \
41>.config.new
41mv .config.new .config 42mv .config.new .config
42echo '# CONFIG_STATIC is not set' >>.config 43echo '# CONFIG_DEBUG_PESSIMIZE is not set' >>.config
43} 44echo '# CONFIG_WERROR is not set' >>.config
45echo "CONFIG_CROSS_COMPILER_PREFIX=\"${CROSS_COMPILER_PREFIX}\"" >>.config
44 46
45test "$libc" = uclibc && { 47# If glibc, don't build static
46cat .config \ 48if test x"$LIBC" = x"glibc"; then
47| grep -v ^CONFIG_SELINUX= \ 49 cat .config \
48| grep -v ^CONFIG_EFENCE= \ 50 | grep -v CONFIG_STATIC \
49| grep -v ^CONFIG_DMALLOC= \ 51 >.config.new
50| grep -v ^CONFIG_BUILD_LIBBUSYBOX= \ 52 mv .config.new .config
51| grep -v ^CONFIG_PAM= \ 53 echo '# CONFIG_STATIC is not set' >>.config
52| grep -v ^CONFIG_TASKSET= \ 54fi
53| grep -v ^CONFIG_UNICODE_SUPPORT= \ 55
54| grep -v ^CONFIG_PIE= \ 56# If glibc, build static, and remove some things
55| grep -v CONFIG_STATIC \ 57# likely to not work on uclibc.
56| grep -v CONFIG_CROSS_COMPILER_PREFIX \ 58if test x"$LIBC" = x"uclibc"; then
57| cat >.config.new 59 cat .config \
58mv .config.new .config 60 | grep -v CONFIG_STATIC \
59echo 'CONFIG_CROSS_COMPILER_PREFIX="'"$uclibc_cross"'"' >>.config 61 | grep -v CONFIG_BUILD_LIBBUSYBOX \
60echo 'CONFIG_STATIC=y' >>.config 62 | grep -v CONFIG_TASKSET \
61} 63 | grep -v CONFIG_UNICODE_SUPPORT \
64 | grep -v CONFIG_PIE \
65 >.config.new
66 mv .config.new .config
67 echo 'CONFIG_STATIC=y' >>.config
68fi
62 69
63# If STATIC, remove some things 70# If STATIC, remove some things.
64# PAM with static linking is probably pointless 71# PAM with static linking is probably pointless
65# (but I need to try - now I don't have libpam.a on my system, only libpam.so) 72# (but I need to try - now I don't have libpam.a on my system, only libpam.so)
66grep -q ^CONFIG_STATIC= .config && { 73if grep -q "^CONFIG_STATIC=y" .config; then
67cat .config \ 74 cat .config \
68| grep -v ^CONFIG_PAM= \ 75 | grep -v CONFIG_PAM \
69| cat >.config.new 76 >.config.new
70mv .config.new .config 77 mv .config.new .config
71} 78fi
72 79
73# Regenerate .config with default answers for yanked-off options 80# Regenerate .config with default answers for yanked-off options
74{ yes "" | make oldconfig >/dev/null; } || exit 1 81# (most of default answers are "no").
75 82{ yes "" | make oldconfig >/dev/null; } || { echo "oldconfig error"; exit 1; }
76nice -n 10 make $MAKEOPTS 2>&1 | tee -a make.log
77 83
78test -x busybox && { 84# Build!
79 cd .. 85nice -n 10 make $MAKEOPTS 2>&1 | tee make.log
80 rm -rf "$dir"
81 exit 0
82}
83 86
84cd .. 87# Return exitcode 1 if busybox executable does not exist
85mv "$dir" "failed.$dir" 88test -x busybox
86exit 1
diff --git a/scripts/randomtest.loop b/scripts/randomtest.loop
index 28edb6732..311536df8 100755
--- a/scripts/randomtest.loop
+++ b/scripts/randomtest.loop
@@ -1,10 +1,38 @@
1#!/bin/sh 1#!/bin/sh
2 2
3test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
4test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
5
6export LIBC="uclibc"
7export CROSS_COMPILER_PREFIX="i486-linux-uclibc-"
8export MAKEOPTS="-j9"
9
3cnt=0 10cnt=0
4fail=0 11fail=0
5
6while sleep 1; do 12while sleep 1; do
7 echo "Passes: $cnt Failures: $fail" 13 echo "Passes: $cnt Failures: $fail"
8 ./randomtest >/dev/null || exit #let fail++ 14 dir="test.$$"
9 let cnt++ 15 while test -e "$dir" -o -e "failed.$dir"; do
16 dir="test.$$.$RANDOM"
17 done
18 echo "Running randconfig test in $dir..."
19 if ! "$1/scripts/randomtest" "$1" "$dir" >/dev/null; then
20 mv -- "$dir" "failed.$dir"
21 echo "Failed build in: failed.$dir"
22 exit 1 # you may comment this out...
23 let fail++
24 else
25 (
26 cd -- "$dir/testsuite" || exit 1
27 echo "Running testsuite in $dir..."
28 SKIP_KNOWN_BUGS=1 SKIP_INTERNET_TESTS=1 ./runtest -v >runtest.log 2>&1
29 )
30 if test $? != 0; then
31 echo "Failed runtest in $dir"
32 exit 1
33 fi
34 tail -n10 -- "$dir/testsuite/runtest.log"
35 rm -rf -- "$dir"
36 fi
37 let cnt++
10done 38done
diff --git a/testsuite/ash.tests b/testsuite/ash.tests
index ce585beb1..183394a20 100755
--- a/testsuite/ash.tests
+++ b/testsuite/ash.tests
@@ -9,6 +9,10 @@
9 9
10test -f "$bindir/.config" && . "$bindir/.config" 10test -f "$bindir/.config" && . "$bindir/.config"
11 11
12test x"CONFIG_SCRIPT" = x"y" || exit 0
13test x"CONFIG_HEXDUMP" = x"y" || exit 0
14test x"CONFIG_FEATURE_DEVPTS" = x"y" || exit 0
15
12# testing "test name" "options" "expected result" "file input" "stdin" 16# testing "test name" "options" "expected result" "file input" "stdin"
13 17
14if test x"$CONFIG_UNICODE_PRESERVE_BROKEN" = x"y"; then 18if test x"$CONFIG_UNICODE_PRESERVE_BROKEN" = x"y"; then
diff --git a/testsuite/cpio.tests b/testsuite/cpio.tests
index 325664d71..2b8f0d030 100755
--- a/testsuite/cpio.tests
+++ b/testsuite/cpio.tests
@@ -69,6 +69,7 @@ ln cpio.testdir/empty cpio.testdir/empty1
69ln cpio.testdir/nonempty cpio.testdir/nonempty1 69ln cpio.testdir/nonempty cpio.testdir/nonempty1
70mkdir cpio.testdir2 70mkdir cpio.testdir2
71 71
72optional FEATURE_CPIO_O
72testing "cpio extracts zero-sized hardlinks 2" \ 73testing "cpio extracts zero-sized hardlinks 2" \
73"find cpio.testdir | cpio -H newc --create | (cd cpio.testdir2 && cpio -i 2>&1); echo \$?; 74"find cpio.testdir | cpio -H newc --create | (cd cpio.testdir2 && cpio -i 2>&1); echo \$?;
74ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \ 75ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \
@@ -82,10 +83,12 @@ ls -ln cpio.testdir2/cpio.testdir | $FILTER_LS" \
82-rw-r--r-- 1 $user $group 0 solo 83-rw-r--r-- 1 $user $group 0 solo
83" \ 84" \
84 "" "" 85 "" ""
86SKIP=
85 87
86 88
87# Was trying to create "/usr/bin", correct is "usr/bin". 89# Was trying to create "/usr/bin", correct is "usr/bin".
88rm -rf cpio.testdir 90rm -rf cpio.testdir
91optional FEATURE_CPIO_P
89testing "cpio -p with absolute paths" \ 92testing "cpio -p with absolute paths" \
90"echo /usr/bin | cpio -dp cpio.testdir 2>&1; echo \$?; 93"echo /usr/bin | cpio -dp cpio.testdir 2>&1; echo \$?;
91ls cpio.testdir" \ 94ls cpio.testdir" \
@@ -95,6 +98,7 @@ ls cpio.testdir" \
95usr 98usr
96" \ 99" \
97 "" "" 100 "" ""
101SKIP=
98 102
99 103
100# Clean up 104# Clean up