Patchwork [1/1,V2] ethtool: fix ptest execution failure

login
register
mail settings
Submitter Chong.Lu@windriver.com
Date May 27, 2014, 1:43 a.m.
Message ID <1b730d155fa4bc1c464fa84ea934ed40391ddafa.1401154906.git.Chong.Lu@windriver.com>
Download mbox | patch
Permalink /patch/72763/
State New
Headers show

Comments

Chong.Lu@windriver.com - May 27, 2014, 1:43 a.m.
Modify ptest suite to make it enabled on new version.

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
 meta/recipes-extended/ethtool/ethtool/run-ptest |  2 +-
 meta/recipes-extended/ethtool/ethtool_3.14.bb   | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)
Tudor Florea - May 27, 2014, 9:05 a.m.
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf
> Of Chong Lu
> Sent: Tuesday, May 27, 2014 04:44
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 1/1][V2] ethtool: fix ptest execution failure
> 
> Modify ptest suite to make it enabled on new version.
> 
> --- a/meta/recipes-extended/ethtool/ethtool/run-ptest
> +++ b/meta/recipes-extended/ethtool/ethtool/run-ptest
> @@ -1,2 +1,2 @@
>  #!/bin/sh
> -make -k runtest-TESTS
> +make -k check-TESTS
[Tudor Florea] I don't think this is the good approach.
The concept of ptest  is to split "check" target testing into building part executed on host machine and then running part on the target. (as per https://wiki.yoctoproject.org/wiki/Ptest#Building_the_test_suite  )
My impression is that with this patch we are shifting this approach.

I  know that this patch http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/automake/automake/buildtest.patch ) does not produce "buildtest-TESTS" and "runtest-TESTS" targets because automake use now parallel testing by default.

Having said that  the real solution for issue like this is another (quite challenging) patch in automake along with the above one to deal with parallel testing hence leave the tested package recipe (e.g. ethtool) untouched.

The short term solution might be to avoid parallel testing for this package.
In yocto, with cross-testing environment we use are not taking (yet) any benefits of the parallel building environment.

I have sent a while back a patch for this package but  for some reason it was not merged:
+++ b/meta/recipes-extended/ethtool/ethtool-3.12.1/use_serial_tests.patch
@@ -0,0 +1,20 @@
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate 
+(default automake behavior incompatible with ptest) 
+
+diff -ruN a/configure.ac b/configure.ac
+--- a/configure.ac	2013-12-03 10:37:40.773157142 +0100
++++ b/configure.ac	2013-12-03 10:37:21.521992831 +0100
+@@ -2,7 +2,7 @@
+ AC_INIT(ethtool, 3.12.1, netdev@vger.kernel.org)
+ AC_PREREQ(2.52)
+ AC_CONFIG_SRCDIR([ethtool.c])
+-AM_INIT_AUTOMAKE([gnu])
++AM_INIT_AUTOMAKE([gnu serial-tests])
+ AC_CONFIG_HEADERS([ethtool-config.h])
+ 
+ AM_MAINTAINER_MODE

Patch

diff --git a/meta/recipes-extended/ethtool/ethtool/run-ptest b/meta/recipes-extended/ethtool/ethtool/run-ptest
index 1e245da..a359387 100644
--- a/meta/recipes-extended/ethtool/ethtool/run-ptest
+++ b/meta/recipes-extended/ethtool/ethtool/run-ptest
@@ -1,2 +1,2 @@ 
 #!/bin/sh
-make -k runtest-TESTS
+make -k check-TESTS
diff --git a/meta/recipes-extended/ethtool/ethtool_3.14.bb b/meta/recipes-extended/ethtool/ethtool_3.14.bb
index 2a3ca70..4f4e389 100644
--- a/meta/recipes-extended/ethtool/ethtool_3.14.bb
+++ b/meta/recipes-extended/ethtool/ethtool_3.14.bb
@@ -20,9 +20,15 @@  do_compile_ptest() {
 }
 
 do_install_ptest () {
-   cp ${B}/Makefile                 ${D}${PTEST_PATH}
-   install ${B}/test-cmdline        ${D}${PTEST_PATH}
-   install ${B}/test-features       ${D}${PTEST_PATH}
-   install ${B}/ethtool             ${D}${PTEST_PATH}/ethtool
-   sed -i 's/^Makefile/_Makefile/'  ${D}${PTEST_PATH}/Makefile
+   for i in Makefile test-cmdline test-features; do \
+       install ${B}/$i ${D}${PTEST_PATH}; done
+   install ${S}/test-driver ${D}${PTEST_PATH}
+   sed -e 's/^Makefile/_Makefile/' \
+       -e 's/^test_cmdline_OBJECTS/#test_cmdline_OBJECTS/' \
+       -e 's/^test_features_OBJECTS/#test_features_OBJECTS/' \
+       -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' \
+       -e '/^all:/,+1d' \
+       -e 's/bash/sh/' \
+       -e 's/gawk/awk/' \
+       -i ${D}${PTEST_PATH}/Makefile
 }