diff mbox series

[meta-oe] mariadb: Add ptest support

Message ID 20230914022151.3298392-1-chi.xu@windriver.com
State New
Headers show
Series [meta-oe] mariadb: Add ptest support | expand

Commit Message

Xu, Chi Sept. 14, 2023, 2:21 a.m. UTC
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

Signed-off-by: Chi Xu <chi.xu@windriver.com>
---
 meta-oe/recipes-dbs/mysql/mariadb/run-ptest  | 19 ++++++++++++
 meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb | 31 ++++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/run-ptest

Comments

Khem Raj Sept. 14, 2023, 3:18 a.m. UTC | #1
This is good. Can you also add it to ptest multconfig via PTESTS_SLOW_META_OE
in meta-oe/conf/include/ptest-packagelists-meta-oe.inc

On Wed, Sep 13, 2023 at 7:21 PM Chi Xu <chi.xu@eng.windriver.com> wrote:
>
> 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
>
> Signed-off-by: Chi Xu <chi.xu@windriver.com>
> ---
>  meta-oe/recipes-dbs/mysql/mariadb/run-ptest  | 19 ++++++++++++
>  meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb | 31 ++++++++++++++++++++
>  2 files changed, 50 insertions(+)
>  create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/run-ptest
>
> diff --git a/meta-oe/recipes-dbs/mysql/mariadb/run-ptest b/meta-oe/recipes-dbs/mysql/mariadb/run-ptest
> new file mode 100644
> index 0000000000..57201035d4
> --- /dev/null
> +++ b/meta-oe/recipes-dbs/mysql/mariadb/run-ptest
> @@ -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();}'
> diff --git a/meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb b/meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb
> index 87faabfa27..2ef4e89064 100644
> --- a/meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb
> +++ b/meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb
> @@ -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 (#104860): https://lists.openembedded.org/g/openembedded-devel/message/104860
> Mute This Topic: https://lists.openembedded.org/mt/101351338/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-dbs/mysql/mariadb/run-ptest b/meta-oe/recipes-dbs/mysql/mariadb/run-ptest
new file mode 100644
index 0000000000..57201035d4
--- /dev/null
+++ b/meta-oe/recipes-dbs/mysql/mariadb/run-ptest
@@ -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();}'
diff --git a/meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb b/meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb
index 87faabfa27..2ef4e89064 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb
+++ b/meta-oe/recipes-dbs/mysql/mariadb_10.11.5.bb
@@ -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"