Denis Vlasenko | e1fa817 | 2008-08-01 02:15:05 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2008 by Denys Vlasenko |
| 3 | # Licensed under GPL v2, see file LICENSE for details. |
| 4 | |
Mike Frysinger | caa7940 | 2009-11-04 18:41:22 -0500 | [diff] [blame] | 5 | . ./testing.sh |
Denis Vlasenko | e1fa817 | 2008-08-01 02:15:05 +0000 | [diff] [blame] | 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 date |
| 10 | FILTER_LS="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-5,9-" |
| 11 | # cut: remove size+date |
| 12 | FILTER_LS2="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-4,9-" |
| 13 | |
| 14 | # testing "test name" "options" "expected result" "file input" "stdin" |
| 15 | |
| 16 | rm -rf makedevs.testdir |
| 17 | mkdir makedevs.testdir |
| 18 | |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 19 | optional FEATURE_MAKEDEVS_TABLE FEATURE_FIND_NOT FEATURE_FIND_TYPE FEATURE_LS_RECURSIVE FEATURE_LS_SORTFILES |
Denis Vlasenko | e1fa817 | 2008-08-01 02:15:05 +0000 | [diff] [blame] | 20 | testing "makedevs -d ../makedevs.device_table.txt ." \ |
| 21 | "(cd makedevs.testdir && makedevs -d ../makedevs.device_table.txt . 2>&1); |
| 22 | find makedevs.testdir ! -type d | sort | xargs ls -lnR | $FILTER_LS" \ |
| 23 | "\ |
| 24 | rootdir=. |
| 25 | table='../makedevs.device_table.txt' |
| 26 | crw-rw-rw- 1 0 0 5,1 makedevs.testdir/dev/console |
| 27 | crw-r----- 1 0 5 29,0 makedevs.testdir/dev/fb0 |
| 28 | crw-r----- 1 0 5 29,32 makedevs.testdir/dev/fb1 |
| 29 | crw-r----- 1 0 5 29,64 makedevs.testdir/dev/fb2 |
| 30 | crw-r----- 1 0 5 29,96 makedevs.testdir/dev/fb3 |
| 31 | brw-r----- 1 0 0 3,0 makedevs.testdir/dev/hda |
| 32 | brw-r----- 1 0 0 3,1 makedevs.testdir/dev/hda1 |
| 33 | brw-r----- 1 0 0 3,10 makedevs.testdir/dev/hda10 |
| 34 | brw-r----- 1 0 0 3,11 makedevs.testdir/dev/hda11 |
| 35 | brw-r----- 1 0 0 3,12 makedevs.testdir/dev/hda12 |
| 36 | brw-r----- 1 0 0 3,13 makedevs.testdir/dev/hda13 |
| 37 | brw-r----- 1 0 0 3,14 makedevs.testdir/dev/hda14 |
| 38 | brw-r----- 1 0 0 3,15 makedevs.testdir/dev/hda15 |
| 39 | brw-r----- 1 0 0 3,2 makedevs.testdir/dev/hda2 |
| 40 | brw-r----- 1 0 0 3,3 makedevs.testdir/dev/hda3 |
| 41 | brw-r----- 1 0 0 3,4 makedevs.testdir/dev/hda4 |
| 42 | brw-r----- 1 0 0 3,5 makedevs.testdir/dev/hda5 |
| 43 | brw-r----- 1 0 0 3,6 makedevs.testdir/dev/hda6 |
| 44 | brw-r----- 1 0 0 3,7 makedevs.testdir/dev/hda7 |
| 45 | brw-r----- 1 0 0 3,8 makedevs.testdir/dev/hda8 |
| 46 | brw-r----- 1 0 0 3,9 makedevs.testdir/dev/hda9 |
| 47 | brw-r----- 1 0 0 3,64 makedevs.testdir/dev/hdb |
| 48 | brw-r----- 1 0 0 3,65 makedevs.testdir/dev/hdb1 |
| 49 | brw-r----- 1 0 0 3,74 makedevs.testdir/dev/hdb10 |
| 50 | brw-r----- 1 0 0 3,75 makedevs.testdir/dev/hdb11 |
| 51 | brw-r----- 1 0 0 3,76 makedevs.testdir/dev/hdb12 |
| 52 | brw-r----- 1 0 0 3,77 makedevs.testdir/dev/hdb13 |
| 53 | brw-r----- 1 0 0 3,78 makedevs.testdir/dev/hdb14 |
| 54 | brw-r----- 1 0 0 3,79 makedevs.testdir/dev/hdb15 |
| 55 | brw-r----- 1 0 0 3,66 makedevs.testdir/dev/hdb2 |
| 56 | brw-r----- 1 0 0 3,67 makedevs.testdir/dev/hdb3 |
| 57 | brw-r----- 1 0 0 3,68 makedevs.testdir/dev/hdb4 |
| 58 | brw-r----- 1 0 0 3,69 makedevs.testdir/dev/hdb5 |
| 59 | brw-r----- 1 0 0 3,70 makedevs.testdir/dev/hdb6 |
| 60 | brw-r----- 1 0 0 3,71 makedevs.testdir/dev/hdb7 |
| 61 | brw-r----- 1 0 0 3,72 makedevs.testdir/dev/hdb8 |
| 62 | brw-r----- 1 0 0 3,73 makedevs.testdir/dev/hdb9 |
| 63 | crw-rw---- 1 0 0 13,64 makedevs.testdir/dev/input/event0 |
| 64 | crw-rw---- 1 0 0 13,65 makedevs.testdir/dev/input/event1 |
| 65 | crw-rw---- 1 0 0 13,66 makedevs.testdir/dev/input/event2 |
| 66 | crw-rw---- 1 0 0 13,67 makedevs.testdir/dev/input/event3 |
| 67 | crw-r----- 1 0 0 13,63 makedevs.testdir/dev/input/mice |
| 68 | crw-rw---- 1 0 0 13,32 makedevs.testdir/dev/input/mouse0 |
| 69 | crw-rw---- 1 0 0 13,33 makedevs.testdir/dev/input/mouse1 |
| 70 | crw-rw---- 1 0 0 13,34 makedevs.testdir/dev/input/mouse2 |
| 71 | crw-rw---- 1 0 0 13,35 makedevs.testdir/dev/input/mouse3 |
| 72 | crw-r----- 1 0 0 1,2 makedevs.testdir/dev/kmem |
| 73 | brw-r----- 1 0 0 7,0 makedevs.testdir/dev/loop0 |
| 74 | brw-r----- 1 0 0 7,1 makedevs.testdir/dev/loop1 |
| 75 | crw-r----- 1 0 0 1,1 makedevs.testdir/dev/mem |
| 76 | crw-r----- 1 0 0 90,0 makedevs.testdir/dev/mtd0 |
| 77 | crw-r----- 1 0 0 90,2 makedevs.testdir/dev/mtd1 |
| 78 | crw-r----- 1 0 0 90,4 makedevs.testdir/dev/mtd2 |
| 79 | crw-r----- 1 0 0 90,6 makedevs.testdir/dev/mtd3 |
| 80 | brw-r----- 1 0 0 31,0 makedevs.testdir/dev/mtdblock0 |
| 81 | brw-r----- 1 0 0 31,1 makedevs.testdir/dev/mtdblock1 |
| 82 | brw-r----- 1 0 0 31,2 makedevs.testdir/dev/mtdblock2 |
| 83 | brw-r----- 1 0 0 31,3 makedevs.testdir/dev/mtdblock3 |
| 84 | crw-rw---- 1 0 0 10,200 makedevs.testdir/dev/net/tun |
| 85 | crw-rw-rw- 1 0 0 1,3 makedevs.testdir/dev/null |
| 86 | crw-rw-rw- 1 0 0 10,1 makedevs.testdir/dev/psaux |
| 87 | crw-rw-rw- 1 0 0 5,2 makedevs.testdir/dev/ptmx |
| 88 | crw-rw-rw- 1 0 0 2,0 makedevs.testdir/dev/ptyp0 |
| 89 | crw-rw-rw- 1 0 0 2,1 makedevs.testdir/dev/ptyp1 |
| 90 | crw-rw-rw- 1 0 0 2,2 makedevs.testdir/dev/ptyp2 |
| 91 | crw-rw-rw- 1 0 0 2,3 makedevs.testdir/dev/ptyp3 |
| 92 | crw-rw-rw- 1 0 0 2,4 makedevs.testdir/dev/ptyp4 |
| 93 | crw-rw-rw- 1 0 0 2,5 makedevs.testdir/dev/ptyp5 |
| 94 | crw-rw-rw- 1 0 0 2,6 makedevs.testdir/dev/ptyp6 |
| 95 | crw-rw-rw- 1 0 0 2,7 makedevs.testdir/dev/ptyp7 |
| 96 | crw-rw-rw- 1 0 0 2,8 makedevs.testdir/dev/ptyp8 |
| 97 | crw-rw-rw- 1 0 0 2,9 makedevs.testdir/dev/ptyp9 |
| 98 | brw-r----- 1 0 0 1,1 makedevs.testdir/dev/ram |
| 99 | brw-r----- 1 0 0 1,0 makedevs.testdir/dev/ram0 |
| 100 | brw-r----- 1 0 0 1,1 makedevs.testdir/dev/ram1 |
| 101 | brw-r----- 1 0 0 1,2 makedevs.testdir/dev/ram2 |
| 102 | brw-r----- 1 0 0 1,3 makedevs.testdir/dev/ram3 |
| 103 | crw-rw-rw- 1 0 0 1,8 makedevs.testdir/dev/random |
| 104 | crw-r----- 1 0 0 10,135 makedevs.testdir/dev/rtc |
| 105 | crw-rw-rw- 1 0 0 5,0 makedevs.testdir/dev/tty |
| 106 | crw-rw-rw- 1 0 0 4,0 makedevs.testdir/dev/tty0 |
| 107 | crw-rw-rw- 1 0 0 4,1 makedevs.testdir/dev/tty1 |
| 108 | crw-rw-rw- 1 0 0 4,2 makedevs.testdir/dev/tty2 |
| 109 | crw-rw-rw- 1 0 0 4,3 makedevs.testdir/dev/tty3 |
| 110 | crw-rw-rw- 1 0 0 4,4 makedevs.testdir/dev/tty4 |
| 111 | crw-rw-rw- 1 0 0 4,5 makedevs.testdir/dev/tty5 |
| 112 | crw-rw-rw- 1 0 0 4,6 makedevs.testdir/dev/tty6 |
| 113 | crw-rw-rw- 1 0 0 4,7 makedevs.testdir/dev/tty7 |
| 114 | crw-rw-rw- 1 0 0 57,0 makedevs.testdir/dev/ttyP0 |
| 115 | crw-rw-rw- 1 0 0 57,1 makedevs.testdir/dev/ttyP1 |
| 116 | crw-rw-rw- 1 0 0 57,2 makedevs.testdir/dev/ttyP2 |
| 117 | crw-rw-rw- 1 0 0 57,3 makedevs.testdir/dev/ttyP3 |
| 118 | crw-rw-rw- 1 0 0 4,64 makedevs.testdir/dev/ttyS0 |
| 119 | crw-rw-rw- 1 0 0 4,65 makedevs.testdir/dev/ttyS1 |
| 120 | crw-rw-rw- 1 0 0 4,66 makedevs.testdir/dev/ttyS2 |
| 121 | crw-rw-rw- 1 0 0 4,67 makedevs.testdir/dev/ttyS3 |
| 122 | crw-rw-rw- 1 0 0 3,0 makedevs.testdir/dev/ttyp0 |
| 123 | crw-rw-rw- 1 0 0 3,1 makedevs.testdir/dev/ttyp1 |
| 124 | crw-rw-rw- 1 0 0 3,2 makedevs.testdir/dev/ttyp2 |
| 125 | crw-rw-rw- 1 0 0 3,3 makedevs.testdir/dev/ttyp3 |
| 126 | crw-rw-rw- 1 0 0 3,4 makedevs.testdir/dev/ttyp4 |
| 127 | crw-rw-rw- 1 0 0 3,5 makedevs.testdir/dev/ttyp5 |
| 128 | crw-rw-rw- 1 0 0 3,6 makedevs.testdir/dev/ttyp6 |
| 129 | crw-rw-rw- 1 0 0 3,7 makedevs.testdir/dev/ttyp7 |
| 130 | crw-rw-rw- 1 0 0 3,8 makedevs.testdir/dev/ttyp8 |
| 131 | crw-rw-rw- 1 0 0 3,9 makedevs.testdir/dev/ttyp9 |
| 132 | crw-rw-rw- 1 0 0 1,9 makedevs.testdir/dev/urandom |
| 133 | crw-rw-rw- 1 0 0 1,5 makedevs.testdir/dev/zero |
| 134 | " \ |
| 135 | "" "" |
Denys Vlasenko | e3d90a9 | 2010-05-10 05:53:16 +0200 | [diff] [blame] | 136 | SKIP= |
Denis Vlasenko | e1fa817 | 2008-08-01 02:15:05 +0000 | [diff] [blame] | 137 | |
| 138 | # clean up |
| 139 | rm -rf makedevs.testdir |
| 140 | |
| 141 | exit $FAILCOUNT |