Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image
@ 2011-11-17  6:05 Jiajun Xu
  2011-11-17  6:05 ` [PATCH 1/2] sanitytest: use different option for command ps from busybox and procps Jiajun Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiajun Xu @ 2011-11-17  6:05 UTC (permalink / raw)
  To: openembedded-core

Current sanitytest will report failure on non-rpm or non-procps installed image.
Add check for busybox/procps and use different option for different ps command.
Remove rpm/zypper tests if image is not based on rpm.

The following changes since commit da8425174529f10e16cde21fbea7f804284c38ae:

  alsa-lib: add nativesdk BBCLASSEXTEND (2011-11-15 12:22:58 +0000)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib jxu49/oe-contrib
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/oe-contrib

Jiajun Xu (2):
  sanitytest: use different option for command ps from busybox and
    procps
  sanitytest: remove rpm/zypper tests if PACKAGE_CLASSES does not set
    package_rpm

 meta/classes/imagetest-qemu.bbclass           |   25 +++++++++++++++++++++-
 scripts/qemuimage-tests/tools/connman_test.sh |   28 +++++++++++++++++++++---
 2 files changed, 48 insertions(+), 5 deletions(-)




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] sanitytest: use different option for command ps from busybox and procps
  2011-11-17  6:05 [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image Jiajun Xu
@ 2011-11-17  6:05 ` Jiajun Xu
  2011-11-17  6:05 ` [PATCH 2/2] sanitytest: remove rpm/zypper tests if PACKAGE_CLASSES does not set package_rpm Jiajun Xu
  2011-11-22 18:05 ` [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image Saul Wold
  2 siblings, 0 replies; 4+ messages in thread
From: Jiajun Xu @ 2011-11-17  6:05 UTC (permalink / raw)
  To: openembedded-core

Current sanitytest use option -e for ps command, which only works for ps
from procps. It fails if ps is provided by busybox. Add check to use different
option for command from busybox and procps.

[YOCTO #1756]

Signed-off-by: Jiajun Xu <jiajun.xu@intel.com>
---
 scripts/qemuimage-tests/tools/connman_test.sh |   28 +++++++++++++++++++++---
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/scripts/qemuimage-tests/tools/connman_test.sh b/scripts/qemuimage-tests/tools/connman_test.sh
index c4a66ee..8ed8b8b 100644
--- a/scripts/qemuimage-tests/tools/connman_test.sh
+++ b/scripts/qemuimage-tests/tools/connman_test.sh
@@ -20,6 +20,16 @@ Target_Err()
 	echo -e "\tTARGET: #####    End    #####"
 }
 
+# Check if ps comes from Procps or busybox first
+ls -l `which ps` | grep -q "busybox"
+RET=$?
+
+if [ $RET -eq 0 ]; then
+	PS="ps"
+else
+	PS="ps -ef"
+fi
+
 # Check if connmand is in target
 if [ ! -f /usr/sbin/connmand ]; then
 	Target_Info "No connmand command found"
@@ -27,21 +37,31 @@ if [ ! -f /usr/sbin/connmand ]; then
 fi
 
 # Check if connmand is running in background
-count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand`
+if [ $RET -eq 0 ]; then
+	count=`ps | awk '{print $5}' | grep -c connmand`
+else
+	count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand`
+fi
 
 if [ $count -ne 1 ]; then
 	Target_Info "connmand has issue when running in background, Pls, check the output of ps"
-	ps -ef | grep connmand
+	${PS} | 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 comm | cut -d " " -f 1 | grep -c connmand`
+
+	if [ $RET -eq 0 ]; then
+		count=`ps | awk '{print $5}' | grep -c connmand`
+	else
+		count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand`
+	fi
+
 	if [ $count -ne 1 ]; then
 		Target_Info "There are more than one connmand running in background, Pls, check the output of ps"
-		ps -ef | grep connmand
+		${PS} | grep connmand
 		exit 1
 	else
 		Target_Info "There is always one connmand running in background, test pass"
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] sanitytest: remove rpm/zypper tests if PACKAGE_CLASSES does not set package_rpm
  2011-11-17  6:05 [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image Jiajun Xu
  2011-11-17  6:05 ` [PATCH 1/2] sanitytest: use different option for command ps from busybox and procps Jiajun Xu
@ 2011-11-17  6:05 ` Jiajun Xu
  2011-11-22 18:05 ` [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image Saul Wold
  2 siblings, 0 replies; 4+ messages in thread
From: Jiajun Xu @ 2011-11-17  6:05 UTC (permalink / raw)
  To: openembedded-core

If PACKAGE_CLASSES does not set package_rpm as the first item, the root filesystem
will not be generated based on rpm. We need remove rpm/zypper tests against
non-rpm filesystem.

[YOCTO #1757]

Signed-off-by: Jiajun Xu <jiajun.xu@intel.com>
---
 meta/classes/imagetest-qemu.bbclass |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/meta/classes/imagetest-qemu.bbclass b/meta/classes/imagetest-qemu.bbclass
index de142bc..d01d1f4 100644
--- a/meta/classes/imagetest-qemu.bbclass
+++ b/meta/classes/imagetest-qemu.bbclass
@@ -80,9 +80,31 @@ def qemuimagetest_main(d):
         bb.note("Run %s test in scenario %s" % (case, scen))
         os.system("%s" % fulltestpath)
     
+    """function to check testcase list and remove inappropriate cases"""
+    def check_list(list):
+	final_list = []
+	for test in list:
+	    (scen, case, fullpath) = test
+
+	    """Skip rpm/zypper if package_rpm not set for PACKAGE_CLASSES"""
+	    if case.find("zypper") != -1 or case.find("rpm") != -1:
+	        if d.getVar("PACKAGE_CLASSES", True).find("rpm", 0, 11) == -1:
+            	    bb.note("skip rpm/zypper cases since package_rpm not set in PACKAGE_CLASSES")
+	 	    continue
+	        else:
+		    final_list.append((scen, case, fullpath))
+	    else:
+                    final_list.append((scen, case, fullpath))
+
+	if not final_list:
+	    raise bb.build.FuncFailed("There is no suitable testcase for this target")
+
+	return final_list
+
     """Generate testcase list in runtime"""
     def generate_list(testlist):
         list = []
+	final_list = []
         if len(testlist) == 0:
             raise bb.build.FuncFailed("No testcase defined in TEST_SCEN")
 
@@ -114,7 +136,8 @@ def qemuimagetest_main(d):
                        if not os.path.isfile(fulltestcase):
                             raise bb.build.FuncFailed("Testcase %s not found" % fulltestcase)
                        list.append((item, casefile, fulltestcase))
-        return list
+	final_list = check_list(list)
+        return final_list
 
     """Clean tmp folder for testing"""
     def clean_tmp():
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image
  2011-11-17  6:05 [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image Jiajun Xu
  2011-11-17  6:05 ` [PATCH 1/2] sanitytest: use different option for command ps from busybox and procps Jiajun Xu
  2011-11-17  6:05 ` [PATCH 2/2] sanitytest: remove rpm/zypper tests if PACKAGE_CLASSES does not set package_rpm Jiajun Xu
@ 2011-11-22 18:05 ` Saul Wold
  2 siblings, 0 replies; 4+ messages in thread
From: Saul Wold @ 2011-11-22 18:05 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 11/16/2011 10:05 PM, Jiajun Xu wrote:
> Current sanitytest will report failure on non-rpm or non-procps installed image.
> Add check for busybox/procps and use different option for different ps command.
> Remove rpm/zypper tests if image is not based on rpm.
>
> The following changes since commit da8425174529f10e16cde21fbea7f804284c38ae:
>
>    alsa-lib: add nativesdk BBCLASSEXTEND (2011-11-15 12:22:58 +0000)
>
> are available in the git repository at:
>    git://git.pokylinux.org/poky-contrib jxu49/oe-contrib
>    http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/oe-contrib
>
> Jiajun Xu (2):
>    sanitytest: use different option for command ps from busybox and
>      procps
>    sanitytest: remove rpm/zypper tests if PACKAGE_CLASSES does not set
>      package_rpm
>
>   meta/classes/imagetest-qemu.bbclass           |   25 +++++++++++++++++++++-
>   scripts/qemuimage-tests/tools/connman_test.sh |   28 +++++++++++++++++++++---
>   2 files changed, 48 insertions(+), 5 deletions(-)
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Merged into OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-22 18:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17  6:05 [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image Jiajun Xu
2011-11-17  6:05 ` [PATCH 1/2] sanitytest: use different option for command ps from busybox and procps Jiajun Xu
2011-11-17  6:05 ` [PATCH 2/2] sanitytest: remove rpm/zypper tests if PACKAGE_CLASSES does not set package_rpm Jiajun Xu
2011-11-22 18:05 ` [PATCH 0/2] sanitytest: Fix 2 bugs on non-rpm or non-procps installed image Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox