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-4461564c77260351fe3d82386eebf81085347b34.tar.gz
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 @@
# ls -ln is showing date. Need to remove that, it's variable
# sed: (1) "maj, min" -> "maj,min" (2) coalesce spaces
-# cut: remove user, group, and date
-FILTER_LS="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1,2,5,9-"
+# cut: remove date
+FILTER_LS="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-5,9-"
# testing "test name" "options" "expected result" "file input" "stdin"
@@ -16,6 +16,7 @@ mkdir mdev.testdir
# We need mdev executable to be in chroot jail!
# (will still fail with dynamically linked one, though...)
cp ../busybox mdev.testdir/mdev
+mkdir mdev.testdir/etc
mkdir mdev.testdir/dev
mkdir -p mdev.testdir/sys/block/sda
echo "8:0" >mdev.testdir/sys/block/sda/dev
@@ -25,7 +26,19 @@ testing "mdev add /block/sda" \
ls -ln mdev.testdir/dev | $FILTER_LS" \
"\
mdev: /etc/mdev.conf: No such file or directory
-brw-rw---- 1 8,0 sda
+brw-rw---- 1 0 0 8,0 sda
+" \
+ "" ""
+
+# continuing to use directory structure from prev test
+rm mdev.testdir/dev/sda
+echo ".* 1:1 666" >mdev.testdir/etc/mdev.conf
+echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf
+testing "mdev stops on first rule" \
+ "env - ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
+ ls -ln mdev.testdir/dev | $FILTER_LS" \
+"\
+brw-rw-rw- 1 1 1 8,0 sda
" \
"" ""