aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-03-27 20:49:26 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-03-27 20:49:26 +0000
commite1caabbb75ecf3537586aa3bbbe5921f3f1d43b7 (patch)
treee0bf083187ad53e2e4e825daf093fc88352c8f9b /testsuite
parent95891fc016c9911406cb826540873f0894bcbe8b (diff)
downloadbusybox-w32-e1caabbb75ecf3537586aa3bbbe5921f3f1d43b7.tar.gz
busybox-w32-e1caabbb75ecf3537586aa3bbbe5921f3f1d43b7.tar.bz2
busybox-w32-e1caabbb75ecf3537586aa3bbbe5921f3f1d43b7.zip
mdev: add testsuite entry
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/mdev.tests36
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
10FILTER_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
14rm -rf mdev.testdir
15mkdir mdev.testdir
16# We need mdev executable to be in chroot jail!
17# (will still fail with dynamically linked one, though...)
18cp ../busybox mdev.testdir/mdev
19mkdir mdev.testdir/dev
20mkdir -p mdev.testdir/sys/block/sda
21echo "8:0" >mdev.testdir/sys/block/sda/dev
22
23testing "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"\
27mdev: /etc/mdev.conf: No such file or directory
28mdev: chdir(/lib/firmware): No such file or directory
29brw-rw---- 1 8,0 sda
30" \
31 "" ""
32
33# clean up
34rm -rf mdev.testdir
35
36exit $FAILCOUNT