aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-03-29 13:10:57 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-03-29 13:10:57 +0000
commit4461564c77260351fe3d82386eebf81085347b34 (patch)
tree6a7d926942063a825e6582dacbc586e28bbf3886 /testsuite
parent7cb808e1c5d6184dc3846f65344c7879f60de4f3 (diff)
downloadbusybox-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-xtestsuite/mdev.tests19
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
10FILTER_LS="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1,2,5,9-" 10FILTER_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...)
18cp ../busybox mdev.testdir/mdev 18cp ../busybox mdev.testdir/mdev
19mkdir mdev.testdir/etc
19mkdir mdev.testdir/dev 20mkdir mdev.testdir/dev
20mkdir -p mdev.testdir/sys/block/sda 21mkdir -p mdev.testdir/sys/block/sda
21echo "8:0" >mdev.testdir/sys/block/sda/dev 22echo "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"\
27mdev: /etc/mdev.conf: No such file or directory 28mdev: /etc/mdev.conf: No such file or directory
28brw-rw---- 1 8,0 sda 29brw-rw---- 1 0 0 8,0 sda
30" \
31 "" ""
32
33# continuing to use directory structure from prev test
34rm mdev.testdir/dev/sda
35echo ".* 1:1 666" >mdev.testdir/etc/mdev.conf
36echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf
37testing "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"\
41brw-rw-rw- 1 1 1 8,0 sda
29" \ 42" \
30 "" "" 43 "" ""
31 44