Skip to contentSkip to conversation

mariadb: Add ptest support

PATCH In review Chi Xu 2 participants 5 messages Sep 14, 2023 – Sep 15, 2023

lore
Share & tools
lore

Chi Xu

author
#0 lore raw

PATCH v2 1/1 mariadb: Add ptest support

70 test cases in all, and all of them are PASS.
There are some specific steps before doing test,
please refer to the comments in run-ptest.

Test results:

root@intel-x86-64:~# ptest-runner mariadb
START: ptest-runner
2023-09-14T15:17
BEGIN: /usr/lib64/mariadb/ptest
PASS: strings
PASS: json
PASS: simple
PASS: skip
PASS: todo
PASS: skip_all
PASS: no_plan
PASS: bitmap
PASS: base64
PASS: my_atomic
PASS: my_rdtsc
PASS: lf
PASS: my_malloc
PASS: my_getopt
PASS: dynstring
PASS: byte_order
PASS: queues
PASS: stacktrace
PASS: crc32
PASS: my_vsnprintf
PASS: aes
PASS: ma_dyncol
PASS: my_decimal
PASS: json_lib
PASS: json_normalize
PASS: my_apc
PASS: explain_filename
PASS: mf_iocache
PASS: my_json_writer
PASS: innodb_fts
PASS: innodb_sync
PASS: ma_control_file
PASS: trnman
PASS: ma_test_loghandler
PASS: ma_test_loghandler_multigroup
PASS: ma_test_loghandler_multithread
PASS: ma_test_loghandler_pagecache
PASS: ma_test_loghandler_long
PASS: ma_test_loghandler_noflush
PASS: ma_test_loghandler_first_lsn
PASS: ma_test_loghandler_max_lsn
PASS: ma_test_loghandler_purge
PASS: ma_test_loghandler_readonly
PASS: ma_test_loghandler_nologs
PASS: ma_pagecache_single_1k
PASS: ma_pagecache_single_8k
PASS: ma_pagecache_single_64k
PASS: ma_pagecache_consist_1k
PASS: ma_pagecache_consist_64k
PASS: ma_pagecache_consist_1kHC
PASS: ma_pagecache_consist_64kHC
PASS: ma_pagecache_consist_1kRD
PASS: ma_pagecache_consist_64kRD
PASS: ma_pagecache_consist_1kWR
PASS: ma_pagecache_consist_64kWR
PASS: ma_pagecache_rwconsist_1k
PASS: ma_pagecache_rwconsist2_1k
PASS: pfs_instr_class
PASS: pfs_instr_class-oom
PASS: pfs_instr
PASS: pfs_instr-oom
PASS: pfs_account-oom
PASS: pfs_host-oom
PASS: pfs_timer
PASS: pfs_user-oom
PASS: pfs_noop
PASS: pfs
PASS: pfs_misc
PASS: dbug
PASS: test-connect
DURATION: 60
END: /usr/lib64/mariadb/ptest
2023-09-14T15:18
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../include/ptest-packagelists-meta-oe.inc    |  1 +
 meta-oe/recipes-dbs/mysql/mariadb/run-ptest   | 19 ++++++++++++
 meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb  | 31 +++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/run-ptest
meta-oe/conf/include/ptest-packagelists-meta-oe.inc +1 -0
index 06f3e16054..cafc43e011 100644
@@ -49,6 +49,7 @@ PTESTS_SLOW_META_OE = "\
     fftw \
     libusb-compat \
     rsyslog \
+    mariadb \
 "
 
 PTESTS_PROBLEMS_META_OE ="\
meta-oe/recipes-dbs/mysql/mariadb/run-ptest new file +19 -0
new file mode 100644
index 0000000000..57201035d4
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Becasue test case test-connect, please do following steps before testing.
+# Without these steps, test case test-connect will fail.
+# 1. Disable 'skip-networking' in /etc/my.cnf
+#    $ sed -i '/skip-networking/s/^/#/g' /etc/my.cnf
+# 2. Restart mysqld.service
+#    $ systemctl restart mysqld
+# 3. Set password for MySQL user "root"
+#    $ mysql -u root
+#    MariaDB [(none)]> SET PASSWORD FOR 'root'@localhost = PASSWORD("myReallyStrongPwd");
+#    MariaDB [(none)]> FLUSH PRIVILEGES;
+
+export MASTER_MYPORT=3306
+export MYSQL_TEST_HOST=127.0.0.1
+export MYSQL_TEST_USER=root
+export MYSQL_TEST_PASSWD=myReallyStrongPwd
+
+ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +31 -0
index 87faabfa27..2ef4e89064 100644
@@ -1,5 +1,36 @@
 require mariadb.inc
 
+inherit ptest
+SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"
+DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native', '', d)}"
+RDEPENDS:${PN}-ptest += "cmake"
+
+do_install_ptest () {
+    rsync -a ${B}/unittest ${B}/dbug ${D}${PTEST_PATH} \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    install -m 0755 -d ${D}${PTEST_PATH}/storage
+    rsync -a ${B}/storage/maria ${B}/storage/perfschema ${B}/storage/innobase ${D}${PTEST_PATH}/storage \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    cp -r ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}
+    sed -i -e 's#${WORKDIR}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+}
+
 DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
             zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
 
Signature · 1 line
2.25.1
#1 lore raw

while running

bitbake meta-oe-ptest-image-mariadb -ctestimage

I am seeing

WARNING: meta-oe-ptest-image-mariadb-1.0-r0 do_testimage: There were failing ptests.
Traceback (most recent call last):
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/runtime/cases/ptest.py",
line 27, in test_ptestrunner_expectfail
self.do_ptestrunner()
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/runtime/cases/ptest.py",
line 120, in do_ptestrunner
self.fail(failmsg)
AssertionError:
ptests which had no test results:
['mariadb']

Cannot run ptests without @expectedFailure as ptests are expected to fail
WARNING: meta-oe-ptest-image-mariadb-1.0-r0 do_testimage: Can not retrieve /var/log from test target

Quoted 184 lines · Chi Xu

70 test cases in all, and all of them are PASS.
There are some specific steps before doing test,
please refer to the comments in run-ptest.

Test results:

root@intel-x86-64:~# ptest-runner mariadb
START: ptest-runner
2023-09-14T15:17
BEGIN: /usr/lib64/mariadb/ptest
PASS: strings
PASS: json
PASS: simple
PASS: skip
PASS: todo
PASS: skip_all
PASS: no_plan
PASS: bitmap
PASS: base64
PASS: my_atomic
PASS: my_rdtsc
PASS: lf
PASS: my_malloc
PASS: my_getopt
PASS: dynstring
PASS: byte_order
PASS: queues
PASS: stacktrace
PASS: crc32
PASS: my_vsnprintf
PASS: aes
PASS: ma_dyncol
PASS: my_decimal
PASS: json_lib
PASS: json_normalize
PASS: my_apc
PASS: explain_filename
PASS: mf_iocache
PASS: my_json_writer
PASS: innodb_fts
PASS: innodb_sync
PASS: ma_control_file
PASS: trnman
PASS: ma_test_loghandler
PASS: ma_test_loghandler_multigroup
PASS: ma_test_loghandler_multithread
PASS: ma_test_loghandler_pagecache
PASS: ma_test_loghandler_long
PASS: ma_test_loghandler_noflush
PASS: ma_test_loghandler_first_lsn
PASS: ma_test_loghandler_max_lsn
PASS: ma_test_loghandler_purge
PASS: ma_test_loghandler_readonly
PASS: ma_test_loghandler_nologs
PASS: ma_pagecache_single_1k
PASS: ma_pagecache_single_8k
PASS: ma_pagecache_single_64k
PASS: ma_pagecache_consist_1k
PASS: ma_pagecache_consist_64k
PASS: ma_pagecache_consist_1kHC
PASS: ma_pagecache_consist_64kHC
PASS: ma_pagecache_consist_1kRD
PASS: ma_pagecache_consist_64kRD
PASS: ma_pagecache_consist_1kWR
PASS: ma_pagecache_consist_64kWR
PASS: ma_pagecache_rwconsist_1k
PASS: ma_pagecache_rwconsist2_1k
PASS: pfs_instr_class
PASS: pfs_instr_class-oom
PASS: pfs_instr
PASS: pfs_instr-oom
PASS: pfs_account-oom
PASS: pfs_host-oom
PASS: pfs_timer
PASS: pfs_user-oom
PASS: pfs_noop
PASS: pfs
PASS: pfs_misc
PASS: dbug
PASS: test-connect
DURATION: 60
END: /usr/lib64/mariadb/ptest
2023-09-14T15:18
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../include/ptest-packagelists-meta-oe.inc    |  1 +
 meta-oe/recipes-dbs/mysql/mariadb/run-ptest   | 19 ++++++++++++
 meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb  | 31 +++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/run-ptest
meta-oe/conf/include/ptest-packagelists-meta-oe.inc +1 -0
index 06f3e16054..cafc43e011 100644
@@ -49,6 +49,7 @@ PTESTS_SLOW_META_OE = "\
     fftw \
     libusb-compat \
     rsyslog \
+    mariadb \
 "
 
 PTESTS_PROBLEMS_META_OE ="\
meta-oe/recipes-dbs/mysql/mariadb/run-ptest new file +19 -0
new file mode 100644
index 0000000000..57201035d4
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Becasue test case test-connect, please do following steps before testing.
+# Without these steps, test case test-connect will fail.
+# 1. Disable 'skip-networking' in /etc/my.cnf
+#    $ sed -i '/skip-networking/s/^/#/g' /etc/my.cnf
+# 2. Restart mysqld.service
+#    $ systemctl restart mysqld
+# 3. Set password for MySQL user "root"
+#    $ mysql -u root
+#    MariaDB [(none)]> SET PASSWORD FOR 'root'@localhost = PASSWORD("myReallyStrongPwd");
+#    MariaDB [(none)]> FLUSH PRIVILEGES;
+
+export MASTER_MYPORT=3306
+export MYSQL_TEST_HOST=127.0.0.1
+export MYSQL_TEST_USER=root
+export MYSQL_TEST_PASSWD=myReallyStrongPwd
+
+ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +31 -1
index 87faabfa27..2ef4e89064 100644
@@ -1,5 +1,36 @@
 require mariadb.inc
 
+inherit ptest
+SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"
+DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native', '', d)}"
+RDEPENDS:${PN}-ptest += "cmake"
+
+do_install_ptest () {
+    rsync -a ${B}/unittest ${B}/dbug ${D}${PTEST_PATH} \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    install -m 0755 -d ${D}${PTEST_PATH}/storage
+    rsync -a ${B}/storage/maria ${B}/storage/perfschema ${B}/storage/innobase ${D}${PTEST_PATH}/storage \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    cp -r ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}
+    sed -i -e 's#${WORKDIR}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+}
+
 DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
             zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
 
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#104863): https://lists.openembedded.org/g/openembedded-devel/message/104863
Mute This Topic: https://lists.openembedded.org/mt/101352157/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

When running manually, I see this

root@qemux86-64:/usr/lib/mariadb/ptest# ./run-ptest
sed: unrecognized option: u
BusyBox v1.36.1 () multi-call binary.

Usage: sed [-i[SFX]] [-nrE] [-f FILE]... [-e CMD]... [FILE]...
or: sed [-i[SFX]] [-nrE] CMD [FILE]...

So I guess it needs a full sed command. Add

RDEPENDS:${PN}-ptest += "cmake sed"

Quoted 221 lines · Khem Raj

while running

bitbake meta-oe-ptest-image-mariadb -ctestimage

I am seeing

WARNING: meta-oe-ptest-image-mariadb-1.0-r0 do_testimage: There were failing ptests.
Traceback (most recent call last):
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/runtime/cases/ptest.py",
line 27, in test_ptestrunner_expectfail
self.do_ptestrunner()
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/runtime/cases/ptest.py",
line 120, in do_ptestrunner
self.fail(failmsg)
AssertionError:
ptests which had no test results:
['mariadb']

Cannot run ptests without @expectedFailure as ptests are expected to fail
WARNING: meta-oe-ptest-image-mariadb-1.0-r0 do_testimage: Can not retrieve /var/log from test target

Quoted 184 lines · Chi Xu

70 test cases in all, and all of them are PASS.
There are some specific steps before doing test,
please refer to the comments in run-ptest.

Test results:

root@intel-x86-64:~# ptest-runner mariadb
START: ptest-runner
2023-09-14T15:17
BEGIN: /usr/lib64/mariadb/ptest
PASS: strings
PASS: json
PASS: simple
PASS: skip
PASS: todo
PASS: skip_all
PASS: no_plan
PASS: bitmap
PASS: base64
PASS: my_atomic
PASS: my_rdtsc
PASS: lf
PASS: my_malloc
PASS: my_getopt
PASS: dynstring
PASS: byte_order
PASS: queues
PASS: stacktrace
PASS: crc32
PASS: my_vsnprintf
PASS: aes
PASS: ma_dyncol
PASS: my_decimal
PASS: json_lib
PASS: json_normalize
PASS: my_apc
PASS: explain_filename
PASS: mf_iocache
PASS: my_json_writer
PASS: innodb_fts
PASS: innodb_sync
PASS: ma_control_file
PASS: trnman
PASS: ma_test_loghandler
PASS: ma_test_loghandler_multigroup
PASS: ma_test_loghandler_multithread
PASS: ma_test_loghandler_pagecache
PASS: ma_test_loghandler_long
PASS: ma_test_loghandler_noflush
PASS: ma_test_loghandler_first_lsn
PASS: ma_test_loghandler_max_lsn
PASS: ma_test_loghandler_purge
PASS: ma_test_loghandler_readonly
PASS: ma_test_loghandler_nologs
PASS: ma_pagecache_single_1k
PASS: ma_pagecache_single_8k
PASS: ma_pagecache_single_64k
PASS: ma_pagecache_consist_1k
PASS: ma_pagecache_consist_64k
PASS: ma_pagecache_consist_1kHC
PASS: ma_pagecache_consist_64kHC
PASS: ma_pagecache_consist_1kRD
PASS: ma_pagecache_consist_64kRD
PASS: ma_pagecache_consist_1kWR
PASS: ma_pagecache_consist_64kWR
PASS: ma_pagecache_rwconsist_1k
PASS: ma_pagecache_rwconsist2_1k
PASS: pfs_instr_class
PASS: pfs_instr_class-oom
PASS: pfs_instr
PASS: pfs_instr-oom
PASS: pfs_account-oom
PASS: pfs_host-oom
PASS: pfs_timer
PASS: pfs_user-oom
PASS: pfs_noop
PASS: pfs
PASS: pfs_misc
PASS: dbug
PASS: test-connect
DURATION: 60
END: /usr/lib64/mariadb/ptest
2023-09-14T15:18
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../include/ptest-packagelists-meta-oe.inc    |  1 +
 meta-oe/recipes-dbs/mysql/mariadb/run-ptest   | 19 ++++++++++++
 meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb  | 31 +++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/run-ptest
meta-oe/conf/include/ptest-packagelists-meta-oe.inc +1 -0
index 06f3e16054..cafc43e011 100644
@@ -49,6 +49,7 @@ PTESTS_SLOW_META_OE = "\
     fftw \
     libusb-compat \
     rsyslog \
+    mariadb \
 "
 
 PTESTS_PROBLEMS_META_OE ="\
meta-oe/recipes-dbs/mysql/mariadb/run-ptest new file +19 -0
new file mode 100644
index 0000000000..57201035d4
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Becasue test case test-connect, please do following steps before testing.
+# Without these steps, test case test-connect will fail.
+# 1. Disable 'skip-networking' in /etc/my.cnf
+#    $ sed -i '/skip-networking/s/^/#/g' /etc/my.cnf
+# 2. Restart mysqld.service
+#    $ systemctl restart mysqld
+# 3. Set password for MySQL user "root"
+#    $ mysql -u root
+#    MariaDB [(none)]> SET PASSWORD FOR 'root'@localhost = PASSWORD("myReallyStrongPwd");
+#    MariaDB [(none)]> FLUSH PRIVILEGES;
+
+export MASTER_MYPORT=3306
+export MYSQL_TEST_HOST=127.0.0.1
+export MYSQL_TEST_USER=root
+export MYSQL_TEST_PASSWD=myReallyStrongPwd
+
+ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +31 -1
index 87faabfa27..2ef4e89064 100644
@@ -1,5 +1,36 @@
 require mariadb.inc
 
+inherit ptest
+SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"
+DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native', '', d)}"
+RDEPENDS:${PN}-ptest += "cmake"
+
+do_install_ptest () {
+    rsync -a ${B}/unittest ${B}/dbug ${D}${PTEST_PATH} \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    install -m 0755 -d ${D}${PTEST_PATH}/storage
+    rsync -a ${B}/storage/maria ${B}/storage/perfschema ${B}/storage/innobase ${D}${PTEST_PATH}/storage \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    cp -r ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}
+    sed -i -e 's#${WORKDIR}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+}
+
 DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
             zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
 
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#104863): https://lists.openembedded.org/g/openembedded-devel/message/104863
Mute This Topic: https://lists.openembedded.org/mt/101352157/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

it also needs perl-module-test-more rdep for

FAIL: dbug

tests to pass.

There still remains one failure on musl

70/70 Testing: test-connect
70/70 Test: test-connect
Command: "/usr/lib/mariadb/ptest/unittest/embedded/test-connect-t"
Directory: /usr/lib/mariadb/ptest/unittest/embedded "test-connect" start time: Sep 14 17:44 UTC
Output:
----------------------------------------------------------
mysql_real_connect failed: Can't connect to server on '127.0.0.1' (111 "Connection refused")
<end of output>
Test time = 0.03 sec
----------------------------------------------------------
Test Failed.
"test-connect" end time: Sep 14 17:44 UTC
"test-connect" time elapsed: 00:00:00
----------------------------------------------------------

Quoted 236 lines · Khem Raj

When running manually, I see this

root@qemux86-64:/usr/lib/mariadb/ptest# ./run-ptest
sed: unrecognized option: u
BusyBox v1.36.1 () multi-call binary.

Usage: sed [-i[SFX]] [-nrE] [-f FILE]... [-e CMD]... [FILE]...
or: sed [-i[SFX]] [-nrE] CMD [FILE]...

So I guess it needs a full sed command. Add

RDEPENDS:${PN}-ptest += "cmake sed"

Quoted 221 lines · Khem Raj

while running

bitbake meta-oe-ptest-image-mariadb -ctestimage

I am seeing

WARNING: meta-oe-ptest-image-mariadb-1.0-r0 do_testimage: There were failing ptests.
Traceback (most recent call last):
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init__.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/runtime/cases/ptest.py",
line 27, in test_ptestrunner_expectfail
self.do_ptestrunner()
File "/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/runtime/cases/ptest.py",
line 120, in do_ptestrunner
self.fail(failmsg)
AssertionError:
ptests which had no test results:
['mariadb']

Cannot run ptests without @expectedFailure as ptests are expected to fail
WARNING: meta-oe-ptest-image-mariadb-1.0-r0 do_testimage: Can not retrieve /var/log from test target

Quoted 184 lines · Chi Xu

70 test cases in all, and all of them are PASS.
There are some specific steps before doing test,
please refer to the comments in run-ptest.

Test results:

root@intel-x86-64:~# ptest-runner mariadb
START: ptest-runner
2023-09-14T15:17
BEGIN: /usr/lib64/mariadb/ptest
PASS: strings
PASS: json
PASS: simple
PASS: skip
PASS: todo
PASS: skip_all
PASS: no_plan
PASS: bitmap
PASS: base64
PASS: my_atomic
PASS: my_rdtsc
PASS: lf
PASS: my_malloc
PASS: my_getopt
PASS: dynstring
PASS: byte_order
PASS: queues
PASS: stacktrace
PASS: crc32
PASS: my_vsnprintf
PASS: aes
PASS: ma_dyncol
PASS: my_decimal
PASS: json_lib
PASS: json_normalize
PASS: my_apc
PASS: explain_filename
PASS: mf_iocache
PASS: my_json_writer
PASS: innodb_fts
PASS: innodb_sync
PASS: ma_control_file
PASS: trnman
PASS: ma_test_loghandler
PASS: ma_test_loghandler_multigroup
PASS: ma_test_loghandler_multithread
PASS: ma_test_loghandler_pagecache
PASS: ma_test_loghandler_long
PASS: ma_test_loghandler_noflush
PASS: ma_test_loghandler_first_lsn
PASS: ma_test_loghandler_max_lsn
PASS: ma_test_loghandler_purge
PASS: ma_test_loghandler_readonly
PASS: ma_test_loghandler_nologs
PASS: ma_pagecache_single_1k
PASS: ma_pagecache_single_8k
PASS: ma_pagecache_single_64k
PASS: ma_pagecache_consist_1k
PASS: ma_pagecache_consist_64k
PASS: ma_pagecache_consist_1kHC
PASS: ma_pagecache_consist_64kHC
PASS: ma_pagecache_consist_1kRD
PASS: ma_pagecache_consist_64kRD
PASS: ma_pagecache_consist_1kWR
PASS: ma_pagecache_consist_64kWR
PASS: ma_pagecache_rwconsist_1k
PASS: ma_pagecache_rwconsist2_1k
PASS: pfs_instr_class
PASS: pfs_instr_class-oom
PASS: pfs_instr
PASS: pfs_instr-oom
PASS: pfs_account-oom
PASS: pfs_host-oom
PASS: pfs_timer
PASS: pfs_user-oom
PASS: pfs_noop
PASS: pfs
PASS: pfs_misc
PASS: dbug
PASS: test-connect
DURATION: 60
END: /usr/lib64/mariadb/ptest
2023-09-14T15:18
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../include/ptest-packagelists-meta-oe.inc    |  1 +
 meta-oe/recipes-dbs/mysql/mariadb/run-ptest   | 19 ++++++++++++
 meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb  | 31 +++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/run-ptest
meta-oe/conf/include/ptest-packagelists-meta-oe.inc +1 -0
index 06f3e16054..cafc43e011 100644
@@ -49,6 +49,7 @@ PTESTS_SLOW_META_OE = "\
     fftw \
     libusb-compat \
     rsyslog \
+    mariadb \
 "
 
 PTESTS_PROBLEMS_META_OE ="\
meta-oe/recipes-dbs/mysql/mariadb/run-ptest new file +19 -0
new file mode 100644
index 0000000000..57201035d4
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Becasue test case test-connect, please do following steps before testing.
+# Without these steps, test case test-connect will fail.
+# 1. Disable 'skip-networking' in /etc/my.cnf
+#    $ sed -i '/skip-networking/s/^/#/g' /etc/my.cnf
+# 2. Restart mysqld.service
+#    $ systemctl restart mysqld
+# 3. Set password for MySQL user "root"
+#    $ mysql -u root
+#    MariaDB [(none)]> SET PASSWORD FOR 'root'@localhost = PASSWORD("myReallyStrongPwd");
+#    MariaDB [(none)]> FLUSH PRIVILEGES;
+
+export MASTER_MYPORT=3306
+export MYSQL_TEST_HOST=127.0.0.1
+export MYSQL_TEST_USER=root
+export MYSQL_TEST_PASSWD=myReallyStrongPwd
+
+ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +31 -1
index 87faabfa27..2ef4e89064 100644
@@ -1,5 +1,36 @@
 require mariadb.inc
 
+inherit ptest
+SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"
+DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native', '', d)}"
+RDEPENDS:${PN}-ptest += "cmake"
+
+do_install_ptest () {
+    rsync -a ${B}/unittest ${B}/dbug ${D}${PTEST_PATH} \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    install -m 0755 -d ${D}${PTEST_PATH}/storage
+    rsync -a ${B}/storage/maria ${B}/storage/perfschema ${B}/storage/innobase ${D}${PTEST_PATH}/storage \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    cp -r ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}
+    sed -i -e 's#${WORKDIR}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+}
+
 DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
             zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
 
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#104863): https://lists.openembedded.org/g/openembedded-devel/message/104863
Mute This Topic: https://lists.openembedded.org/mt/101352157/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#4 lore raw

Thanks for your reminder, I didn't realize that we use busybox in ptest image, I will add 'sed' and 'perl-module-test-more ' to RDEPENDS.

For test case "test-connect", we should do following steps before running it.
Because these steps are relate with the configuration of mariadb, I didn't execute them in script 'run-ptest', just add them as comments in this script.
--------------------------------
# 1. Disable 'skip-networking' in /etc/my.cnf
# $ sed -i '/skip-networking/s/^/#/g' /etc/my.cnf
# 2. Restart mysqld.service
# $ systemctl restart mysqld
# 3. Set password for MySQL user "root"

#    $ mysql -u root
#    MariaDB [(none)]> SET PASSWORD FOR 'root'@localhost = PASSWORD("myReallyStrongPwd");
#    MariaDB [(none)]> FLUSH PRIVILEGES;
#    MariaDB [(none)]> quit

--------------------------------

About the issue of 'bitbake meta-oe-ptest-image-mariadb -ctestimage', I have no idea yet and will do more investigation. Please let me know if you have any suggestions, thanks!

Quoted 300 lines

-----Original Message-----
From: Khem Raj <[email protected]>
Sent: Friday, September 15, 2023 1:46 AM
To: Xu, Chi <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH v2] mariadb: Add ptest support

CAUTION: This email comes from a non Wind River email account! Do not click links or open attachments unless you recognize the sender and know the content is safe.

it also needs perl-module-test-more rdep for

FAIL: dbug

tests to pass.

There still remains one failure on musl

70/70 Testing: test-connect
70/70 Test: test-connect
Command: "/usr/lib/mariadb/ptest/unittest/embedded/test-connect-t"
Directory: /usr/lib/mariadb/ptest/unittest/embedded "test-connect" start time: Sep 14 17:44 UTC
Output:
----------------------------------------------------------
mysql_real_connect failed: Can't connect to server on '127.0.0.1' (111 "Connection refused") <end of output>
Test time = 0.03 sec
----------------------------------------------------------
Test Failed.
"test-connect" end time: Sep 14 17:44 UTC "test-connect" time elapsed:
00:00:00
----------------------------------------------------------

Quoted 7 lines · Khem Raj

When running manually, I see this

root@qemux86-64:/usr/lib/mariadb/ptest# ./run-ptest
sed: unrecognized option: u
BusyBox v1.36.1 () multi-call binary.
Quoted 16 lines

Usage: sed [-i[SFX]] [-nrE] [-f FILE]... [-e CMD]... [FILE]...
or: sed [-i[SFX]] [-nrE] CMD [FILE]...

So I guess it needs a full sed command. Add

RDEPENDS:${PN}-ptest += "cmake sed"

Quoted 8 lines · Khem Raj

while running

bitbake meta-oe-ptest-image-mariadb -ctestimage

I am seeing

WARNING: meta-oe-ptest-image-mariadb-1.0-r0 do_testimage: There

were

Quoted 39 lines
Quoted 39 lines

failing ptests.
Traceback (most recent call last):
File
"/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init_ _.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File
"/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init_ _.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File
"/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/core/decorator/__init_ _.py",
line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File
"/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/runtime/cases/ptest.py ", line 27, in test_ptestrunner_expectfail
self.do_ptestrunner()
File
"/mnt/b/yoe/master/sources/poky/meta/lib/oeqa/runtime/cases/ptest.py ",
line 120, in do_ptestrunner
self.fail(failmsg)
AssertionError:
ptests which had no test results:
['mariadb']

Cannot run ptests without @expectedFailure as ptests are expected to fail
WARNING: meta-oe-ptest-image-mariadb-1.0-r0 do_testimage: Can not retrieve /var/log from test target

On Wed, Sep 13, 2023 at 8:42 PM Chi Xu <[email protected]>

Quoted 107 lines · wrote:
Quoted 107 lines
Quoted 107 lines

70 test cases in all, and all of them are PASS.
There are some specific steps before doing test, please refer to the comments in run-ptest.

Test results:

root@intel-x86-64:~# ptest-runner mariadb
START: ptest-runner
2023-09-14T15:17
BEGIN: /usr/lib64/mariadb/ptest
PASS: strings
PASS: json
PASS: simple
PASS: skip
PASS: todo
PASS: skip_all
PASS: no_plan
PASS: bitmap
PASS: base64
PASS: my_atomic
PASS: my_rdtsc
PASS: lf
PASS: my_malloc
PASS: my_getopt
PASS: dynstring
PASS: byte_order
PASS: queues
PASS: stacktrace
PASS: crc32
PASS: my_vsnprintf
PASS: aes
PASS: ma_dyncol
PASS: my_decimal
PASS: json_lib
PASS: json_normalize
PASS: my_apc
PASS: explain_filename
PASS: mf_iocache
PASS: my_json_writer
PASS: innodb_fts
PASS: innodb_sync
PASS: ma_control_file
PASS: trnman
PASS: ma_test_loghandler
PASS: ma_test_loghandler_multigroup
PASS: ma_test_loghandler_multithread
PASS: ma_test_loghandler_pagecache
PASS: ma_test_loghandler_long
PASS: ma_test_loghandler_noflush
PASS: ma_test_loghandler_first_lsn
PASS: ma_test_loghandler_max_lsn
PASS: ma_test_loghandler_purge
PASS: ma_test_loghandler_readonly
PASS: ma_test_loghandler_nologs
PASS: ma_pagecache_single_1k
PASS: ma_pagecache_single_8k
PASS: ma_pagecache_single_64k
PASS: ma_pagecache_consist_1k
PASS: ma_pagecache_consist_64k
PASS: ma_pagecache_consist_1kHC
PASS: ma_pagecache_consist_64kHC
PASS: ma_pagecache_consist_1kRD
PASS: ma_pagecache_consist_64kRD
PASS: ma_pagecache_consist_1kWR
PASS: ma_pagecache_consist_64kWR
PASS: ma_pagecache_rwconsist_1k
PASS: ma_pagecache_rwconsist2_1k
PASS: pfs_instr_class
PASS: pfs_instr_class-oom
PASS: pfs_instr
PASS: pfs_instr-oom
PASS: pfs_account-oom
PASS: pfs_host-oom
PASS: pfs_timer
PASS: pfs_user-oom
PASS: pfs_noop
PASS: pfs
PASS: pfs_misc
PASS: dbug
PASS: test-connect
DURATION: 60
END: /usr/lib64/mariadb/ptest
2023-09-14T15:18
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../include/ptest-packagelists-meta-oe.inc    |  1 +
 meta-oe/recipes-dbs/mysql/mariadb/run-ptest   | 19 ++++++++++++
 meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb  | 31
+++++++++++++++++++
 3 files changed, 51 insertions(+)  create mode 100644

meta-oe/recipes-dbs/mysql/mariadb/run-ptest

meta-oe/conf/include/ptest-packagelists-meta-oe.inc +1 -0
index 06f3e16054..cafc43e011 100644
@@ -49,6 +49,7 @@ PTESTS_SLOW_META_OE = "\
     fftw \
     libusb-compat \
     rsyslog \
+    mariadb \
 "
 
Quoted 11 lines
Quoted 11 lines

meta-oe/recipes-dbs/mysql/mariadb/run-ptest line 3

Quoted 11 lines
meta-oe/conf/include/ptest-packagelists-meta-oe.inc +0 -0
 PTESTS_PROBLEMS_META_OE ="\
meta-oe/recipes-dbs/mysql/mariadb/run-ptest new file +3 -0
new file mode 100644
index 0000000000..57201035d4
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Becasue test case test-connect, please do following steps before

testing.

Quoted 8 lines
Quoted 8 lines

meta-oe/recipes-dbs/mysql/mariadb/run-ptest

Quoted 8 lines
meta-oe/recipes-dbs/mysql/mariadb/run-ptest new file +8 -0
+# Without these steps, test case test-connect will fail.
+# 1. Disable 'skip-networking' in /etc/my.cnf
+#    $ sed -i '/skip-networking/s/^/#/g' /etc/my.cnf
+# 2. Restart mysqld.service
+#    $ systemctl restart mysqld
+# 3. Set password for MySQL user "root"
+#    $ mysql -u root
+#    MariaDB [(none)]> SET PASSWORD FOR 'root'@localhost =

PASSWORD("myReallyStrongPwd");

Quoted 8 lines
Quoted 8 lines

meta-oe/recipes-dbs/mysql/mariadb/run-ptest

Quoted 8 lines
meta-oe/recipes-dbs/mysql/mariadb/run-ptest new file +8 -0
+#    MariaDB [(none)]> FLUSH PRIVILEGES;
+
+export MASTER_MYPORT=3306
+export MYSQL_TEST_HOST=127.0.0.1
+export MYSQL_TEST_USER=root
+export MYSQL_TEST_PASSWD=myReallyStrongPwd
+
+ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test

+#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'

Quoted 10 lines
Quoted 10 lines

meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb line 4

Quoted 10 lines
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +2 -0
index 87faabfa27..2ef4e89064 100644
@@ -1,5 +1,36 @@
 require mariadb.inc
 
+inherit ptest
+SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-

ptest', '', d)}"

Quoted 1 line
Quoted 1 line

meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb line 5

Quoted 1 line
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +1 -0
+DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native',

'', d)}"

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +7 -0
+RDEPENDS:${PN}-ptest += "cmake"
+
+do_install_ptest () {
+    rsync -a ${B}/unittest ${B}/dbug ${D}${PTEST_PATH} \
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
Quoted 8 lines
Quoted 8 lines

meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb

Quoted 8 lines
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +8 -0
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    install -m 0755 -d ${D}${PTEST_PATH}/storage
+    rsync -a ${B}/storage/maria ${B}/storage/perfschema

${B}/storage/innobase ${D}${PTEST_PATH}/storage \

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb +13 -0
+          --exclude CMakeFiles \
+          --exclude cmake_install.cmake \
+          --exclude Makefile \
+          --exclude=*.a \
+          --exclude=*.h \
+          --exclude=*.o \
+          --exclude=*.so \
+          --exclude=*.d \
+          --exclude=*.txt
+    cp -r ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}
+    sed -i -e 's#${WORKDIR}##g' `find ${D}${PTEST_PATH} -name
+CTestTestfile.cmake` }
+
 DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
             zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

--
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#104863):
https://lists.openembedded.org/g/openembedded-

devel/message/104863

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Mute This Topic:
https://lists.openembedded.org/mt/101352157/1997914
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-devel/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-