aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-05 13:45:22 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-05 13:45:22 +0200
commit9cf89cdf84fb20154088145980b676d2b28fc55d (patch)
tree436a0d02edc588782ca00796e14469288c3baa8d /testsuite
parentfeb79e8742eb3cef211804dadcc7f3ddfd154c72 (diff)
downloadbusybox-w32-9cf89cdf84fb20154088145980b676d2b28fc55d.tar.gz
busybox-w32-9cf89cdf84fb20154088145980b676d2b28fc55d.tar.bz2
busybox-w32-9cf89cdf84fb20154088145980b676d2b28fc55d.zip
sysctl: fix file parsing, do not require -w for VAR=VAL
function old new delta sysctl_act_on_setting - 451 +451 sysctl_main 222 282 +60 packed_usage 31744 31793 +49 config_read 604 639 +35 sysctl_act_recursive 612 163 -449 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/1 up/down: 595/-449) Total: 146 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/mdev.tests4
-rwxr-xr-xtestsuite/parse.tests44
2 files changed, 39 insertions, 9 deletions
diff --git a/testsuite/mdev.tests b/testsuite/mdev.tests
index 8515aff31..8e53ec564 100755
--- a/testsuite/mdev.tests
+++ b/testsuite/mdev.tests
@@ -168,7 +168,7 @@ SKIP=
168# continuing to use directory structure from prev test 168# continuing to use directory structure from prev test
169rm -rf mdev.testdir/dev/* 169rm -rf mdev.testdir/dev/*
170echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf 170echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf
171optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_SH_IS_ASH ASH_ECHO 171optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME SH_IS_ASH ASH_ECHO
172testing "mdev command" \ 172testing "mdev command" \
173 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; 173 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
174 ls -lnR mdev.testdir/dev | $FILTER_LS" \ 174 ls -lnR mdev.testdir/dev | $FILTER_LS" \
@@ -183,7 +183,7 @@ SKIP=
183# continuing to use directory structure from prev test 183# continuing to use directory structure from prev test
184rm -rf mdev.testdir/dev/* 184rm -rf mdev.testdir/dev/*
185echo "sda 0:0 644 =block/ @echo @echo TEST:\$MDEV" >mdev.testdir/etc/mdev.conf 185echo "sda 0:0 644 =block/ @echo @echo TEST:\$MDEV" >mdev.testdir/etc/mdev.conf
186optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_SH_IS_ASH 186optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME SH_IS_ASH
187testing "mdev move and command" \ 187testing "mdev move and command" \
188 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; 188 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
189 ls -lnR mdev.testdir/dev | $FILTER_LS2" \ 189 ls -lnR mdev.testdir/dev | $FILTER_LS2" \
diff --git a/testsuite/parse.tests b/testsuite/parse.tests
index 904e1a17a..2cbed6f31 100755
--- a/testsuite/parse.tests
+++ b/testsuite/parse.tests
@@ -5,13 +5,13 @@
5 5
6. ./testing.sh 6. ./testing.sh
7 7
8COLLAPSE=$(( 0x00010000)) 8COLLAPSE=$(( 0x00010000))
9TRIM=$(( 0x00020000)) 9TRIM=$(( 0x00020000))
10GREEDY=$(( 0x00040000)) 10GREEDY=$(( 0x00040000))
11MIN_DIE=$(( 0x00100000)) 11MIN_DIE=$(( 0x00100000))
12KEEP_COPY=$((0x00200000)) 12KEEP_COPY=$(( 0x00200000))
13ESCAPE=$(( 0x00400000)) 13EOL_COMMENTS=$((0x00400000))
14NORMAL=$(( COLLAPSE | TRIM | GREEDY)) 14NORMAL=$(( COLLAPSE | TRIM | GREEDY | EOL_COMMENTS))
15 15
16# testing "description" "command" "result" "infile" "stdin" 16# testing "description" "command" "result" "infile" "stdin"
17 17
@@ -27,6 +27,34 @@ testing "parse notrim" \
27 "-" \ 27 "-" \
28 " sda 0:0 644 @echo @echo TEST \n" 28 " sda 0:0 644 @echo @echo TEST \n"
29 29
30testing "parse comments" \
31 "parse -n 4 -m 3 -f $((NORMAL - EOL_COMMENTS)) -" \
32 "[sda][0:0][644][@echo @echo TEST #this is not eaten]\n" \
33 "-" \
34 "\
35# sda 0:0 644 @echo @echo TEST - this gets eaten
36 sda 0:0 644 @echo @echo TEST #this is not eaten
37"
38
39testing "parse bad comment" \
40 "parse -n 2 -m 2 -d '#=' -f $((GREEDY)) - 2>&1" \
41 "\
42[var][val]
43parse: bad line 3: 1 tokens found, 2 needed
44[ #this][ok]
45[ #this][=ok]
46[ #this][=ok=ok=ok=]
47" \
48 "-" \
49 "\
50# this gets eaten
51var=val
52 #this causes error msg
53 #this=ok
54 #this==ok
55 #this==ok=ok=ok=
56"
57
30FILE=__parse 58FILE=__parse
31cat >$FILE <<EOF 59cat >$FILE <<EOF
32# 60#
@@ -96,6 +124,8 @@ cat >$FILE.res <<EOF
96[option][dns][129.219.13.81] 124[option][dns][129.219.13.81]
97[option][domain][local] 125[option][domain][local]
98[option][lease][864000] 126[option][lease][864000]
127[option][msstaticroutes][10.0.0.0/8][10.127.0.1]
128[option][staticroutes][10.0.0.0/8][10.127.0.1,][10.11.12.0/24][10.11.12.1]
99[option][0x08][01020304] 129[option][0x08][01020304]
100EOF 130EOF
101 131