diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-05 13:45:22 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-05 13:45:22 +0200 |
commit | 9cf89cdf84fb20154088145980b676d2b28fc55d (patch) | |
tree | 436a0d02edc588782ca00796e14469288c3baa8d /testsuite | |
parent | feb79e8742eb3cef211804dadcc7f3ddfd154c72 (diff) | |
download | busybox-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-x | testsuite/mdev.tests | 4 | ||||
-rwxr-xr-x | testsuite/parse.tests | 44 |
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 |
169 | rm -rf mdev.testdir/dev/* | 169 | rm -rf mdev.testdir/dev/* |
170 | echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf | 170 | echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf |
171 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_SH_IS_ASH ASH_ECHO | 171 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME SH_IS_ASH ASH_ECHO |
172 | testing "mdev command" \ | 172 | testing "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 |
184 | rm -rf mdev.testdir/dev/* | 184 | rm -rf mdev.testdir/dev/* |
185 | echo "sda 0:0 644 =block/ @echo @echo TEST:\$MDEV" >mdev.testdir/etc/mdev.conf | 185 | echo "sda 0:0 644 =block/ @echo @echo TEST:\$MDEV" >mdev.testdir/etc/mdev.conf |
186 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_SH_IS_ASH | 186 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME SH_IS_ASH |
187 | testing "mdev move and command" \ | 187 | testing "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 | ||
8 | COLLAPSE=$(( 0x00010000)) | 8 | COLLAPSE=$(( 0x00010000)) |
9 | TRIM=$(( 0x00020000)) | 9 | TRIM=$(( 0x00020000)) |
10 | GREEDY=$(( 0x00040000)) | 10 | GREEDY=$(( 0x00040000)) |
11 | MIN_DIE=$(( 0x00100000)) | 11 | MIN_DIE=$(( 0x00100000)) |
12 | KEEP_COPY=$((0x00200000)) | 12 | KEEP_COPY=$(( 0x00200000)) |
13 | ESCAPE=$(( 0x00400000)) | 13 | EOL_COMMENTS=$((0x00400000)) |
14 | NORMAL=$(( COLLAPSE | TRIM | GREEDY)) | 14 | NORMAL=$(( 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 | ||
30 | testing "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 | |||
39 | testing "parse bad comment" \ | ||
40 | "parse -n 2 -m 2 -d '#=' -f $((GREEDY)) - 2>&1" \ | ||
41 | "\ | ||
42 | [var][val] | ||
43 | parse: 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 | ||
51 | var=val | ||
52 | #this causes error msg | ||
53 | #this=ok | ||
54 | #this==ok | ||
55 | #this==ok=ok=ok= | ||
56 | " | ||
57 | |||
30 | FILE=__parse | 58 | FILE=__parse |
31 | cat >$FILE <<EOF | 59 | cat >$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] |
100 | EOF | 130 | EOF |
101 | 131 | ||