diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-27 20:49:26 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-27 20:49:26 +0000 |
commit | e1caabbb75ecf3537586aa3bbbe5921f3f1d43b7 (patch) | |
tree | e0bf083187ad53e2e4e825daf093fc88352c8f9b /testsuite | |
parent | 95891fc016c9911406cb826540873f0894bcbe8b (diff) | |
download | busybox-w32-e1caabbb75ecf3537586aa3bbbe5921f3f1d43b7.tar.gz busybox-w32-e1caabbb75ecf3537586aa3bbbe5921f3f1d43b7.tar.bz2 busybox-w32-e1caabbb75ecf3537586aa3bbbe5921f3f1d43b7.zip |
mdev: add testsuite entry
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/mdev.tests | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/mdev.tests b/testsuite/mdev.tests new file mode 100755 index 000000000..fd8e974b0 --- /dev/null +++ b/testsuite/mdev.tests | |||
@@ -0,0 +1,36 @@ | |||
1 | #!/bin/sh | ||
2 | # Copyright 2008 by Denys Vlasenko | ||
3 | # Licensed under GPL v2, see file LICENSE for details. | ||
4 | |||
5 | . testing.sh | ||
6 | |||
7 | # ls -ln is showing date. Need to remove that, it's variable | ||
8 | # sed: (1) "maj, min" -> "maj,min" (2) coalesce spaces | ||
9 | # cut: remove user, group, and date | ||
10 | FILTER_LS="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1,2,5,9-" | ||
11 | |||
12 | # testing "test name" "options" "expected result" "file input" "stdin" | ||
13 | |||
14 | rm -rf mdev.testdir | ||
15 | mkdir mdev.testdir | ||
16 | # We need mdev executable to be in chroot jail! | ||
17 | # (will still fail with dynamically linked one, though...) | ||
18 | cp ../busybox mdev.testdir/mdev | ||
19 | mkdir mdev.testdir/dev | ||
20 | mkdir -p mdev.testdir/sys/block/sda | ||
21 | echo "8:0" >mdev.testdir/sys/block/sda/dev | ||
22 | |||
23 | testing "mdev add /block/sda" \ | ||
24 | "env - ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; | ||
25 | ls -ln mdev.testdir/dev | $FILTER_LS" \ | ||
26 | "\ | ||
27 | mdev: /etc/mdev.conf: No such file or directory | ||
28 | mdev: chdir(/lib/firmware): No such file or directory | ||
29 | brw-rw---- 1 8,0 sda | ||
30 | " \ | ||
31 | "" "" | ||
32 | |||
33 | # clean up | ||
34 | rm -rf mdev.testdir | ||
35 | |||
36 | exit $FAILCOUNT | ||