* [PATCH 0/4] qemuimagetest: Add several cases for sanity test
@ 2010-12-31 8:16 Jiajun Xu
2010-12-31 8:16 ` [PATCH 1/4] qemuimagetest: Add basic function check for zypper command Jiajun Xu
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Jiajun Xu @ 2010-12-31 8:16 UTC (permalink / raw)
To: poky
There are 5 cases added for sanity test. These cases covers
basic function check for connman, compiler, zypper and rpm in
target.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: jxu49/master
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/master
Thanks,
Jiajun Xu <jiajun.xu@intel.com>
---
Jiajun Xu (4):
qemuimagetest: Add basic function check for zypper command
qemuimagetest: Add basic function check for rpm command
qemuimagetest: Add basic function check for gcc/g++/make command in
target
qemuimagetest: Add basic function check for connman
scripts/qemuimage-tests/sanity/compiler | 52 ++++++++
scripts/qemuimage-tests/sanity/connman | 52 ++++++++
scripts/qemuimage-tests/sanity/rpm_query | 52 ++++++++
scripts/qemuimage-tests/sanity/zypper_help | 52 ++++++++
scripts/qemuimage-tests/sanity/zypper_search | 52 ++++++++
.../scenario/qemuarm/poky-image-lsb | 4 +
.../scenario/qemuarm/poky-image-sato | 4 +
.../scenario/qemuarm/poky-image-sdk | 5 +
.../scenario/qemumips/poky-image-lsb | 4 +
.../scenario/qemumips/poky-image-sato | 4 +
.../scenario/qemumips/poky-image-sdk | 5 +
.../scenario/qemuppc/poky-image-lsb | 4 +
.../scenario/qemuppc/poky-image-sato | 4 +
.../scenario/qemuppc/poky-image-sdk | 5 +
.../scenario/qemux86-64/poky-image-lsb | 4 +
.../scenario/qemux86-64/poky-image-sato | 4 +
.../scenario/qemux86-64/poky-image-sdk | 5 +
.../scenario/qemux86/poky-image-lsb | 4 +
.../scenario/qemux86/poky-image-sato | 4 +
.../scenario/qemux86/poky-image-sdk | 5 +
scripts/qemuimage-tests/tools/compiler_test.sh | 137 ++++++++++++++++++++
scripts/qemuimage-tests/tools/connman_test.sh | 55 ++++++++
scripts/qemuimage-tests/tools/rpm_test.sh | 45 +++++++
scripts/qemuimage-tests/tools/zypper_test.sh | 45 +++++++
24 files changed, 607 insertions(+), 0 deletions(-)
create mode 100755 scripts/qemuimage-tests/sanity/compiler
create mode 100755 scripts/qemuimage-tests/sanity/connman
create mode 100755 scripts/qemuimage-tests/sanity/rpm_query
create mode 100755 scripts/qemuimage-tests/sanity/zypper_help
create mode 100755 scripts/qemuimage-tests/sanity/zypper_search
create mode 100644 scripts/qemuimage-tests/tools/compiler_test.sh
create mode 100644 scripts/qemuimage-tests/tools/connman_test.sh
create mode 100644 scripts/qemuimage-tests/tools/rpm_test.sh
create mode 100644 scripts/qemuimage-tests/tools/zypper_test.sh
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] qemuimagetest: Add basic function check for zypper command
2010-12-31 8:16 [PATCH 0/4] qemuimagetest: Add several cases for sanity test Jiajun Xu
@ 2010-12-31 8:16 ` Jiajun Xu
2010-12-31 8:16 ` [PATCH 2/4] qemuimagetest: Add basic function check for rpm command Jiajun Xu
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jiajun Xu @ 2010-12-31 8:16 UTC (permalink / raw)
To: poky
Add two cases for zypper sanity test.
Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
---
scripts/qemuimage-tests/sanity/zypper_help | 52 ++++++++++++++++++++
scripts/qemuimage-tests/sanity/zypper_search | 52 ++++++++++++++++++++
.../scenario/qemuarm/poky-image-lsb | 2 +
.../scenario/qemuarm/poky-image-sato | 2 +
.../scenario/qemuarm/poky-image-sdk | 2 +
.../scenario/qemumips/poky-image-lsb | 2 +
.../scenario/qemumips/poky-image-sato | 2 +
.../scenario/qemumips/poky-image-sdk | 2 +
.../scenario/qemuppc/poky-image-lsb | 2 +
.../scenario/qemuppc/poky-image-sato | 2 +
.../scenario/qemuppc/poky-image-sdk | 2 +
.../scenario/qemux86-64/poky-image-lsb | 2 +
.../scenario/qemux86-64/poky-image-sato | 2 +
.../scenario/qemux86-64/poky-image-sdk | 2 +
.../scenario/qemux86/poky-image-lsb | 2 +
.../scenario/qemux86/poky-image-sato | 2 +
.../scenario/qemux86/poky-image-sdk | 2 +
scripts/qemuimage-tests/tools/zypper_test.sh | 45 +++++++++++++++++
18 files changed, 179 insertions(+), 0 deletions(-)
create mode 100755 scripts/qemuimage-tests/sanity/zypper_help
create mode 100755 scripts/qemuimage-tests/sanity/zypper_search
create mode 100644 scripts/qemuimage-tests/tools/zypper_test.sh
diff --git a/scripts/qemuimage-tests/sanity/zypper_help b/scripts/qemuimage-tests/sanity/zypper_help
new file mode 100755
index 0000000..e052501
--- /dev/null
+++ b/scripts/qemuimage-tests/sanity/zypper_help
@@ -0,0 +1,52 @@
+#!/bin/bash
+# Zypper Check Test Case for Sanity Test
+# The case boot up the Qemu target with `poky-qemu qemuxxx`.
+# Then check if zypper command can work in target.
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+. $POKYBASE/scripts/qemuimage-testlib
+
+TIMEOUT=360
+RET=1
+
+# Start qemu and check its network
+Test_Create_Qemu ${TIMEOUT}
+
+# If qemu network is up, check ssh service in qemu
+if [ $? -eq 0 ]; then
+ Test_Info "Begin to Test SSH Service in Qemu"
+ Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT}
+ RET=$?
+else
+ RET=1
+fi
+
+# Check if zypper help can work in target
+if [ $RET -eq 0 -a -f $TOOLS/zypper_test.sh ]; then
+ # Copy zypper_test.sh into target
+ Test_Target_Pre ${TARGET_IPADDR} $TOOLS/zypper_test.sh
+ if [ $? -eq 0 ]; then
+ # Run zypper_test.sh to check if zypper help can work in target
+ Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/zypper_test.sh help"
+ RET=$?
+ else
+ RET=1
+ fi
+fi
+
+if [ ${RET} -eq 0 ]; then
+ Test_Info "zypper help Test PASS"
+ Test_Kill_Qemu
+ Test_Print_Result "zypper_help" 0
+ exit 0
+else
+ Test_Info "zypper help FAIL, Pls. check above error log"
+ Test_Kill_Qemu
+ Test_Print_Result "zypper_help" 1
+ exit 1
+fi
diff --git a/scripts/qemuimage-tests/sanity/zypper_search b/scripts/qemuimage-tests/sanity/zypper_search
new file mode 100755
index 0000000..b756db8
--- /dev/null
+++ b/scripts/qemuimage-tests/sanity/zypper_search
@@ -0,0 +1,52 @@
+#!/bin/bash
+# Zypper Check Test Case for Sanity Test
+# The case boot up the Qemu target with `poky-qemu qemuxxx`.
+# Then check if zypper command can work in target.
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+. $POKYBASE/scripts/qemuimage-testlib
+
+TIMEOUT=360
+RET=1
+
+# Start qemu and check its network
+Test_Create_Qemu ${TIMEOUT}
+
+# If qemu network is up, check ssh service in qemu
+if [ $? -eq 0 ]; then
+ Test_Info "Begin to Test SSH Service in Qemu"
+ Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT}
+ RET=$?
+else
+ RET=1
+fi
+
+# Check if zypper search can work in target
+if [ $RET -eq 0 -a -f $TOOLS/zypper_test.sh ]; then
+ # Copy zypper_test.sh into target
+ Test_Target_Pre ${TARGET_IPADDR} $TOOLS/zypper_test.sh
+ if [ $? -eq 0 ]; then
+ # Run zypper_test.sh to check if zypper search can work in target
+ Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/zypper_test.sh search avahi"
+ RET=$?
+ else
+ RET=1
+ fi
+fi
+
+if [ ${RET} -eq 0 ]; then
+ Test_Info "zypper search package avahi Test PASS"
+ Test_Kill_Qemu
+ Test_Print_Result "zypper_search" 0
+ exit 0
+else
+ Test_Info "zypper search package avahi FAIL, Pls. check above error log"
+ Test_Kill_Qemu
+ Test_Print_Result "zypper_search" 1
+ exit 1
+fi
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
index b8e9847..9ec452b 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
@@ -3,3 +3,5 @@ sanity ssh
sanity scp
sanity dmesg
sanity shutdown
+sanity zypper_help
+sanity zypper_search
diff --git a/scripts/qemuimage-tests/tools/zypper_test.sh b/scripts/qemuimage-tests/tools/zypper_test.sh
new file mode 100644
index 0000000..5e8e7aa
--- /dev/null
+++ b/scripts/qemuimage-tests/tools/zypper_test.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# zypper test script running in target
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+Target_Info()
+{
+ echo -e "\tTARGET: $*"
+}
+
+Target_Err()
+{
+ echo -e "\tTARGET: zypper command has issue when running, Pls. check the error log"
+ echo -e "\tTARGET: ##### Error Log #####"
+ $1
+ echo -e "\tTARGET: ##### End #####"
+}
+
+which zypper
+if [ $? -ne 0 ]; then
+ Target_Info "No zypper command found"
+ exit 1
+fi
+
+if [ zypper > /dev/null 2>&1 ]; then
+ Target_Info "zypper command run without problem"
+else
+ Target_Err zypper
+ exit 1
+fi
+
+# run zypper with specific command parsed to zypper_test.sh
+zypper $* > /dev/null 2>&1
+
+if [ $? -eq 0 ]; then
+ Target_Info "zypper $* work without problem"
+ exit 0
+else
+ Target_Err zypper $*
+ exit 1
+fi
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] qemuimagetest: Add basic function check for rpm command
2010-12-31 8:16 [PATCH 0/4] qemuimagetest: Add several cases for sanity test Jiajun Xu
2010-12-31 8:16 ` [PATCH 1/4] qemuimagetest: Add basic function check for zypper command Jiajun Xu
@ 2010-12-31 8:16 ` Jiajun Xu
2010-12-31 8:16 ` [PATCH 3/4] qemuimagetest: Add basic function check for gcc/g++/make command in target Jiajun Xu
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jiajun Xu @ 2010-12-31 8:16 UTC (permalink / raw)
To: poky
Add one case for rpm query sanity test.
Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
---
scripts/qemuimage-tests/sanity/rpm_query | 52 ++++++++++++++++++++
.../scenario/qemuarm/poky-image-lsb | 1 +
.../scenario/qemuarm/poky-image-sato | 1 +
.../scenario/qemuarm/poky-image-sdk | 1 +
.../scenario/qemumips/poky-image-lsb | 1 +
.../scenario/qemumips/poky-image-sato | 1 +
.../scenario/qemumips/poky-image-sdk | 1 +
.../scenario/qemuppc/poky-image-lsb | 1 +
.../scenario/qemuppc/poky-image-sato | 1 +
.../scenario/qemuppc/poky-image-sdk | 1 +
.../scenario/qemux86-64/poky-image-lsb | 1 +
.../scenario/qemux86-64/poky-image-sato | 1 +
.../scenario/qemux86-64/poky-image-sdk | 1 +
.../scenario/qemux86/poky-image-lsb | 1 +
.../scenario/qemux86/poky-image-sato | 1 +
.../scenario/qemux86/poky-image-sdk | 1 +
scripts/qemuimage-tests/tools/rpm_test.sh | 45 +++++++++++++++++
17 files changed, 112 insertions(+), 0 deletions(-)
create mode 100755 scripts/qemuimage-tests/sanity/rpm_query
create mode 100644 scripts/qemuimage-tests/tools/rpm_test.sh
diff --git a/scripts/qemuimage-tests/sanity/rpm_query b/scripts/qemuimage-tests/sanity/rpm_query
new file mode 100755
index 0000000..9962115
--- /dev/null
+++ b/scripts/qemuimage-tests/sanity/rpm_query
@@ -0,0 +1,52 @@
+#!/bin/bash
+# RPM Check Test Case for Sanity Test
+# The case boot up the Qemu target with `poky-qemu qemuxxx`.
+# Then check if rpm command can work in target.
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+. $POKYBASE/scripts/qemuimage-testlib
+
+TIMEOUT=360
+RET=1
+
+# Start qemu and check its network
+Test_Create_Qemu ${TIMEOUT}
+
+# If qemu network is up, check ssh service in qemu
+if [ $? -eq 0 ]; then
+ Test_Info "Begin to Test SSH Service in Qemu"
+ Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT}
+ RET=$?
+else
+ RET=1
+fi
+
+# Check if rpm query can work in target
+if [ $RET -eq 0 -a -f $TOOLS/rpm_test.sh ]; then
+ # Copy rpm_test.sh into target
+ Test_Target_Pre ${TARGET_IPADDR} $TOOLS/rpm_test.sh
+ if [ $? -eq 0 ]; then
+ # Run rpm_test.sh to check if rpm query can work in target
+ Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/rpm_test.sh -qa"
+ RET=$?
+ else
+ RET=1
+ fi
+fi
+
+if [ ${RET} -eq 0 ]; then
+ Test_Info "rpm query Test PASS"
+ Test_Kill_Qemu
+ Test_Print_Result "rpm_query" 0
+ exit 0
+else
+ Test_Info "rpm query FAIL, Pls. check above error log"
+ Test_Kill_Qemu
+ Test_Print_Result "rpm_query" 1
+ exit 1
+fi
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
index 9ec452b..32d2bd1 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
@@ -5,3 +5,4 @@ sanity dmesg
sanity shutdown
sanity zypper_help
sanity zypper_search
+sanity rpm_query
diff --git a/scripts/qemuimage-tests/tools/rpm_test.sh b/scripts/qemuimage-tests/tools/rpm_test.sh
new file mode 100644
index 0000000..6e6f911
--- /dev/null
+++ b/scripts/qemuimage-tests/tools/rpm_test.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# rpm test script running in target
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+Target_Info()
+{
+ echo -e "\tTARGET: $*"
+}
+
+Target_Err()
+{
+ echo -e "\tTARGET: rpm command has issue when running, Pls. check the error log"
+ echo -e "\tTARGET: ##### Error Log #####"
+ $1
+ echo -e "\tTARGET: ##### End #####"
+}
+
+which rpm
+if [ $? -ne 0 ]; then
+ Target_Info "No rpm command found"
+ exit 1
+fi
+
+if [ rpm > /dev/null 2>&1 ]; then
+ Target_Info "rpm command run without problem"
+else
+ Target_Err rpm
+ exit 1
+fi
+
+# run rpm with specific command parsed to rpm_test.sh
+rpm $* > /dev/null 2>&1
+
+if [ $? -eq 0 ]; then
+ Target_Info "rpm $* work without problem"
+ exit 0
+else
+ Target_Err rpm $*
+ exit 1
+fi
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] qemuimagetest: Add basic function check for gcc/g++/make command in target
2010-12-31 8:16 [PATCH 0/4] qemuimagetest: Add several cases for sanity test Jiajun Xu
2010-12-31 8:16 ` [PATCH 1/4] qemuimagetest: Add basic function check for zypper command Jiajun Xu
2010-12-31 8:16 ` [PATCH 2/4] qemuimagetest: Add basic function check for rpm command Jiajun Xu
@ 2010-12-31 8:16 ` Jiajun Xu
2010-12-31 8:16 ` [PATCH 4/4] qemuimagetest: Add basic function check for connman Jiajun Xu
2011-01-04 1:19 ` [PATCH 0/4] qemuimagetest: Add several cases for sanity test Saul Wold
4 siblings, 0 replies; 6+ messages in thread
From: Jiajun Xu @ 2010-12-31 8:16 UTC (permalink / raw)
To: poky
Add one case for compile tools sanity test in target, including gcc/g++/make.
Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
---
scripts/qemuimage-tests/sanity/compiler | 52 ++++++++
.../scenario/qemuarm/poky-image-sdk | 1 +
.../scenario/qemumips/poky-image-sdk | 1 +
.../scenario/qemuppc/poky-image-sdk | 1 +
.../scenario/qemux86-64/poky-image-sdk | 1 +
.../scenario/qemux86/poky-image-sdk | 1 +
scripts/qemuimage-tests/tools/compiler_test.sh | 137 ++++++++++++++++++++
7 files changed, 194 insertions(+), 0 deletions(-)
create mode 100755 scripts/qemuimage-tests/sanity/compiler
create mode 100644 scripts/qemuimage-tests/tools/compiler_test.sh
diff --git a/scripts/qemuimage-tests/sanity/compiler b/scripts/qemuimage-tests/sanity/compiler
new file mode 100755
index 0000000..0290540
--- /dev/null
+++ b/scripts/qemuimage-tests/sanity/compiler
@@ -0,0 +1,52 @@
+#!/bin/bash
+# Compiler Test Case for Sanity Test
+# The case boot up the Qemu target with `poky-qemu qemuxxx`.
+# Then check if gcc/g++/make command can work in target.
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+. $POKYBASE/scripts/qemuimage-testlib
+
+TIMEOUT=360
+RET=1
+
+# Start qemu and check its network
+Test_Create_Qemu ${TIMEOUT}
+
+# If qemu network is up, check ssh service in qemu
+if [ $? -eq 0 ]; then
+ Test_Info "Begin to Test SSH Service in Qemu"
+ Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT}
+ RET=$?
+else
+ RET=1
+fi
+
+# Check if gcc/g++/make can work in target
+if [ $RET -eq 0 -a -f $TOOLS/compiler_test.sh ]; then
+ # Copy compiler_test.sh into target
+ Test_Target_Pre ${TARGET_IPADDR} $TOOLS/compiler_test.sh
+ if [ $? -eq 0 ]; then
+ # Run compiler_test.sh to check if gcc/g++/make can work in target
+ Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/compiler_test.sh"
+ RET=$?
+ else
+ RET=1
+ fi
+fi
+
+if [ ${RET} -eq 0 ]; then
+ Test_Info "Compiler Test PASS"
+ Test_Kill_Qemu
+ Test_Print_Result "compiler" 0
+ exit 0
+else
+ Test_Info "Compiler FAIL, Pls. check above error log"
+ Test_Kill_Qemu
+ Test_Print_Result "compiler" 1
+ exit 1
+fi
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
index 32d2bd1..d18a9f7 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity compiler
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
index 32d2bd1..d18a9f7 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity compiler
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
index 32d2bd1..d18a9f7 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity compiler
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
index 32d2bd1..d18a9f7 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity compiler
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
index 32d2bd1..d18a9f7 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity compiler
diff --git a/scripts/qemuimage-tests/tools/compiler_test.sh b/scripts/qemuimage-tests/tools/compiler_test.sh
new file mode 100644
index 0000000..9c30d6d
--- /dev/null
+++ b/scripts/qemuimage-tests/tools/compiler_test.sh
@@ -0,0 +1,137 @@
+#!/bin/bash
+# compiler test script running in target
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+# Prepare test folder for compiler test
+COMPILE_FOLDER="/opt/test/compile_test"
+TEST_FILE="$COMPILE_FOLDER/compile_test.c"
+EXECUTE_FILE="$COMPILE_FOLDER/compile_test"
+TEST_MAKEFILE="$COMPILE_FOLDER/makefile"
+TEST_LIST="gcc g++ make"
+
+if [ ! -d $COMPILE_FOLDER ]; then
+ mkdir -p $COMPILE_FOLDER
+fi
+
+Target_Info()
+{
+ echo -e "\tTARGET: $*"
+}
+
+Target_Err()
+{
+ echo -e "\tTARGET: ##### Error Log #####"
+ $@
+ echo -e "\tTARGET: ##### End #####"
+}
+
+# Function to generate a c test file for compiler testing
+Gen_File()
+{
+ temp=`mktemp`
+
+ # Generate c/c++ test file for compiler testing
+ echo "#include <stdio.h>" >> $temp
+ echo "#include <math.h>" >> $temp
+ echo "" >> $temp
+ echo "double" >> $temp
+ echo "convert(long long l)" >> $temp
+ echo "{" >> $temp
+ echo " return (double)l; // or double(l)" >> $temp
+ echo "}" >> $temp
+ echo "" >> $temp
+ echo "int" >> $temp
+ echo "main(int argc, char * argv[])" >> $temp
+ echo "{" >> $temp
+ echo " long long l = 10;" >> $temp
+ echo " double f;" >> $temp
+ echo "" >> $temp
+ echo " f = convert(l);" >> $temp
+ echo " printf(\"convert: %lld => %f\n\", l, f);" >> $temp
+ echo "" >> $temp
+ echo " f = 1234.67;" >> $temp
+ echo " printf(\"floorf(%f) = %f\n\", f, floorf(f));" >> $temp
+ echo " return 0;" >> $temp
+ echo "}" >> $temp
+ echo $temp
+}
+
+# Function to generate a makefile for compiler testing
+Gen_Makefile()
+{
+ temp=`mktemp`
+ basename=`basename $EXECUTE_FILE`
+
+ echo -e "$basename: $basename.o" >> $temp
+ echo -e "\tgcc -o $basename $basename.o -lm" >> $temp
+ echo -e "$basename.o: $basename.c" >> $temp
+ echo -e "\tgcc -c $basename.c" >> $temp
+
+ echo $temp
+}
+
+# Generate a c test file for compiler testing
+test_file=`Gen_File`
+
+MOVE=`which mv`
+$MOVE $test_file $TEST_FILE
+
+# Begin compiler test in target
+for cmd in $TEST_LIST
+do
+ which $cmd
+ if [ $? -ne 0 ]; then
+ Target_Info "No $cmd command found"
+ exit 1
+ fi
+
+ if [ "$cmd" == "make" ]; then
+ rm -rf $EXECUTE_FILE
+
+ # For makefile test, we need to generate a makefile and run with a c file
+ makefile=`Gen_Makefile`
+ $MOVE $makefile $TEST_MAKEFILE
+
+ cd `dirname $TEST_MAKEFILE`
+ make
+
+ if [ $? -ne 0 ]; then
+ Target_Info "$cmd running with error, Pls. check error in following"
+ Target_Err make
+ exit 1
+ fi
+ else
+ rm -rf $EXECUTE_FILE
+
+ # For gcc/g++, we compile a c test file and check the output
+ $cmd $TEST_FILE -o $EXECUTE_FILE -lm
+
+ if [ $? -ne 0 ]; then
+ Target_Info "$cmd running with error, Pls. check error in following"
+ Target_Err $cmd $TEST_FILE -o $EXECUTE_FILE -lm
+ exit 1
+ fi
+ fi
+
+ # Check if the binary file generated by $cmd can work without error
+ if [ -f $EXECUTE_FILE ]; then
+ $EXECUTE_FILE
+ if [ $? -ne 0 ]; then
+ Target_Info "$EXECUTE_FILE running with error, Pls. check error in following"
+ Target_Err $EXECUTE_FILE
+ exit 1
+ else
+ Target_Info "$cmd can work without problem in target"
+ fi
+ else
+ Target_Info "No executalbe file $EXECUTE_FILE found, Pls. check the error log"
+ exit 1
+ fi
+done
+
+exit 0
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] qemuimagetest: Add basic function check for connman
2010-12-31 8:16 [PATCH 0/4] qemuimagetest: Add several cases for sanity test Jiajun Xu
` (2 preceding siblings ...)
2010-12-31 8:16 ` [PATCH 3/4] qemuimagetest: Add basic function check for gcc/g++/make command in target Jiajun Xu
@ 2010-12-31 8:16 ` Jiajun Xu
2011-01-04 1:19 ` [PATCH 0/4] qemuimagetest: Add several cases for sanity test Saul Wold
4 siblings, 0 replies; 6+ messages in thread
From: Jiajun Xu @ 2010-12-31 8:16 UTC (permalink / raw)
To: poky
Add one case for connman sanity test. We check if connmand is running
in background after booting and if there is always one connmand process
running even connmand is executed by several times.
Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
---
scripts/qemuimage-tests/sanity/connman | 52 ++++++++++++++++++
.../scenario/qemuarm/poky-image-lsb | 1 +
.../scenario/qemuarm/poky-image-sato | 1 +
.../scenario/qemuarm/poky-image-sdk | 1 +
.../scenario/qemumips/poky-image-lsb | 1 +
.../scenario/qemumips/poky-image-sato | 1 +
.../scenario/qemumips/poky-image-sdk | 1 +
.../scenario/qemuppc/poky-image-lsb | 1 +
.../scenario/qemuppc/poky-image-sato | 1 +
.../scenario/qemuppc/poky-image-sdk | 1 +
.../scenario/qemux86-64/poky-image-lsb | 1 +
.../scenario/qemux86-64/poky-image-sato | 1 +
.../scenario/qemux86-64/poky-image-sdk | 1 +
.../scenario/qemux86/poky-image-lsb | 1 +
.../scenario/qemux86/poky-image-sato | 1 +
.../scenario/qemux86/poky-image-sdk | 1 +
scripts/qemuimage-tests/tools/connman_test.sh | 55 ++++++++++++++++++++
17 files changed, 122 insertions(+), 0 deletions(-)
create mode 100755 scripts/qemuimage-tests/sanity/connman
create mode 100644 scripts/qemuimage-tests/tools/connman_test.sh
diff --git a/scripts/qemuimage-tests/sanity/connman b/scripts/qemuimage-tests/sanity/connman
new file mode 100755
index 0000000..8c5b7c5
--- /dev/null
+++ b/scripts/qemuimage-tests/sanity/connman
@@ -0,0 +1,52 @@
+#!/bin/bash
+# Conmman Check Test Case for Sanity Test
+# The case boot up the Qemu target with `poky-qemu qemuxxx`.
+# Then check if connman can work in target.
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+. $POKYBASE/scripts/qemuimage-testlib
+
+TIMEOUT=360
+RET=1
+
+# Start qemu and check its network
+Test_Create_Qemu ${TIMEOUT}
+
+# If qemu network is up, check ssh service in qemu
+if [ $? -eq 0 ]; then
+ Test_Info "Begin to Test SSH Service in Qemu"
+ Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT}
+ RET=$?
+else
+ RET=1
+fi
+
+# Check if connman can work in target
+if [ $RET -eq 0 -a -f $TOOLS/connman_test.sh ]; then
+ # Copy connman_test.sh into target
+ Test_Target_Pre ${TARGET_IPADDR} $TOOLS/connman_test.sh
+ if [ $? -eq 0 ]; then
+ # Run connman_test.sh to check if connman can work in target
+ Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/connman_test.sh"
+ RET=$?
+ else
+ RET=1
+ fi
+fi
+
+if [ ${RET} -eq 0 ]; then
+ Test_Info "Connman Test PASS"
+ Test_Kill_Qemu
+ Test_Print_Result "connman" 0
+ exit 0
+else
+ Test_Info "Connman Test FAIL, Pls. check above error log"
+ Test_Kill_Qemu
+ Test_Print_Result "connman" 1
+ exit 1
+fi
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
index d18a9f7..3a8b129 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk
@@ -7,3 +7,4 @@ sanity zypper_help
sanity zypper_search
sanity rpm_query
sanity compiler
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sato
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
index d18a9f7..3a8b129 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk
@@ -7,3 +7,4 @@ sanity zypper_help
sanity zypper_search
sanity rpm_query
sanity compiler
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
index d18a9f7..3a8b129 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk
@@ -7,3 +7,4 @@ sanity zypper_help
sanity zypper_search
sanity rpm_query
sanity compiler
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
index d18a9f7..3a8b129 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk
@@ -7,3 +7,4 @@ sanity zypper_help
sanity zypper_search
sanity rpm_query
sanity compiler
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb b/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
index 32d2bd1..7b949a8 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sato
@@ -6,3 +6,4 @@ sanity shutdown
sanity zypper_help
sanity zypper_search
sanity rpm_query
+sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
index d18a9f7..3a8b129 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk
@@ -7,3 +7,4 @@ sanity zypper_help
sanity zypper_search
sanity rpm_query
sanity compiler
+sanity connman
diff --git a/scripts/qemuimage-tests/tools/connman_test.sh b/scripts/qemuimage-tests/tools/connman_test.sh
new file mode 100644
index 0000000..d7e63e7
--- /dev/null
+++ b/scripts/qemuimage-tests/tools/connman_test.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+# connman test script running in target
+#
+# Author: Jiajun Xu <jiajun.xu@intel.com>
+#
+# This file is licensed under the GNU General Public License,
+# Version 2.
+#
+
+Target_Info()
+{
+ echo -e "\tTARGET: $*"
+}
+
+Target_Err()
+{
+ echo -e "\tTARGET: connman has issue when running, Pls. check the error log"
+ echo -e "\tTARGET: ##### Error Log #####"
+ $1
+ echo -e "\tTARGET: ##### End #####"
+}
+
+# Check if connmand is in target
+if [ ! -f /usr/sbin/connmand ]; then
+ Target_Info "No connmand command found"
+ exit 1
+fi
+
+# Check if connmand is running in background
+count=`ps -eo cmd | cut -d " " -f 1 | grep -c connmand`
+
+if [ $count -ne 1 ]; then
+ Target_Info "connmand has issue when running in background, Pls, check the output of ps"
+ ps -ef cmd | grep connmand
+ exit 1
+fi
+
+# Check if there is always only one connmand running in background
+if [ connmand > /dev/null 2>&1 ]; then
+ Target_Info "connmand command run without problem"
+ count=`ps -eo cmd | cut -d " " -f 1 | grep -c connmand`
+ if [ $count -ne 1 ]; then
+ Target_Info "There are more than one connmand running in background, Pls, check the output of ps"
+ ps -ef cmd | grep connmand
+ exit 1
+ else
+ Target_Info "There is always one connmand running in background, test pass"
+ exit 0
+ fi
+else
+ Target_Err connmand
+ exit 1
+fi
+
+exit 0
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] qemuimagetest: Add several cases for sanity test
2010-12-31 8:16 [PATCH 0/4] qemuimagetest: Add several cases for sanity test Jiajun Xu
` (3 preceding siblings ...)
2010-12-31 8:16 ` [PATCH 4/4] qemuimagetest: Add basic function check for connman Jiajun Xu
@ 2011-01-04 1:19 ` Saul Wold
4 siblings, 0 replies; 6+ messages in thread
From: Saul Wold @ 2011-01-04 1:19 UTC (permalink / raw)
To: Jiajun Xu; +Cc: poky
On 12/31/2010 12:16 AM, Jiajun Xu wrote:
> There are 5 cases added for sanity test. These cases covers
> basic function check for connman, compiler, zypper and rpm in
> target.
>
> Pull URL: git://git.pokylinux.org/poky-contrib.git
> Branch: jxu49/master
> Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/master
>
> Thanks,
> Jiajun Xu<jiajun.xu@intel.com>
> ---
>
>
> Jiajun Xu (4):
> qemuimagetest: Add basic function check for zypper command
> qemuimagetest: Add basic function check for rpm command
> qemuimagetest: Add basic function check for gcc/g++/make command in
> target
> qemuimagetest: Add basic function check for connman
>
> scripts/qemuimage-tests/sanity/compiler | 52 ++++++++
> scripts/qemuimage-tests/sanity/connman | 52 ++++++++
> scripts/qemuimage-tests/sanity/rpm_query | 52 ++++++++
> scripts/qemuimage-tests/sanity/zypper_help | 52 ++++++++
> scripts/qemuimage-tests/sanity/zypper_search | 52 ++++++++
> .../scenario/qemuarm/poky-image-lsb | 4 +
> .../scenario/qemuarm/poky-image-sato | 4 +
> .../scenario/qemuarm/poky-image-sdk | 5 +
> .../scenario/qemumips/poky-image-lsb | 4 +
> .../scenario/qemumips/poky-image-sato | 4 +
> .../scenario/qemumips/poky-image-sdk | 5 +
> .../scenario/qemuppc/poky-image-lsb | 4 +
> .../scenario/qemuppc/poky-image-sato | 4 +
> .../scenario/qemuppc/poky-image-sdk | 5 +
> .../scenario/qemux86-64/poky-image-lsb | 4 +
> .../scenario/qemux86-64/poky-image-sato | 4 +
> .../scenario/qemux86-64/poky-image-sdk | 5 +
> .../scenario/qemux86/poky-image-lsb | 4 +
> .../scenario/qemux86/poky-image-sato | 4 +
> .../scenario/qemux86/poky-image-sdk | 5 +
> scripts/qemuimage-tests/tools/compiler_test.sh | 137 ++++++++++++++++++++
> scripts/qemuimage-tests/tools/connman_test.sh | 55 ++++++++
> scripts/qemuimage-tests/tools/rpm_test.sh | 45 +++++++
> scripts/qemuimage-tests/tools/zypper_test.sh | 45 +++++++
> 24 files changed, 607 insertions(+), 0 deletions(-)
> create mode 100755 scripts/qemuimage-tests/sanity/compiler
> create mode 100755 scripts/qemuimage-tests/sanity/connman
> create mode 100755 scripts/qemuimage-tests/sanity/rpm_query
> create mode 100755 scripts/qemuimage-tests/sanity/zypper_help
> create mode 100755 scripts/qemuimage-tests/sanity/zypper_search
> create mode 100644 scripts/qemuimage-tests/tools/compiler_test.sh
> create mode 100644 scripts/qemuimage-tests/tools/connman_test.sh
> create mode 100644 scripts/qemuimage-tests/tools/rpm_test.sh
> create mode 100644 scripts/qemuimage-tests/tools/zypper_test.sh
>
> _______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky
>
Pulled into Master
Thanks
Sau!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-01-04 1:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-31 8:16 [PATCH 0/4] qemuimagetest: Add several cases for sanity test Jiajun Xu
2010-12-31 8:16 ` [PATCH 1/4] qemuimagetest: Add basic function check for zypper command Jiajun Xu
2010-12-31 8:16 ` [PATCH 2/4] qemuimagetest: Add basic function check for rpm command Jiajun Xu
2010-12-31 8:16 ` [PATCH 3/4] qemuimagetest: Add basic function check for gcc/g++/make command in target Jiajun Xu
2010-12-31 8:16 ` [PATCH 4/4] qemuimagetest: Add basic function check for connman Jiajun Xu
2011-01-04 1:19 ` [PATCH 0/4] qemuimagetest: Add several cases for sanity test Saul Wold
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.