diff options
Diffstat (limited to 'scripts/qemuimage-tests')
28 files changed, 612 insertions, 19 deletions
diff --git a/scripts/qemuimage-tests/sanity/compiler b/scripts/qemuimage-tests/sanity/compiler new file mode 100755 index 0000000000..29dbfd9bb9 --- /dev/null +++ b/scripts/qemuimage-tests/sanity/compiler | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Compiler Test Case for Sanity Test | ||
| 3 | # The case boot up the Qemu target with `poky-qemu qemuxxx`. | ||
| 4 | # Then check if gcc/g++/make command can work in target. | ||
| 5 | # | ||
| 6 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
| 7 | # | ||
| 8 | # This file is licensed under the GNU General Public License, | ||
| 9 | # Version 2. | ||
| 10 | # | ||
| 11 | |||
| 12 | . $POKYBASE/scripts/qemuimage-testlib | ||
| 13 | |||
| 14 | TIMEOUT=400 | ||
| 15 | RET=1 | ||
| 16 | |||
| 17 | # Start qemu and check its network | ||
| 18 | Test_Create_Qemu ${TIMEOUT} | ||
| 19 | |||
| 20 | # If qemu network is up, check ssh service in qemu | ||
| 21 | if [ $? -eq 0 ]; then | ||
| 22 | Test_Info "Begin to Test SSH Service in Qemu" | ||
| 23 | Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT} | ||
| 24 | RET=$? | ||
| 25 | else | ||
| 26 | RET=1 | ||
| 27 | fi | ||
| 28 | |||
| 29 | # Check if gcc/g++/make can work in target | ||
| 30 | if [ $RET -eq 0 -a -f $TOOLS/compiler_test.sh ]; then | ||
| 31 | # Copy compiler_test.sh into target | ||
| 32 | Test_Target_Pre ${TARGET_IPADDR} $TOOLS/compiler_test.sh | ||
| 33 | if [ $? -eq 0 ]; then | ||
| 34 | # Run compiler_test.sh to check if gcc/g++/make can work in target | ||
| 35 | Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/compiler_test.sh" | ||
| 36 | RET=$? | ||
| 37 | else | ||
| 38 | RET=1 | ||
| 39 | fi | ||
| 40 | fi | ||
| 41 | |||
| 42 | if [ ${RET} -eq 0 ]; then | ||
| 43 | Test_Info "Compiler Test PASS" | ||
| 44 | Test_Kill_Qemu | ||
| 45 | Test_Print_Result "compiler" 0 | ||
| 46 | exit 0 | ||
| 47 | else | ||
| 48 | Test_Info "Compiler FAIL, Pls. check above error log" | ||
| 49 | Test_Kill_Qemu | ||
| 50 | Test_Print_Result "compiler" 1 | ||
| 51 | exit 1 | ||
| 52 | fi | ||
diff --git a/scripts/qemuimage-tests/sanity/connman b/scripts/qemuimage-tests/sanity/connman new file mode 100755 index 0000000000..fca6a27845 --- /dev/null +++ b/scripts/qemuimage-tests/sanity/connman | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Conmman Check Test Case for Sanity Test | ||
| 3 | # The case boot up the Qemu target with `poky-qemu qemuxxx`. | ||
| 4 | # Then check if connman can work in target. | ||
| 5 | # | ||
| 6 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
| 7 | # | ||
| 8 | # This file is licensed under the GNU General Public License, | ||
| 9 | # Version 2. | ||
| 10 | # | ||
| 11 | |||
| 12 | . $POKYBASE/scripts/qemuimage-testlib | ||
| 13 | |||
| 14 | TIMEOUT=400 | ||
| 15 | RET=1 | ||
| 16 | |||
| 17 | # Start qemu and check its network | ||
| 18 | Test_Create_Qemu ${TIMEOUT} | ||
| 19 | |||
| 20 | # If qemu network is up, check ssh service in qemu | ||
| 21 | if [ $? -eq 0 ]; then | ||
| 22 | Test_Info "Begin to Test SSH Service in Qemu" | ||
| 23 | Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT} | ||
| 24 | RET=$? | ||
| 25 | else | ||
| 26 | RET=1 | ||
| 27 | fi | ||
| 28 | |||
| 29 | # Check if connman can work in target | ||
| 30 | if [ $RET -eq 0 -a -f $TOOLS/connman_test.sh ]; then | ||
| 31 | # Copy connman_test.sh into target | ||
| 32 | Test_Target_Pre ${TARGET_IPADDR} $TOOLS/connman_test.sh | ||
| 33 | if [ $? -eq 0 ]; then | ||
| 34 | # Run connman_test.sh to check if connman can work in target | ||
| 35 | Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/connman_test.sh" | ||
| 36 | RET=$? | ||
| 37 | else | ||
| 38 | RET=1 | ||
| 39 | fi | ||
| 40 | fi | ||
| 41 | |||
| 42 | if [ ${RET} -eq 0 ]; then | ||
| 43 | Test_Info "Connman Test PASS" | ||
| 44 | Test_Kill_Qemu | ||
| 45 | Test_Print_Result "connman" 0 | ||
| 46 | exit 0 | ||
| 47 | else | ||
| 48 | Test_Info "Connman Test FAIL, Pls. check above error log" | ||
| 49 | Test_Kill_Qemu | ||
| 50 | Test_Print_Result "connman" 1 | ||
| 51 | exit 1 | ||
| 52 | fi | ||
diff --git a/scripts/qemuimage-tests/sanity/dmesg b/scripts/qemuimage-tests/sanity/dmesg index 36813dcd43..5ed31b735f 100755 --- a/scripts/qemuimage-tests/sanity/dmesg +++ b/scripts/qemuimage-tests/sanity/dmesg | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | . $POKYBASE/scripts/qemuimage-testlib | 12 | . $POKYBASE/scripts/qemuimage-testlib |
| 13 | 13 | ||
| 14 | TIMEOUT=360 | 14 | TIMEOUT=400 |
| 15 | RET=1 | 15 | RET=1 |
| 16 | 16 | ||
| 17 | # Start qemu and check its network | 17 | # Start qemu and check its network |
diff --git a/scripts/qemuimage-tests/sanity/rpm_query b/scripts/qemuimage-tests/sanity/rpm_query new file mode 100755 index 0000000000..08017ffbe6 --- /dev/null +++ b/scripts/qemuimage-tests/sanity/rpm_query | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # RPM Check Test Case for Sanity Test | ||
| 3 | # The case boot up the Qemu target with `poky-qemu qemuxxx`. | ||
| 4 | # Then check if rpm command can work in target. | ||
| 5 | # | ||
| 6 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
| 7 | # | ||
| 8 | # This file is licensed under the GNU General Public License, | ||
| 9 | # Version 2. | ||
| 10 | # | ||
| 11 | |||
| 12 | . $POKYBASE/scripts/qemuimage-testlib | ||
| 13 | |||
| 14 | TIMEOUT=400 | ||
| 15 | RET=1 | ||
| 16 | |||
| 17 | # Start qemu and check its network | ||
| 18 | Test_Create_Qemu ${TIMEOUT} | ||
| 19 | |||
| 20 | # If qemu network is up, check ssh service in qemu | ||
| 21 | if [ $? -eq 0 ]; then | ||
| 22 | Test_Info "Begin to Test SSH Service in Qemu" | ||
| 23 | Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT} | ||
| 24 | RET=$? | ||
| 25 | else | ||
| 26 | RET=1 | ||
| 27 | fi | ||
| 28 | |||
| 29 | # Check if rpm query can work in target | ||
| 30 | if [ $RET -eq 0 -a -f $TOOLS/rpm_test.sh ]; then | ||
| 31 | # Copy rpm_test.sh into target | ||
| 32 | Test_Target_Pre ${TARGET_IPADDR} $TOOLS/rpm_test.sh | ||
| 33 | if [ $? -eq 0 ]; then | ||
| 34 | # Run rpm_test.sh to check if rpm query can work in target | ||
| 35 | Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/rpm_test.sh -qa" | ||
| 36 | RET=$? | ||
| 37 | else | ||
| 38 | RET=1 | ||
| 39 | fi | ||
| 40 | fi | ||
| 41 | |||
| 42 | if [ ${RET} -eq 0 ]; then | ||
| 43 | Test_Info "rpm query Test PASS" | ||
| 44 | Test_Kill_Qemu | ||
| 45 | Test_Print_Result "rpm_query" 0 | ||
| 46 | exit 0 | ||
| 47 | else | ||
| 48 | Test_Info "rpm query FAIL, Pls. check above error log" | ||
| 49 | Test_Kill_Qemu | ||
| 50 | Test_Print_Result "rpm_query" 1 | ||
| 51 | exit 1 | ||
| 52 | fi | ||
diff --git a/scripts/qemuimage-tests/sanity/scp b/scripts/qemuimage-tests/sanity/scp index ce3489d664..c72cdc9d65 100755 --- a/scripts/qemuimage-tests/sanity/scp +++ b/scripts/qemuimage-tests/sanity/scp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | . $POKYBASE/scripts/qemuimage-testlib | 12 | . $POKYBASE/scripts/qemuimage-testlib |
| 13 | 13 | ||
| 14 | TIMEOUT=360 | 14 | TIMEOUT=400 |
| 15 | RET=1 | 15 | RET=1 |
| 16 | SPID=0 | 16 | SPID=0 |
| 17 | i=0 | 17 | i=0 |
diff --git a/scripts/qemuimage-tests/sanity/shutdown b/scripts/qemuimage-tests/sanity/shutdown index e36b4a983d..bc08cf0fdc 100755 --- a/scripts/qemuimage-tests/sanity/shutdown +++ b/scripts/qemuimage-tests/sanity/shutdown | |||
| @@ -13,7 +13,8 @@ | |||
| 13 | 13 | ||
| 14 | . $POKYBASE/scripts/qemuimage-testlib | 14 | . $POKYBASE/scripts/qemuimage-testlib |
| 15 | 15 | ||
| 16 | TIMEOUT=360 | 16 | TIMEOUT=400 |
| 17 | |||
| 17 | RET=1 | 18 | RET=1 |
| 18 | i=0 | 19 | i=0 |
| 19 | 20 | ||
| @@ -61,6 +62,11 @@ fi | |||
| 61 | if [ ${RET} -eq 0 ]; then | 62 | if [ ${RET} -eq 0 ]; then |
| 62 | Test_Info "Shutdown Test PASS" | 63 | Test_Info "Shutdown Test PASS" |
| 63 | Test_Print_Result "shutdown" 0 | 64 | Test_Print_Result "shutdown" 0 |
| 65 | |||
| 66 | # Remove TARGET_IPSAVE since no existing qemu running now | ||
| 67 | if [ -e ${TARGET_IPSAVE} ]; then | ||
| 68 | rm -rf ${TARGET_IPSAVE} | ||
| 69 | fi | ||
| 64 | exit 0 | 70 | exit 0 |
| 65 | else | 71 | else |
| 66 | Test_Info "Shutdown Test FAIL" | 72 | Test_Info "Shutdown Test FAIL" |
diff --git a/scripts/qemuimage-tests/sanity/ssh b/scripts/qemuimage-tests/sanity/ssh index 084530adfb..2a0e934392 100755 --- a/scripts/qemuimage-tests/sanity/ssh +++ b/scripts/qemuimage-tests/sanity/ssh | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | . $POKYBASE/scripts/qemuimage-testlib | 12 | . $POKYBASE/scripts/qemuimage-testlib |
| 13 | 13 | ||
| 14 | TIMEOUT=360 | 14 | TIMEOUT=400 |
| 15 | RET=1 | 15 | RET=1 |
| 16 | 16 | ||
| 17 | # Start qemu and check its network | 17 | # Start qemu and check its network |
diff --git a/scripts/qemuimage-tests/sanity/zypper_help b/scripts/qemuimage-tests/sanity/zypper_help new file mode 100755 index 0000000000..1ab6d2407f --- /dev/null +++ b/scripts/qemuimage-tests/sanity/zypper_help | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Zypper Check Test Case for Sanity Test | ||
| 3 | # The case boot up the Qemu target with `poky-qemu qemuxxx`. | ||
| 4 | # Then check if zypper command can work in target. | ||
| 5 | # | ||
| 6 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
| 7 | # | ||
| 8 | # This file is licensed under the GNU General Public License, | ||
| 9 | # Version 2. | ||
| 10 | # | ||
| 11 | |||
| 12 | . $POKYBASE/scripts/qemuimage-testlib | ||
| 13 | |||
| 14 | TIMEOUT=400 | ||
| 15 | RET=1 | ||
| 16 | |||
| 17 | # Start qemu and check its network | ||
| 18 | Test_Create_Qemu ${TIMEOUT} | ||
| 19 | |||
| 20 | # If qemu network is up, check ssh service in qemu | ||
| 21 | if [ $? -eq 0 ]; then | ||
| 22 | Test_Info "Begin to Test SSH Service in Qemu" | ||
| 23 | Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT} | ||
| 24 | RET=$? | ||
| 25 | else | ||
| 26 | RET=1 | ||
| 27 | fi | ||
| 28 | |||
| 29 | # Check if zypper help can work in target | ||
| 30 | if [ $RET -eq 0 -a -f $TOOLS/zypper_test.sh ]; then | ||
| 31 | # Copy zypper_test.sh into target | ||
| 32 | Test_Target_Pre ${TARGET_IPADDR} $TOOLS/zypper_test.sh | ||
| 33 | if [ $? -eq 0 ]; then | ||
| 34 | # Run zypper_test.sh to check if zypper help can work in target | ||
| 35 | Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/zypper_test.sh help" | ||
| 36 | RET=$? | ||
| 37 | else | ||
| 38 | RET=1 | ||
| 39 | fi | ||
| 40 | fi | ||
| 41 | |||
| 42 | if [ ${RET} -eq 0 ]; then | ||
| 43 | Test_Info "zypper help Test PASS" | ||
| 44 | Test_Kill_Qemu | ||
| 45 | Test_Print_Result "zypper_help" 0 | ||
| 46 | exit 0 | ||
| 47 | else | ||
| 48 | Test_Info "zypper help FAIL, Pls. check above error log" | ||
| 49 | Test_Kill_Qemu | ||
| 50 | Test_Print_Result "zypper_help" 1 | ||
| 51 | exit 1 | ||
| 52 | fi | ||
diff --git a/scripts/qemuimage-tests/sanity/zypper_search b/scripts/qemuimage-tests/sanity/zypper_search new file mode 100755 index 0000000000..d6bcd27a34 --- /dev/null +++ b/scripts/qemuimage-tests/sanity/zypper_search | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Zypper Check Test Case for Sanity Test | ||
| 3 | # The case boot up the Qemu target with `poky-qemu qemuxxx`. | ||
| 4 | # Then check if zypper command can work in target. | ||
| 5 | # | ||
| 6 | # Author: Jiajun Xu <jiajun.xu@intel.com> | ||
| 7 | # | ||
| 8 | # This file is licensed under the GNU General Public License, | ||
| 9 | # Version 2. | ||
| 10 | # | ||
| 11 | |||
| 12 | . $POKYBASE/scripts/qemuimage-testlib | ||
| 13 | |||
| 14 | TIMEOUT=400 | ||
| 15 | RET=1 | ||
| 16 | |||
| 17 | # Start qemu and check its network | ||
| 18 | Test_Create_Qemu ${TIMEOUT} | ||
| 19 | |||
| 20 | # If qemu network is up, check ssh service in qemu | ||
| 21 | if [ $? -eq 0 ]; then | ||
| 22 | Test_Info "Begin to Test SSH Service in Qemu" | ||
| 23 | Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT} | ||
| 24 | RET=$? | ||
| 25 | else | ||
| 26 | RET=1 | ||
| 27 | fi | ||
| 28 | |||
| 29 | # Check if zypper search can work in target | ||
| 30 | if [ $RET -eq 0 -a -f $TOOLS/zypper_test.sh ]; then | ||
| 31 | # Copy zypper_test.sh into target | ||
| 32 | Test_Target_Pre ${TARGET_IPADDR} $TOOLS/zypper_test.sh | ||
| 33 | if [ $? -eq 0 ]; then | ||
| 34 | # Run zypper_test.sh to check if zypper search can work in target | ||
| 35 | Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/zypper_test.sh search avahi" | ||
| 36 | RET=$? | ||
| 37 | else | ||
| 38 | RET=1 | ||
| 39 | fi | ||
| 40 | fi | ||
| 41 | |||
| 42 | if [ ${RET} -eq 0 ]; then | ||
| 43 | Test_Info "zypper search package avahi Test PASS" | ||
| 44 | Test_Kill_Qemu | ||
| 45 | Test_Print_Result "zypper_search" 0 | ||
| 46 | exit 0 | ||
| 47 | else | ||
| 48 | Test_Info "zypper search package avahi FAIL, Pls. check above error log" | ||
| 49 | Test_Kill_Qemu | ||
| 50 | Test_Print_Result "zypper_search" 1 | ||
| 51 | exit 1 | ||
| 52 | fi | ||
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb index b8e9847b48..4fa6068768 100644 --- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb +++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 5 | sanity shutdown | 7 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato index b8e9847b48..7a6353e1af 100644 --- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato +++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity connman | ||
| 5 | sanity shutdown | 8 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk index b8e9847b48..42b8e19026 100644 --- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk +++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity compiler | ||
| 8 | sanity connman | ||
| 5 | sanity shutdown | 9 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb index b8e9847b48..4fa6068768 100644 --- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb +++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 5 | sanity shutdown | 7 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato index b8e9847b48..7a6353e1af 100644 --- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato +++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity connman | ||
| 5 | sanity shutdown | 8 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk index b8e9847b48..42b8e19026 100644 --- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk +++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity compiler | ||
| 8 | sanity connman | ||
| 5 | sanity shutdown | 9 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb index b8e9847b48..4fa6068768 100644 --- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb +++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 5 | sanity shutdown | 7 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato index b8e9847b48..7a6353e1af 100644 --- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato +++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity connman | ||
| 5 | sanity shutdown | 8 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk index b8e9847b48..42b8e19026 100644 --- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk +++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity compiler | ||
| 8 | sanity connman | ||
| 5 | sanity shutdown | 9 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb index b8e9847b48..4fa6068768 100644 --- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb +++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 5 | sanity shutdown | 7 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato index b8e9847b48..7a6353e1af 100644 --- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato +++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity connman | ||
| 5 | sanity shutdown | 8 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk index b8e9847b48..42b8e19026 100644 --- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk +++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity compiler | ||
| 8 | sanity connman | ||
| 5 | sanity shutdown | 9 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb index b8e9847b48..4fa6068768 100644 --- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb +++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 5 | sanity shutdown | 7 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato index b8e9847b48..7a6353e1af 100644 --- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato +++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity connman | ||
| 5 | sanity shutdown | 8 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk index b8e9847b48..42b8e19026 100644 --- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk +++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | sanity boot | ||
| 2 | sanity ssh | 1 | sanity ssh |
| 3 | sanity scp | 2 | sanity scp |
| 4 | sanity dmesg | 3 | sanity dmesg |
| 4 | sanity zypper_help | ||
| 5 | sanity zypper_search | ||
| 6 | sanity rpm_query | ||
| 7 | sanity compiler | ||
| 8 | sanity connman | ||
| 5 | sanity shutdown | 9 | sanity shutdown |
diff --git a/scripts/qemuimage-tests/tools/compiler_test.sh b/scripts/qemuimage-tests/tools/compiler_test.sh new file mode 100644 index 0000000000..9c30d6d78b --- /dev/null +++ b/scripts/qemuimage-tests/tools/compiler_test.sh | |||
| @@ -0,0 +1,137 @@ | |||
| 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 new file mode 100644 index 0000000000..d7e63e7dba --- /dev/null +++ b/scripts/qemuimage-tests/tools/connman_test.sh | |||
| @@ -0,0 +1,55 @@ | |||
| 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 connmand is in target | ||
| 24 | if [ ! -f /usr/sbin/connmand ]; then | ||
| 25 | Target_Info "No connmand command found" | ||
| 26 | exit 1 | ||
| 27 | fi | ||
| 28 | |||
| 29 | # Check if connmand is running in background | ||
| 30 | count=`ps -eo cmd | cut -d " " -f 1 | grep -c connmand` | ||
| 31 | |||
| 32 | if [ $count -ne 1 ]; then | ||
| 33 | Target_Info "connmand has issue when running in background, Pls, check the output of ps" | ||
| 34 | ps -ef cmd | grep connmand | ||
| 35 | exit 1 | ||
| 36 | fi | ||
| 37 | |||
| 38 | # Check if there is always only one connmand running in background | ||
| 39 | if [ connmand > /dev/null 2>&1 ]; then | ||
| 40 | Target_Info "connmand command run without problem" | ||
| 41 | count=`ps -eo cmd | cut -d " " -f 1 | grep -c connmand` | ||
| 42 | if [ $count -ne 1 ]; then | ||
| 43 | Target_Info "There are more than one connmand running in background, Pls, check the output of ps" | ||
| 44 | ps -ef cmd | grep connmand | ||
| 45 | exit 1 | ||
| 46 | else | ||
| 47 | Target_Info "There is always one connmand running in background, test pass" | ||
| 48 | exit 0 | ||
| 49 | fi | ||
| 50 | else | ||
| 51 | Target_Err connmand | ||
| 52 | exit 1 | ||
| 53 | fi | ||
| 54 | |||
| 55 | exit 0 | ||
diff --git a/scripts/qemuimage-tests/tools/rpm_test.sh b/scripts/qemuimage-tests/tools/rpm_test.sh new file mode 100644 index 0000000000..6e6f9112ca --- /dev/null +++ b/scripts/qemuimage-tests/tools/rpm_test.sh | |||
| @@ -0,0 +1,45 @@ | |||
| 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/zypper_test.sh b/scripts/qemuimage-tests/tools/zypper_test.sh new file mode 100644 index 0000000000..5e8e7aaacf --- /dev/null +++ b/scripts/qemuimage-tests/tools/zypper_test.sh | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # zypper 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: zypper 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 zypper | ||
| 24 | if [ $? -ne 0 ]; then | ||
| 25 | Target_Info "No zypper command found" | ||
| 26 | exit 1 | ||
| 27 | fi | ||
| 28 | |||
| 29 | if [ zypper > /dev/null 2>&1 ]; then | ||
| 30 | Target_Info "zypper command run without problem" | ||
| 31 | else | ||
| 32 | Target_Err zypper | ||
| 33 | exit 1 | ||
| 34 | fi | ||
| 35 | |||
| 36 | # run zypper with specific command parsed to zypper_test.sh | ||
| 37 | zypper $* > /dev/null 2>&1 | ||
| 38 | |||
| 39 | if [ $? -eq 0 ]; then | ||
| 40 | Target_Info "zypper $* work without problem" | ||
| 41 | exit 0 | ||
| 42 | else | ||
| 43 | Target_Err zypper $* | ||
| 44 | exit 1 | ||
| 45 | fi | ||
