]> www.infradead.org Git - mtd-utils.git/commitdiff
stress-test.sh: remove a warning
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Aug 2012 14:25:40 +0000 (17:25 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Aug 2012 14:25:40 +0000 (17:25 +0300)
If /proc/mtd does not exist, we have this warning:
grep: /proc/mtd: No such file or directory

Get rid of this.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
tests/ubi-tests/stress-test.sh

index aec5c1c8198aa906789951f592bfbc28e144c4b4..50c563ab2d773d50a20b2cf3632c22dfa7fa6b8b 100755 (executable)
@@ -153,10 +153,12 @@ fi
 # Make sure neither mtdram nor nandsim are used
 nandsim_patt="NAND simulator"
 mtdram_patt="mtdram test device"
-! grep -q "$nandsim_patt" /proc/mtd ||
-       fatal "the nandsim driver is already used"
-! grep -q "$mtdram_patt" /proc/mtd ||
-       fatal "the mtdram driver is already used"
+if [ -e /proc/mtd ]; then
+       ! grep -q "$nandsim_patt" /proc/mtd ||
+               fatal "the nandsim driver is already used"
+       ! grep -q "$mtdram_patt" /proc/mtd ||
+               fatal "the mtdram driver is already used"
+fi
 
 rmmod ubi >/dev/null 2>&1 ||: