All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dbus-test_1.12.2: various fixes
@ 2018-02-27 20:19 Juro Bystricky
  2018-02-28  3:46 ` Khem Raj
  2018-02-28 14:54 ` Maxin B. John
  0 siblings, 2 replies; 6+ messages in thread
From: Juro Bystricky @ 2018-02-27 20:19 UTC (permalink / raw)
  To: openembedded-core; +Cc: jurobystricky

The result of running dbus-test-ptest was a series of
various segfaults, interpreted as FAILs. This was a direct consequence
of the test suite loading the installed shared library libdbus-1.so, not the
one built along the test suite.

While we normally want to test against the installed libraries, we cannot
do this in this case as the test suite expects a library that is configured/compiled
differently from the installed one. We could configure the installed library
identically as the test suite expects, (and there should be no issues), however
this is not desirable for performance reasons.

Hence we need to use the library built along with the test suite.
Of course, running the test suite against its own library does not
test the installed library, however they are both built from the same
sources so that can give us some kind of indication.

The following changes were made:

1. Configure the test library as close as possible to the installed one,
   with some additional configuration options that are needed for testing.
   (Use dbus_1.12.2.bb recipe as a template)
2. Include the shared libraries in the package, use LD_LIBRARY_PATH during
   testing to load them instead of the installed ones.
3. Add a few more tests. (There are still some additional tests built that
   are not used, but they would have to be special-cased).
4. When evaluating the test results, differentiate between "FAIL" and "SKIP"

[YOCTO #10841]
[YOCTO #12277]

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
---
 meta/recipes-core/dbus/dbus-test_1.12.2.bb | 30 ++++++++++++++++++++++++++----
 meta/recipes-core/dbus/dbus/run-ptest      | 20 +++++++++++++++++---
 2 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-core/dbus/dbus-test_1.12.2.bb b/meta/recipes-core/dbus/dbus-test_1.12.2.bb
index c3891a3..a6a5ca2 100644
--- a/meta/recipes-core/dbus/dbus-test_1.12.2.bb
+++ b/meta/recipes-core/dbus/dbus-test_1.12.2.bb
@@ -34,25 +34,47 @@ EXTRA_OECONF = "--enable-tests \
                 --enable-checks \
                 --enable-asserts \
                 --enable-verbose-mode \
+                --enable-largefile \
                 --disable-xml-docs \
                 --disable-doxygen-docs \
                 --disable-libaudit \
-                --disable-systemd \
-                --without-systemdsystemunitdir \
                 --with-dbus-test-dir=${PTEST_PATH} \
                 ${EXTRA_OECONF_X}"
 
+EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
+PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
+PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
+
 do_install() {
     :
 }
 
 do_install_ptest() {
 	install -d ${D}${PTEST_PATH}/test
-	l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay"
+	l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay \
+	   variant uid-permissions syntax spawn sd-activation names monitor message fdpass "
 	for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
+
 	l="bus bus-system bus-launch-helper"
 	for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
-	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
+
 	cp -r ${B}/test/data ${D}${PTEST_PATH}/test
+	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
+
+	install -d ${D}${PTEST_PATH}/test/.libs
+	cp -a ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
+
+	# Remove build host references...
+	find "${D}${PTEST_PATH}/test/data" \( -name *.service -o -name *.conf \) -type f -exec \
+		sed -i \
+		 -e 's:${B}:${PTEST_PATH}:g' \
+		 {} +
 }
+
 RDEPENDS_${PN}-ptest += "bash"
diff --git a/meta/recipes-core/dbus/dbus/run-ptest b/meta/recipes-core/dbus/dbus/run-ptest
index c72d083..8a8970e 100755
--- a/meta/recipes-core/dbus/dbus/run-ptest
+++ b/meta/recipes-core/dbus/dbus/run-ptest
@@ -1,10 +1,24 @@
 #!/bin/sh
 
 output() {
-  if [ $? -eq 0 ]
+  retcode=$?
+  if [ $retcode -eq 0 ]
     then echo "PASS: $i"
-    else echo "FAIL: $i"
+  elif [ $retcode -eq 77 ]
+    then echo "SKIP: $i"
+  else echo "FAIL: $i"
   fi
 }
 
-for i in `ls test/test-*`; do ./$i ./test/data DBUS_TEST_HOMEDIR=./test >/dev/null; output; done
+export DBUS_TEST_HOMEDIR=./test
+export XDG_RUNTIME_DIR=./test
+export LD_LIBRARY_PATH=/usr/lib/dbus-test/ptest/test/.libs
+
+files=`ls test/test-*`
+
+for i in $files
+	do
+		./$i ./test/data >/dev/null
+		output
+	done
+
-- 
2.7.4



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

* Re: [PATCH] dbus-test_1.12.2: various fixes
  2018-02-27 20:19 [PATCH] dbus-test_1.12.2: various fixes Juro Bystricky
@ 2018-02-28  3:46 ` Khem Raj
  2018-02-28 14:54 ` Maxin B. John
  1 sibling, 0 replies; 6+ messages in thread
From: Khem Raj @ 2018-02-28  3:46 UTC (permalink / raw)
  To: Juro Bystricky, openembedded-core; +Cc: jurobystricky



On 2/27/18 12:19 PM, Juro Bystricky wrote:
> The result of running dbus-test-ptest was a series of
> various segfaults, interpreted as FAILs. This was a direct consequence
> of the test suite loading the installed shared library libdbus-1.so, not the
> one built along the test suite.
> 
> While we normally want to test against the installed libraries, we cannot
> do this in this case as the test suite expects a library that is configured/compiled
> differently from the installed one. We could configure the installed library
> identically as the test suite expects, (and there should be no issues), however
> this is not desirable for performance reasons.
> 
> Hence we need to use the library built along with the test suite.
> Of course, running the test suite against its own library does not
> test the installed library, however they are both built from the same
> sources so that can give us some kind of indication.
> 
> The following changes were made:
> 
> 1. Configure the test library as close as possible to the installed one,
>     with some additional configuration options that are needed for testing.
>     (Use dbus_1.12.2.bb recipe as a template)
> 2. Include the shared libraries in the package, use LD_LIBRARY_PATH during
>     testing to load them instead of the installed ones.
> 3. Add a few more tests. (There are still some additional tests built that
>     are not used, but they would have to be special-cased).
> 4. When evaluating the test results, differentiate between "FAIL" and "SKIP"
> 
> [YOCTO #10841]
> [YOCTO #12277]
> 
> Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
> ---
>   meta/recipes-core/dbus/dbus-test_1.12.2.bb | 30 ++++++++++++++++++++++++++----
>   meta/recipes-core/dbus/dbus/run-ptest      | 20 +++++++++++++++++---
>   2 files changed, 43 insertions(+), 7 deletions(-)
> 
> diff --git a/meta/recipes-core/dbus/dbus-test_1.12.2.bb b/meta/recipes-core/dbus/dbus-test_1.12.2.bb
> index c3891a3..a6a5ca2 100644
> --- a/meta/recipes-core/dbus/dbus-test_1.12.2.bb
> +++ b/meta/recipes-core/dbus/dbus-test_1.12.2.bb
> @@ -34,25 +34,47 @@ EXTRA_OECONF = "--enable-tests \
>                   --enable-checks \
>                   --enable-asserts \
>                   --enable-verbose-mode \
> +                --enable-largefile \

Perhaps this should be controlled with DISTRO_FEATURE for largefile as 
well ?

>                   --disable-xml-docs \
>                   --disable-doxygen-docs \
>                   --disable-libaudit \
> -                --disable-systemd \
> -                --without-systemdsystemunitdir \
>                   --with-dbus-test-dir=${PTEST_PATH} \
>                   ${EXTRA_OECONF_X}"
>   
> +EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
> +
> +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
> +PACKAGECONFIG_class-native = ""
> +PACKAGECONFIG_class-nativesdk = ""
> +
> +PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
> +PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
> +PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
> +

hmm packageconfigs while a good thing here, would be nice if was 
mentioned in commit msg.

>   do_install() {
>       :
>   }
>   
>   do_install_ptest() {
>   	install -d ${D}${PTEST_PATH}/test
> -	l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay"
> +	l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay \
> +	   variant uid-permissions syntax spawn sd-activation names monitor message fdpass "

Dont know if we will be testing same things but this is a good start.

>   	for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
> +
>   	l="bus bus-system bus-launch-helper"
>   	for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
> -	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
> +
>   	cp -r ${B}/test/data ${D}${PTEST_PATH}/test
> +	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
> +
> +	install -d ${D}${PTEST_PATH}/test/.libs
> +	cp -a ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
> +
> +	# Remove build host references...
> +	find "${D}${PTEST_PATH}/test/data" \( -name *.service -o -name *.conf \) -type f -exec \
> +		sed -i \
> +		 -e 's:${B}:${PTEST_PATH}:g' \
> +		 {} +
>   }
> +
>   RDEPENDS_${PN}-ptest += "bash"
> diff --git a/meta/recipes-core/dbus/dbus/run-ptest b/meta/recipes-core/dbus/dbus/run-ptest
> index c72d083..8a8970e 100755
> --- a/meta/recipes-core/dbus/dbus/run-ptest
> +++ b/meta/recipes-core/dbus/dbus/run-ptest
> @@ -1,10 +1,24 @@
>   #!/bin/sh
>   
>   output() {
> -  if [ $? -eq 0 ]
> +  retcode=$?
> +  if [ $retcode -eq 0 ]
>       then echo "PASS: $i"
> -    else echo "FAIL: $i"
> +  elif [ $retcode -eq 77 ]
> +    then echo "SKIP: $i"
> +  else echo "FAIL: $i"
>     fi
>   }
>   
> -for i in `ls test/test-*`; do ./$i ./test/data DBUS_TEST_HOMEDIR=./test >/dev/null; output; done
> +export DBUS_TEST_HOMEDIR=./test
> +export XDG_RUNTIME_DIR=./test
> +export LD_LIBRARY_PATH=/usr/lib/dbus-test/ptest/test/.libs
> +
> +files=`ls test/test-*`
> +
> +for i in $files
> +	do
> +		./$i ./test/data >/dev/null
> +		output
> +	done
> +
> 


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

* Re: [PATCH] dbus-test_1.12.2: various fixes
  2018-02-27 20:19 [PATCH] dbus-test_1.12.2: various fixes Juro Bystricky
  2018-02-28  3:46 ` Khem Raj
@ 2018-02-28 14:54 ` Maxin B. John
  2018-02-28 17:34   ` Burton, Ross
  2018-02-28 17:48   ` Bystricky, Juro
  1 sibling, 2 replies; 6+ messages in thread
From: Maxin B. John @ 2018-02-28 14:54 UTC (permalink / raw)
  To: Juro Bystricky; +Cc: jurobystricky, openembedded-core

Hi,

On Tue, Feb 27, 2018 at 12:19:26PM -0800, Juro Bystricky wrote:
> The result of running dbus-test-ptest was a series of
> various segfaults, interpreted as FAILs. This was a direct consequence
> of the test suite loading the installed shared library libdbus-1.so, not the
> one built along the test suite.
> 
> While we normally want to test against the installed libraries, we cannot
> do this in this case as the test suite expects a library that is configured/compiled
> differently from the installed one. We could configure the installed library
> identically as the test suite expects, (and there should be no issues), however
> this is not desirable for performance reasons.
> 
> Hence we need to use the library built along with the test suite.
> Of course, running the test suite against its own library does not
> test the installed library, however they are both built from the same
> sources so that can give us some kind of indication.
> 
> The following changes were made:
> 
> 1. Configure the test library as close as possible to the installed one,
>    with some additional configuration options that are needed for testing.
>    (Use dbus_1.12.2.bb recipe as a template)
> 2. Include the shared libraries in the package, use LD_LIBRARY_PATH during
>    testing to load them instead of the installed ones.
> 3. Add a few more tests. (There are still some additional tests built that
>    are not used, but they would have to be special-cased).
> 4. When evaluating the test results, differentiate between "FAIL" and "SKIP"
> 
> [YOCTO #10841]
> [YOCTO #12277]
> 
> Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
> ---
>  meta/recipes-core/dbus/dbus-test_1.12.2.bb | 30 ++++++++++++++++++++++++++----
>  meta/recipes-core/dbus/dbus/run-ptest      | 20 +++++++++++++++++---
>  2 files changed, 43 insertions(+), 7 deletions(-)

Probably due to this change, dbus ptest related sanity tests fails here:

https://autobuilder.yocto.io/builders/nightly-deb-non-deb/builds/813/steps/Running%20Sanity%20Tests/logs/stdio


NOTE:  ... ok
| NOTE: ======================================================================
| NOTE: FAIL: test_ptestrunner (ptest.PtestRunnerTest)
| NOTE: ----------------------------------------------------------------------
| NOTE: Traceback (most recent call last):
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb-non-deb/build/meta/lib/oeqa/runtime/cases/ptest.py", line 93, in test_ptestrunner
|     self.assertFalse(failed_tests, msg = "Failed ptests: %s" %(str(failed_tests)))
| AssertionError: {'dbus-test': [' test/test-bus', ' test/test-dbus-daemon', ' test/test-names']} is not false : Failed ptests: {'dbus-test': [' test/test-bus', ' test/test-dbus-daemon', ' test/test-names']}


Best Regards,
Maxin


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

* Re: [PATCH] dbus-test_1.12.2: various fixes
  2018-02-28 14:54 ` Maxin B. John
@ 2018-02-28 17:34   ` Burton, Ross
  2018-02-28 17:48   ` Bystricky, Juro
  1 sibling, 0 replies; 6+ messages in thread
From: Burton, Ross @ 2018-02-28 17:34 UTC (permalink / raw)
  To: Maxin B. John; +Cc: Juro Bystricky, OE-core

[-- Attachment #1: Type: text/plain, Size: 4138 bytes --]

So the problem is that dbus-test has a libdbus-1.so.3 and if it is built
after dbus then it wins the race for "who provides libdbus.so".  Obviously
this isn't right, I'm testing a fix now using PRIVATE_LIBS and want to file
a bug to fix this behviour in 2.6.

Ross

On 28 February 2018 at 14:54, Maxin B. John <maxin.john@intel.com> wrote:

> Hi,
>
> On Tue, Feb 27, 2018 at 12:19:26PM -0800, Juro Bystricky wrote:
> > The result of running dbus-test-ptest was a series of
> > various segfaults, interpreted as FAILs. This was a direct consequence
> > of the test suite loading the installed shared library libdbus-1.so, not
> the
> > one built along the test suite.
> >
> > While we normally want to test against the installed libraries, we cannot
> > do this in this case as the test suite expects a library that is
> configured/compiled
> > differently from the installed one. We could configure the installed
> library
> > identically as the test suite expects, (and there should be no issues),
> however
> > this is not desirable for performance reasons.
> >
> > Hence we need to use the library built along with the test suite.
> > Of course, running the test suite against its own library does not
> > test the installed library, however they are both built from the same
> > sources so that can give us some kind of indication.
> >
> > The following changes were made:
> >
> > 1. Configure the test library as close as possible to the installed one,
> >    with some additional configuration options that are needed for
> testing.
> >    (Use dbus_1.12.2.bb recipe as a template)
> > 2. Include the shared libraries in the package, use LD_LIBRARY_PATH
> during
> >    testing to load them instead of the installed ones.
> > 3. Add a few more tests. (There are still some additional tests built
> that
> >    are not used, but they would have to be special-cased).
> > 4. When evaluating the test results, differentiate between "FAIL" and
> "SKIP"
> >
> > [YOCTO #10841]
> > [YOCTO #12277]
> >
> > Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
> > ---
> >  meta/recipes-core/dbus/dbus-test_1.12.2.bb | 30
> ++++++++++++++++++++++++++----
> >  meta/recipes-core/dbus/dbus/run-ptest      | 20 +++++++++++++++++---
> >  2 files changed, 43 insertions(+), 7 deletions(-)
>
> Probably due to this change, dbus ptest related sanity tests fails here:
>
> https://autobuilder.yocto.io/builders/nightly-deb-non-deb/
> builds/813/steps/Running%20Sanity%20Tests/logs/stdio
>
>
> NOTE:  ... ok
> | NOTE: ============================================================
> ==========
> | NOTE: FAIL: test_ptestrunner (ptest.PtestRunnerTest)
> | NOTE: ------------------------------------------------------------
> ----------
> | NOTE: Traceback (most recent call last):
> |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line
> 32, in wrapped_f
> |     return func(*args, **kwargs)
> |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line
> 32, in wrapped_f
> |     return func(*args, **kwargs)
> |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line
> 32, in wrapped_f
> |     return func(*args, **kwargs)
> |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-deb-non-deb/build/meta/lib/oeqa/runtime/cases/ptest.py", line 93,
> in test_ptestrunner
> |     self.assertFalse(failed_tests, msg = "Failed ptests: %s"
> %(str(failed_tests)))
> | AssertionError: {'dbus-test': [' test/test-bus', '
> test/test-dbus-daemon', ' test/test-names']} is not false : Failed ptests:
> {'dbus-test': [' test/test-bus', ' test/test-dbus-daemon', '
> test/test-names']}
>
>
> Best Regards,
> Maxin
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 5553 bytes --]

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

* Re: [PATCH] dbus-test_1.12.2: various fixes
  2018-02-28 14:54 ` Maxin B. John
  2018-02-28 17:34   ` Burton, Ross
@ 2018-02-28 17:48   ` Bystricky, Juro
  1 sibling, 0 replies; 6+ messages in thread
From: Bystricky, Juro @ 2018-02-28 17:48 UTC (permalink / raw)
  To: John, Maxin; +Cc: jurobystricky, openembedded-core

Yes, that is the root cause. I did file a bug a while ago:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12273

It is a race, I put the libraries in a hidden file, hoping they would not be found.
I also considered linking the tests statically (which would eliminate the need for the shared libraries), 
but the size was getting too big...

Juro
________________________________________
From: John, Maxin
Sent: Wednesday, February 28, 2018 6:54 AM
To: Bystricky, Juro
Cc: openembedded-core@lists.openembedded.org; jurobystricky@hotmail.com
Subject: Re: [OE-core] [PATCH] dbus-test_1.12.2: various fixes

Hi,

On Tue, Feb 27, 2018 at 12:19:26PM -0800, Juro Bystricky wrote:
> The result of running dbus-test-ptest was a series of
> various segfaults, interpreted as FAILs. This was a direct consequence
> of the test suite loading the installed shared library libdbus-1.so, not the
> one built along the test suite.
>
> While we normally want to test against the installed libraries, we cannot
> do this in this case as the test suite expects a library that is configured/compiled
> differently from the installed one. We could configure the installed library
> identically as the test suite expects, (and there should be no issues), however
> this is not desirable for performance reasons.
>
> Hence we need to use the library built along with the test suite.
> Of course, running the test suite against its own library does not
> test the installed library, however they are both built from the same
> sources so that can give us some kind of indication.
>
> The following changes were made:
>
> 1. Configure the test library as close as possible to the installed one,
>    with some additional configuration options that are needed for testing.
>    (Use dbus_1.12.2.bb recipe as a template)
> 2. Include the shared libraries in the package, use LD_LIBRARY_PATH during
>    testing to load them instead of the installed ones.
> 3. Add a few more tests. (There are still some additional tests built that
>    are not used, but they would have to be special-cased).
> 4. When evaluating the test results, differentiate between "FAIL" and "SKIP"
>
> [YOCTO #10841]
> [YOCTO #12277]
>
> Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
> ---
>  meta/recipes-core/dbus/dbus-test_1.12.2.bb | 30 ++++++++++++++++++++++++++----
>  meta/recipes-core/dbus/dbus/run-ptest      | 20 +++++++++++++++++---
>  2 files changed, 43 insertions(+), 7 deletions(-)

Probably due to this change, dbus ptest related sanity tests fails here:

https://autobuilder.yocto.io/builders/nightly-deb-non-deb/builds/813/steps/Running%20Sanity%20Tests/logs/stdio


NOTE:  ... ok
| NOTE: ======================================================================
| NOTE: FAIL: test_ptestrunner (ptest.PtestRunnerTest)
| NOTE: ----------------------------------------------------------------------
| NOTE: Traceback (most recent call last):
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb-non-deb/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-deb-non-deb/build/meta/lib/oeqa/runtime/cases/ptest.py", line 93, in test_ptestrunner
|     self.assertFalse(failed_tests, msg = "Failed ptests: %s" %(str(failed_tests)))
| AssertionError: {'dbus-test': [' test/test-bus', ' test/test-dbus-daemon', ' test/test-names']} is not false : Failed ptests: {'dbus-test': [' test/test-bus', ' test/test-dbus-daemon', ' test/test-names']}


Best Regards,
Maxin


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

* [PATCH] dbus-test_1.12.2: various fixes
@ 2018-03-01 16:24 Ross Burton
  0 siblings, 0 replies; 6+ messages in thread
From: Ross Burton @ 2018-03-01 16:24 UTC (permalink / raw)
  To: openembedded-core

From: Juro Bystricky <juro.bystricky@intel.com>

The result of running dbus-test-ptest was a series of
various segfaults, interpreted as FAILs. This was a direct consequence
of the test suite loading the installed shared library libdbus-1.so, not the
one built along the test suite.

While we normally want to test against the installed libraries, we cannot
do this in this case as the test suite expects a library that is configured/compiled
differently from the installed one. We could configure the installed library
identically as the test suite expects, (and there should be no issues), however
this is not desirable for performance reasons.

Hence we need to use the library built along with the test suite.
Of course, running the test suite against its own library does not
test the installed library, however they are both built from the same
sources so that can give us some kind of indication.

The following changes were made:

1. Configure the test library as close as possible to the installed one,
   with some additional configuration options that are needed for testing.
   (Use dbus_1.12.2.bb recipe as a template)
2. Include the shared libraries in the package, use LD_LIBRARY_PATH during
   testing to load them instead of the installed ones.
3. Add a few more tests. (There are still some additional tests built that
   are not used, but they would have to be special-cased).
4. When evaluating the test results, differentiate between "FAIL" and "SKIP"

[YOCTO #10841]
[YOCTO #12277]

(From OE-Core rev: 5d148aa9c3c338fabab1e60e2ca64d09c9b8477f)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-core/dbus/dbus-test_1.12.2.bb | 32 ++++++++++++++++++++++++++----
 meta/recipes-core/dbus/dbus/run-ptest      | 20 ++++++++++++++++---
 2 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-core/dbus/dbus-test_1.12.2.bb b/meta/recipes-core/dbus/dbus-test_1.12.2.bb
index c3891a33701..26556ed2468 100644
--- a/meta/recipes-core/dbus/dbus-test_1.12.2.bb
+++ b/meta/recipes-core/dbus/dbus-test_1.12.2.bb
@@ -34,25 +34,49 @@ EXTRA_OECONF = "--enable-tests \
                 --enable-checks \
                 --enable-asserts \
                 --enable-verbose-mode \
+                --enable-largefile \
                 --disable-xml-docs \
                 --disable-doxygen-docs \
                 --disable-libaudit \
-                --disable-systemd \
-                --without-systemdsystemunitdir \
                 --with-dbus-test-dir=${PTEST_PATH} \
                 ${EXTRA_OECONF_X}"
 
+EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
+PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
+PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
+
 do_install() {
     :
 }
 
 do_install_ptest() {
 	install -d ${D}${PTEST_PATH}/test
-	l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay"
+	l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay \
+	   variant uid-permissions syntax spawn sd-activation names monitor message fdpass "
 	for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
+
 	l="bus bus-system bus-launch-helper"
 	for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
-	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
+
 	cp -r ${B}/test/data ${D}${PTEST_PATH}/test
+	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
+
+	install -d ${D}${PTEST_PATH}/test/.libs
+	cp -a ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
+
+	# Remove build host references...
+	find "${D}${PTEST_PATH}/test/data" \( -name *.service -o -name *.conf \) -type f -exec \
+		sed -i \
+		 -e 's:${B}:${PTEST_PATH}:g' \
+		 {} +
 }
+
 RDEPENDS_${PN}-ptest += "bash"
+
+PRIVATE_LIBS_${PN}-ptest = "libdbus-1.so.3"
diff --git a/meta/recipes-core/dbus/dbus/run-ptest b/meta/recipes-core/dbus/dbus/run-ptest
index c72d083a917..8a8970ee208 100755
--- a/meta/recipes-core/dbus/dbus/run-ptest
+++ b/meta/recipes-core/dbus/dbus/run-ptest
@@ -1,10 +1,24 @@
 #!/bin/sh
 
 output() {
-  if [ $? -eq 0 ]
+  retcode=$?
+  if [ $retcode -eq 0 ]
     then echo "PASS: $i"
-    else echo "FAIL: $i"
+  elif [ $retcode -eq 77 ]
+    then echo "SKIP: $i"
+  else echo "FAIL: $i"
   fi
 }
 
-for i in `ls test/test-*`; do ./$i ./test/data DBUS_TEST_HOMEDIR=./test >/dev/null; output; done
+export DBUS_TEST_HOMEDIR=./test
+export XDG_RUNTIME_DIR=./test
+export LD_LIBRARY_PATH=/usr/lib/dbus-test/ptest/test/.libs
+
+files=`ls test/test-*`
+
+for i in $files
+	do
+		./$i ./test/data >/dev/null
+		output
+	done
+
-- 
2.11.0



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

end of thread, other threads:[~2018-03-01 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27 20:19 [PATCH] dbus-test_1.12.2: various fixes Juro Bystricky
2018-02-28  3:46 ` Khem Raj
2018-02-28 14:54 ` Maxin B. John
2018-02-28 17:34   ` Burton, Ross
2018-02-28 17:48   ` Bystricky, Juro
2018-03-01 16:24 Ross Burton

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.