From: Artem Bityutskiy Date: Fri, 3 Aug 2012 14:25:40 +0000 (+0300) Subject: stress-test.sh: remove a warning X-Git-Tag: v1.5.1~53 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3a814dbfbfb44e8f1805592921b4f39fe0391723;p=mtd-utils.git stress-test.sh: remove a warning 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 --- diff --git a/tests/ubi-tests/stress-test.sh b/tests/ubi-tests/stress-test.sh index aec5c1c..50c563a 100755 --- a/tests/ubi-tests/stress-test.sh +++ b/tests/ubi-tests/stress-test.sh @@ -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 ||: