diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-09-19 13:18:06 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-22 12:19:41 +0100 |
commit | d6529876129a6932b6d2e369b3fd6ca40d342add (patch) | |
tree | 82b62115b0f4ba9701c823988472884c735872b7 /scripts/qemuimage-tests/tools | |
parent | 595321a62669e90bed5f459a9d926a68988086a9 (diff) | |
download | poky-d6529876129a6932b6d2e369b3fd6ca40d342add.tar.gz |
classes/imagetest-qemu: remove old image testing class
This has now been superseded by testimage.
(From OE-Core rev: d469c92394a1a95ae7a45b8b80dc4c2918e0e9a6)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/qemuimage-tests/tools')
-rw-r--r-- | scripts/qemuimage-tests/tools/bash.sh | 17 | ||||
-rw-r--r-- | scripts/qemuimage-tests/tools/compiler_test.sh | 137 | ||||
-rw-r--r-- | scripts/qemuimage-tests/tools/connman_test.sh | 75 | ||||
-rw-r--r-- | scripts/qemuimage-tests/tools/df.sh | 25 | ||||
-rw-r--r-- | scripts/qemuimage-tests/tools/dmesg.sh | 28 | ||||
-rw-r--r-- | scripts/qemuimage-tests/tools/rpm_test.sh | 45 | ||||
-rw-r--r-- | scripts/qemuimage-tests/tools/smart_test.sh | 45 | ||||
-rw-r--r-- | scripts/qemuimage-tests/tools/syslog.sh | 17 |
8 files changed, 0 insertions, 389 deletions
diff --git a/scripts/qemuimage-tests/tools/bash.sh b/scripts/qemuimage-tests/tools/bash.sh deleted file mode 100644 index f6958f0e7e..0000000000 --- a/scripts/qemuimage-tests/tools/bash.sh +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # bash test script running in qemu | ||
3 | # | ||
4 | # Author: veera <veerabrahmamvr@huawei.com> | ||
5 | # | ||
6 | # This file is licensed under the GNU General Public License, | ||
7 | # Version 2. | ||
8 | # | ||
9 | |||
10 | which bash | ||
11 | if [ $? -eq 0 ]; then | ||
12 | echo "QEMU: bash is exist in the target by default" | ||
13 | exit 0 | ||
14 | else | ||
15 | echo "QEMU: No bash command in the qemu target" | ||
16 | exit 1 | ||
17 | fi | ||
diff --git a/scripts/qemuimage-tests/tools/compiler_test.sh b/scripts/qemuimage-tests/tools/compiler_test.sh deleted file mode 100644 index 9c30d6d78b..0000000000 --- a/scripts/qemuimage-tests/tools/compiler_test.sh +++ /dev/null | |||
@@ -1,137 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # compiler test script running in target | ||
3 | # | ||
4 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
5 | # | ||
6 | # This file is licensed under the GNU General Public License, | ||
7 | # Version 2. | ||
8 | # | ||
9 | |||
10 | # Prepare test folder for compiler test | ||
11 | COMPILE_FOLDER="/opt/test/compile_test" | ||
12 | TEST_FILE="$COMPILE_FOLDER/compile_test.c" | ||
13 | EXECUTE_FILE="$COMPILE_FOLDER/compile_test" | ||
14 | TEST_MAKEFILE="$COMPILE_FOLDER/makefile" | ||
15 | TEST_LIST="gcc g++ make" | ||
16 | |||
17 | if [ ! -d $COMPILE_FOLDER ]; then | ||
18 | mkdir -p $COMPILE_FOLDER | ||
19 | fi | ||
20 | |||
21 | Target_Info() | ||
22 | { | ||
23 | echo -e "\tTARGET: $*" | ||
24 | } | ||
25 | |||
26 | Target_Err() | ||
27 | { | ||
28 | echo -e "\tTARGET: ##### Error Log #####" | ||
29 | $@ | ||
30 | echo -e "\tTARGET: ##### End #####" | ||
31 | } | ||
32 | |||
33 | # Function to generate a c test file for compiler testing | ||
34 | Gen_File() | ||
35 | { | ||
36 | temp=`mktemp` | ||
37 | |||
38 | # Generate c/c++ test file for compiler testing | ||
39 | echo "#include <stdio.h>" >> $temp | ||
40 | echo "#include <math.h>" >> $temp | ||
41 | echo "" >> $temp | ||
42 | echo "double" >> $temp | ||
43 | echo "convert(long long l)" >> $temp | ||
44 | echo "{" >> $temp | ||
45 | echo " return (double)l; // or double(l)" >> $temp | ||
46 | echo "}" >> $temp | ||
47 | echo "" >> $temp | ||
48 | echo "int" >> $temp | ||
49 | echo "main(int argc, char * argv[])" >> $temp | ||
50 | echo "{" >> $temp | ||
51 | echo " long long l = 10;" >> $temp | ||
52 | echo " double f;" >> $temp | ||
53 | echo "" >> $temp | ||
54 | echo " f = convert(l);" >> $temp | ||
55 | echo " printf(\"convert: %lld => %f\n\", l, f);" >> $temp | ||
56 | echo "" >> $temp | ||
57 | echo " f = 1234.67;" >> $temp | ||
58 | echo " printf(\"floorf(%f) = %f\n\", f, floorf(f));" >> $temp | ||
59 | echo " return 0;" >> $temp | ||
60 | echo "}" >> $temp | ||
61 | echo $temp | ||
62 | } | ||
63 | |||
64 | # Function to generate a makefile for compiler testing | ||
65 | Gen_Makefile() | ||
66 | { | ||
67 | temp=`mktemp` | ||
68 | basename=`basename $EXECUTE_FILE` | ||
69 | |||
70 | echo -e "$basename: $basename.o" >> $temp | ||
71 | echo -e "\tgcc -o $basename $basename.o -lm" >> $temp | ||
72 | echo -e "$basename.o: $basename.c" >> $temp | ||
73 | echo -e "\tgcc -c $basename.c" >> $temp | ||
74 | |||
75 | echo $temp | ||
76 | } | ||
77 | |||
78 | # Generate a c test file for compiler testing | ||
79 | test_file=`Gen_File` | ||
80 | |||
81 | MOVE=`which mv` | ||
82 | $MOVE $test_file $TEST_FILE | ||
83 | |||
84 | # Begin compiler test in target | ||
85 | for cmd in $TEST_LIST | ||
86 | do | ||
87 | which $cmd | ||
88 | if [ $? -ne 0 ]; then | ||
89 | Target_Info "No $cmd command found" | ||
90 | exit 1 | ||
91 | fi | ||
92 | |||
93 | if [ "$cmd" == "make" ]; then | ||
94 | rm -rf $EXECUTE_FILE | ||
95 | |||
96 | # For makefile test, we need to generate a makefile and run with a c file | ||
97 | makefile=`Gen_Makefile` | ||
98 | $MOVE $makefile $TEST_MAKEFILE | ||
99 | |||
100 | cd `dirname $TEST_MAKEFILE` | ||
101 | make | ||
102 | |||
103 | if [ $? -ne 0 ]; then | ||
104 | Target_Info "$cmd running with error, Pls. check error in following" | ||
105 | Target_Err make | ||
106 | exit 1 | ||
107 | fi | ||
108 | else | ||
109 | rm -rf $EXECUTE_FILE | ||
110 | |||
111 | # For gcc/g++, we compile a c test file and check the output | ||
112 | $cmd $TEST_FILE -o $EXECUTE_FILE -lm | ||
113 | |||
114 | if [ $? -ne 0 ]; then | ||
115 | Target_Info "$cmd running with error, Pls. check error in following" | ||
116 | Target_Err $cmd $TEST_FILE -o $EXECUTE_FILE -lm | ||
117 | exit 1 | ||
118 | fi | ||
119 | fi | ||
120 | |||
121 | # Check if the binary file generated by $cmd can work without error | ||
122 | if [ -f $EXECUTE_FILE ]; then | ||
123 | $EXECUTE_FILE | ||
124 | if [ $? -ne 0 ]; then | ||
125 | Target_Info "$EXECUTE_FILE running with error, Pls. check error in following" | ||
126 | Target_Err $EXECUTE_FILE | ||
127 | exit 1 | ||
128 | else | ||
129 | Target_Info "$cmd can work without problem in target" | ||
130 | fi | ||
131 | else | ||
132 | Target_Info "No executalbe file $EXECUTE_FILE found, Pls. check the error log" | ||
133 | exit 1 | ||
134 | fi | ||
135 | done | ||
136 | |||
137 | exit 0 | ||
diff --git a/scripts/qemuimage-tests/tools/connman_test.sh b/scripts/qemuimage-tests/tools/connman_test.sh deleted file mode 100644 index 4c1e2f558e..0000000000 --- a/scripts/qemuimage-tests/tools/connman_test.sh +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # connman test script running in target | ||
3 | # | ||
4 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
5 | # | ||
6 | # This file is licensed under the GNU General Public License, | ||
7 | # Version 2. | ||
8 | # | ||
9 | |||
10 | Target_Info() | ||
11 | { | ||
12 | echo -e "\tTARGET: $*" | ||
13 | } | ||
14 | |||
15 | Target_Err() | ||
16 | { | ||
17 | echo -e "\tTARGET: connman has issue when running, Pls. check the error log" | ||
18 | echo -e "\tTARGET: ##### Error Log #####" | ||
19 | $1 | ||
20 | echo -e "\tTARGET: ##### End #####" | ||
21 | } | ||
22 | |||
23 | # Check if ps comes from Procps or busybox first | ||
24 | ls -l `which ps` | grep -q "busybox" | ||
25 | RET=$? | ||
26 | |||
27 | if [ $RET -eq 0 ]; then | ||
28 | PS="ps" | ||
29 | else | ||
30 | PS="ps -ef" | ||
31 | fi | ||
32 | |||
33 | # Check if connmand is in target | ||
34 | if [ ! -f /usr/sbin/connmand ]; then | ||
35 | Target_Info "No connmand command found" | ||
36 | exit 1 | ||
37 | fi | ||
38 | |||
39 | # Check if connmand is running in background | ||
40 | if [ $RET -eq 0 ]; then | ||
41 | count=`ps | awk '{print $5}' | grep -c connmand` | ||
42 | else | ||
43 | count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand` | ||
44 | fi | ||
45 | |||
46 | if [ $count -ne 1 ]; then | ||
47 | Target_Info "connmand has issue when running in background, Pls, check the output of ps" | ||
48 | ${PS} | ||
49 | exit 1 | ||
50 | fi | ||
51 | |||
52 | # Check if there is always only one connmand running in background | ||
53 | if [ connmand > /dev/null 2>&1 ]; then | ||
54 | Target_Info "connmand command run without problem" | ||
55 | |||
56 | if [ $RET -eq 0 ]; then | ||
57 | count=`ps | awk '{print $5}' | grep -c connmand` | ||
58 | else | ||
59 | count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand` | ||
60 | fi | ||
61 | |||
62 | if [ $count -ne 1 ]; then | ||
63 | Target_Info "There are more than one connmand running in background, Pls, check the output of ps" | ||
64 | ${PS} | grep connmand | ||
65 | exit 1 | ||
66 | else | ||
67 | Target_Info "There is always one connmand running in background, test pass" | ||
68 | exit 0 | ||
69 | fi | ||
70 | else | ||
71 | Target_Err connmand | ||
72 | exit 1 | ||
73 | fi | ||
74 | |||
75 | exit 0 | ||
diff --git a/scripts/qemuimage-tests/tools/df.sh b/scripts/qemuimage-tests/tools/df.sh deleted file mode 100644 index 280c08e031..0000000000 --- a/scripts/qemuimage-tests/tools/df.sh +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # df test script to check enough disk space for qemu target | ||
3 | # | ||
4 | # Author: veera <veerabrahmamvr@huawei.com> | ||
5 | # | ||
6 | # This file is licensed under the GNU General Public License, | ||
7 | # Version 2. | ||
8 | #taking the size of the each partition | ||
9 | array_list=(`df -P | tr -s " " | cut -d " " -f4`) | ||
10 | #Total size of the array | ||
11 | array_size=`echo ${#array_list[@]}` | ||
12 | loop_val=1 | ||
13 | #while loop to check the size of partitions are less than 5MB | ||
14 | while [ $loop_val -lt $array_size ] | ||
15 | do | ||
16 | #taking each value from the array to check the size | ||
17 | value=`echo ${array_list[$loop_val]}` | ||
18 | if [[ $value -gt 5120 ]];then | ||
19 | loop_val=`expr $loop_val + 1` | ||
20 | else | ||
21 | echo "QEMU: df : disk space is not enough" | ||
22 | exit 1 | ||
23 | fi | ||
24 | done | ||
25 | exit 0 | ||
diff --git a/scripts/qemuimage-tests/tools/dmesg.sh b/scripts/qemuimage-tests/tools/dmesg.sh deleted file mode 100644 index f0c93181bd..0000000000 --- a/scripts/qemuimage-tests/tools/dmesg.sh +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # Dmesg test script running in QEMU | ||
3 | # | ||
4 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
5 | # | ||
6 | # This file is licensed under the GNU General Public License, | ||
7 | # Version 2. | ||
8 | # | ||
9 | |||
10 | which dmesg | ||
11 | if [ $? -ne 0 ]; then | ||
12 | echo "QEMU: No dmesg command found" | ||
13 | exit 1 | ||
14 | fi | ||
15 | |||
16 | # For now, ignore mmci-pl18x errors on qemuarm which appeared | ||
17 | # from the 3.8 kernel and are harmless | ||
18 | dmesg | grep -v mmci-pl18x | grep -iq "error" | ||
19 | if [ $? -eq 0 ]; then | ||
20 | echo "QEMU: There is some error log in dmesg:" | ||
21 | echo "QEMU: ##### Error Log ######" | ||
22 | dmesg | grep -i "error" | ||
23 | echo "QEMU: ##### End ######" | ||
24 | exit 1 | ||
25 | else | ||
26 | echo "QEMU: No error log in dmesg" | ||
27 | exit 0 | ||
28 | fi | ||
diff --git a/scripts/qemuimage-tests/tools/rpm_test.sh b/scripts/qemuimage-tests/tools/rpm_test.sh deleted file mode 100644 index 6e6f9112ca..0000000000 --- a/scripts/qemuimage-tests/tools/rpm_test.sh +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # rpm test script running in target | ||
3 | # | ||
4 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
5 | # | ||
6 | # This file is licensed under the GNU General Public License, | ||
7 | # Version 2. | ||
8 | # | ||
9 | |||
10 | Target_Info() | ||
11 | { | ||
12 | echo -e "\tTARGET: $*" | ||
13 | } | ||
14 | |||
15 | Target_Err() | ||
16 | { | ||
17 | echo -e "\tTARGET: rpm command has issue when running, Pls. check the error log" | ||
18 | echo -e "\tTARGET: ##### Error Log #####" | ||
19 | $1 | ||
20 | echo -e "\tTARGET: ##### End #####" | ||
21 | } | ||
22 | |||
23 | which rpm | ||
24 | if [ $? -ne 0 ]; then | ||
25 | Target_Info "No rpm command found" | ||
26 | exit 1 | ||
27 | fi | ||
28 | |||
29 | if [ rpm > /dev/null 2>&1 ]; then | ||
30 | Target_Info "rpm command run without problem" | ||
31 | else | ||
32 | Target_Err rpm | ||
33 | exit 1 | ||
34 | fi | ||
35 | |||
36 | # run rpm with specific command parsed to rpm_test.sh | ||
37 | rpm $* > /dev/null 2>&1 | ||
38 | |||
39 | if [ $? -eq 0 ]; then | ||
40 | Target_Info "rpm $* work without problem" | ||
41 | exit 0 | ||
42 | else | ||
43 | Target_Err rpm $* | ||
44 | exit 1 | ||
45 | fi | ||
diff --git a/scripts/qemuimage-tests/tools/smart_test.sh b/scripts/qemuimage-tests/tools/smart_test.sh deleted file mode 100644 index f278a25e2b..0000000000 --- a/scripts/qemuimage-tests/tools/smart_test.sh +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # smart test script running in target | ||
3 | # | ||
4 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
5 | # | ||
6 | # This file is licensed under the GNU General Public License, | ||
7 | # Version 2. | ||
8 | # | ||
9 | |||
10 | Target_Info() | ||
11 | { | ||
12 | echo -e "\tTARGET: $*" | ||
13 | } | ||
14 | |||
15 | Target_Err() | ||
16 | { | ||
17 | echo -e "\tTARGET: smart command has issue when running, Pls. check the error log" | ||
18 | echo -e "\tTARGET: ##### Error Log #####" | ||
19 | $1 | ||
20 | echo -e "\tTARGET: ##### End #####" | ||
21 | } | ||
22 | |||
23 | which smart | ||
24 | if [ $? -ne 0 ]; then | ||
25 | Target_Info "No smart command found" | ||
26 | exit 1 | ||
27 | fi | ||
28 | |||
29 | if [ smart > /dev/null 2>&1 ]; then | ||
30 | Target_Info "smart command run without problem" | ||
31 | else | ||
32 | Target_Err smart | ||
33 | exit 1 | ||
34 | fi | ||
35 | |||
36 | # run smart with specific command parsed to smart_test.sh | ||
37 | smart $* > /dev/null 2>&1 | ||
38 | |||
39 | if [ $? -eq 0 ]; then | ||
40 | Target_Info "smart $* work without problem" | ||
41 | exit 0 | ||
42 | else | ||
43 | Target_Err "smart $*" | ||
44 | exit 1 | ||
45 | fi | ||
diff --git a/scripts/qemuimage-tests/tools/syslog.sh b/scripts/qemuimage-tests/tools/syslog.sh deleted file mode 100644 index 9154da3b85..0000000000 --- a/scripts/qemuimage-tests/tools/syslog.sh +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # syslog test script running in qemu | ||
3 | # | ||
4 | # Author: veera <veerabrahmamvr@huawei.com> | ||
5 | # | ||
6 | # This file is licensed under the GNU General Public License, | ||
7 | # Version 2. | ||
8 | # | ||
9 | |||
10 | ps aux | grep -w syslogd | grep -v grep | ||
11 | if [ $? -eq 0 ]; then | ||
12 | echo "QEMU: syslogd is running by default" | ||
13 | exit 0 | ||
14 | else | ||
15 | echo "QEMU: syslogd is not running" | ||
16 | exit 1 | ||
17 | fi | ||