makedevs.tests 6.1 KB

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