diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-29 13:10:57 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-29 13:10:57 +0000 |
commit | 4461564c77260351fe3d82386eebf81085347b34 (patch) | |
tree | 6a7d926942063a825e6582dacbc586e28bbf3886 /testsuite | |
parent | 7cb808e1c5d6184dc3846f65344c7879f60de4f3 (diff) | |
download | busybox-w32-4461564c77260351fe3d82386eebf81085347b34.tar.gz busybox-w32-4461564c77260351fe3d82386eebf81085347b34.tar.bz2 busybox-w32-4461564c77260351fe3d82386eebf81085347b34.zip |
mdev: fix a bug where it was not stopping on first matching rule
(testsuite entry added). Revamped line parsing while at it.
function old new delta
next_field - 36 +36
make_device 1104 1022 -82
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 36/-82) Total: -46 bytes
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/mdev.tests | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/testsuite/mdev.tests b/testsuite/mdev.tests index 4c44adcb8..1ee762828 100755 --- a/testsuite/mdev.tests +++ b/testsuite/mdev.tests | |||
@@ -6,8 +6,8 @@ | |||
6 | 6 | ||
7 | # ls -ln is showing date. Need to remove that, it's variable | 7 | # ls -ln is showing date. Need to remove that, it's variable |
8 | # sed: (1) "maj, min" -> "maj,min" (2) coalesce spaces | 8 | # sed: (1) "maj, min" -> "maj,min" (2) coalesce spaces |
9 | # cut: remove user, group, and date | 9 | # cut: remove date |
10 | FILTER_LS="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1,2,5,9-" | 10 | FILTER_LS="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-5,9-" |
11 | 11 | ||
12 | # testing "test name" "options" "expected result" "file input" "stdin" | 12 | # testing "test name" "options" "expected result" "file input" "stdin" |
13 | 13 | ||
@@ -16,6 +16,7 @@ mkdir mdev.testdir | |||
16 | # We need mdev executable to be in chroot jail! | 16 | # We need mdev executable to be in chroot jail! |
17 | # (will still fail with dynamically linked one, though...) | 17 | # (will still fail with dynamically linked one, though...) |
18 | cp ../busybox mdev.testdir/mdev | 18 | cp ../busybox mdev.testdir/mdev |
19 | mkdir mdev.testdir/etc | ||
19 | mkdir mdev.testdir/dev | 20 | mkdir mdev.testdir/dev |
20 | mkdir -p mdev.testdir/sys/block/sda | 21 | mkdir -p mdev.testdir/sys/block/sda |
21 | echo "8:0" >mdev.testdir/sys/block/sda/dev | 22 | echo "8:0" >mdev.testdir/sys/block/sda/dev |
@@ -25,7 +26,19 @@ testing "mdev add /block/sda" \ | |||
25 | ls -ln mdev.testdir/dev | $FILTER_LS" \ | 26 | ls -ln mdev.testdir/dev | $FILTER_LS" \ |
26 | "\ | 27 | "\ |
27 | mdev: /etc/mdev.conf: No such file or directory | 28 | mdev: /etc/mdev.conf: No such file or directory |
28 | brw-rw---- 1 8,0 sda | 29 | brw-rw---- 1 0 0 8,0 sda |
30 | " \ | ||
31 | "" "" | ||
32 | |||
33 | # continuing to use directory structure from prev test | ||
34 | rm mdev.testdir/dev/sda | ||
35 | echo ".* 1:1 666" >mdev.testdir/etc/mdev.conf | ||
36 | echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf | ||
37 | testing "mdev stops on first rule" \ | ||
38 | "env - ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; | ||
39 | ls -ln mdev.testdir/dev | $FILTER_LS" \ | ||
40 | "\ | ||
41 | brw-rw-rw- 1 1 1 8,0 sda | ||
29 | " \ | 42 | " \ |
30 | "" "" | 43 | "" "" |
31 | 44 | ||