Skip to contentSkip to conversation

dbus: fix ptest failure

PATCH Superseded [email protected] 2 participants 2 messages Nov 1, 2018 – Nov 2, 2018

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dbus: fix ptest failure

From: Changqing Li <[email protected]>

1. since one bug in run-ptest, testcase test-bus have never been actually run (althrough it's result is PASS) until oe-core commit 0828850 "dbus-test_1.12.2: various fixes" fixed it. After commit 0828850, test-bus can actually run, but failed, install test-service/test-shell-service/test-segfault/ dbus-daemon-launch-helper-test(need --enable-embedded-tests to generate it) to fix it, since test-bus need these binaries.

2. fix testcase test-dbus-daemon failed
we enable --enable-verbose-mode in recipe dbus-test, and don't enable it in recipe dbus. This will below test code get unexpect result of have_verbose and assert. remove --enable-verbose-mode of recipe dbus-test to fix it.

#ifdef DBUS_ENABLE_STATS
g_assert_true (have_stats);
#else
g_assert_false (have_stats);
#endif

---
 meta/recipes-core/dbus/dbus-test_1.12.10.bb | 11 ++++++++---
 meta/recipes-core/dbus/dbus/run-ptest       | 16 ++++++++++++----
 2 files changed, 20 insertions(+), 7 deletions(-)
meta/recipes-core/dbus/dbus-test_1.12.10.bb +8 -3
index 25b9395..ce54628 100644
@@ -33,13 +33,13 @@ EXTRA_OECONF = "--enable-tests \
                 --enable-installed-tests \
                 --enable-checks \
                 --enable-asserts \
-                --enable-verbose-mode \
                 --enable-largefile \
                 --disable-xml-docs \
                 --disable-doxygen-docs \
                 --disable-libaudit \
                 --with-dbus-test-dir=${PTEST_PATH} \
-                ${EXTRA_OECONF_X}"
+                ${EXTRA_OECONF_X} \
+                --enable-embedded-tests"
 
 EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
 
@@ -58,9 +58,14 @@ 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 \
-	   variant uid-permissions syntax spawn sd-activation names monitor message fdpass "
+	   variant uid-permissions syntax spawn sd-activation names monitor message fdpass service shell-service"
 	for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
 
+	install -d ${D}${PTEST_PATH}/bus
+	install ${B}/bus/.libs/dbus-daemon-launch-helper-test ${D}${PTEST_PATH}/bus
+
+	install ${B}/test/test-segfault ${D}${PTEST_PATH}/test
+
 	l="bus bus-system bus-launch-helper"
 	for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
 
meta/recipes-core/dbus/dbus/run-ptest +12 -4
index 353ba1e..e7e1c1e 100755
@@ -17,8 +17,16 @@ export LD_LIBRARY_PATH=@PTEST_PATH@/test/.libs
 files=`ls test/test-*`
 
 for i in $files
-	do
-		./$i ./test/data >/dev/null
-		output
-	done
+do
+     #these programs are used by testcase test-bus, don't run here
+     if [ $i = "test/test-service" ] \
+        || [ $i = "test/test-shell-service" ] \
+        || [ $i = "test/test-segfault" ]
+     then
+         continue
+     fi
+
+     ./$i ./test/data >/dev/null 2>&1
+     output
+done
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · On 11/1/18 2:16 AM, [email protected] wrote:

From: Changqing Li <[email protected]>

1. since one bug in run-ptest, testcase test-bus have never been actually run (althrough it's result is PASS) until oe-core commit 0828850 "dbus-test_1.12.2: various fixes" fixed it. After commit 0828850, test-bus can actually run, but failed,

Is the name really test-bus or is it test-dbus ?
Fix it below as well if this is a typo.

Quoted 3 lines

install test-service/test-shell-service/test-segfault/ dbus-daemon-launch-helper-test(need --enable-embedded-tests to generate it) to fix it, since test-bus need these binaries.

The grammar in that last sentence is a bit hard to parse. How about:

After commit 0828850 test-bus can actually run but it did not install:
test-service, test-shell-service, test-segfault, and dbus-daemon-launch-helper-test
Add the configure flag:
--enable-embedded-tests
to generate these binaries, then install them so that test-bus will now pass.

Quoted 6 lines

2. fix testcase test-dbus-daemon failed
we enable --enable-verbose-mode in recipe dbus-test, and don't enable it in recipe dbus. This will below test code get unexpect result of have_verbose and assert. remove --enable-verbose-mode of recipe dbus-test to fix it.

Could you add PACKAGECONFIG[developer-mode] to enable-verbose-mode ? That would be useful when debugging.

Quoted 20 lines
  #ifdef DBUS_ENABLE_STATS
   g_assert_true (have_stats);
  #else
   g_assert_false (have_stats);
  #endif
---
  meta/recipes-core/dbus/dbus-test_1.12.10.bb | 11 ++++++++---
  meta/recipes-core/dbus/dbus/run-ptest       | 16 ++++++++++++----
  2 files changed, 20 insertions(+), 7 deletions(-)
meta/recipes-core/dbus/dbus-test_1.12.10.bb +0 -0
index 25b9395..ce54628 100644
@@ -33,13 +33,13 @@ EXTRA_OECONF = "--enable-tests \
                  --enable-installed-tests \
                  --enable-checks \

meta/recipes-core/dbus/dbus-test_1.12.10.bb EXTRA_OECONF = "--enable-tests \ · line 42

Quoted 10 lines
meta/recipes-core/dbus/dbus-test_1.12.10.bb +2 -2
                  --enable-asserts \
-                --enable-verbose-mode \
                  --enable-largefile \
                  --disable-xml-docs \
                  --disable-doxygen-docs \
                  --disable-libaudit \
                  --with-dbus-test-dir=${PTEST_PATH} \
-                ${EXTRA_OECONF_X}"
+                ${EXTRA_OECONF_X} \
+                --enable-embedded-tests"

Build machines and scripts that parse this recipe won't care that you have stuck the option at the end of the list but I hear that humans like order and symmetry :) so please move it up to the end of the list of '--enable' options.

Thanks,
../Randy

Quoted 45 lines
meta/recipes-core/dbus/dbus-test_1.12.10.bb +6 -1
  EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
 
@@ -58,9 +58,14 @@ 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 \
-	   variant uid-permissions syntax spawn sd-activation names monitor message fdpass "
+	   variant uid-permissions syntax spawn sd-activation names monitor message fdpass service shell-service"
  	for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
 
+	install -d ${D}${PTEST_PATH}/bus
+	install ${B}/bus/.libs/dbus-daemon-launch-helper-test ${D}${PTEST_PATH}/bus
+
+	install ${B}/test/test-segfault ${D}${PTEST_PATH}/test
+
  	l="bus bus-system bus-launch-helper"
  	for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
 
meta/recipes-core/dbus/dbus/run-ptest +12 -4
index 353ba1e..e7e1c1e 100755
@@ -17,8 +17,16 @@ export LD_LIBRARY_PATH=@PTEST_PATH@/test/.libs
  files=`ls test/test-*`
 
  for i in $files
-	do
-		./$i ./test/data >/dev/null
-		output
-	done
+do
+     #these programs are used by testcase test-bus, don't run here
+     if [ $i = "test/test-service" ] \
+        || [ $i = "test/test-shell-service" ] \
+        || [ $i = "test/test-segfault" ]
+     then
+         continue
+     fi
+
+     ./$i ./test/data >/dev/null 2>&1
+     output
+done
 
Signature · 2 lines
# Randy MacLeod
# Wind River Linux