application-lifecycle: replace continue by return
[src/qa-testdefinitions.git] / common / scripts / lshw.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2010 - 2014, Linaro Limited.
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 lshw > lshw.txt
20
21 if grep -E 'core' lshw.txt
22 then
23     lava-test-case user-space-lshw-core-present --result pass
24 else
25     lava-test-case user-space-lshw-core-present --result fail
26 fi
27
28 if grep 'firmware' lshw.txt
29 then
30     lava-test-case user-space-lshw-firmware-has-info --result pass
31 else
32     lava-test-case user-space-lshw-firmware-has-info --result fail
33 fi
34
35 if grep 'cpu' lshw.txt
36 then
37     lava-test-case user-space-lshw-cpu-has-info --result pass
38 else
39     lava-test-case user-space-lshw-cpu-has-info --result fail
40 fi
41
42 if grep 'network' lshw.txt
43 then
44     lava-test-case user-space-lshw-network-has-info --result pass
45 else
46     lava-test-case user-space-lshw-network-has-info --result fail
47 fi
48
49 if grep 'storage' lshw.txt
50 then
51     lava-test-case user-space-lshw-storage-has-info --result pass
52 else
53     lava-test-case user-space-lshw-storage-has-info --result fail
54 fi
55
56 cat lshw.txt
57 rm lshw.txt