All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest
@ 2021-11-09 15:28 Lukasz Majewski
  2021-11-10 17:12 ` Khem Raj
  2021-11-11 13:51 ` Khem Raj
  0 siblings, 2 replies; 8+ messages in thread
From: Lukasz Majewski @ 2021-11-09 15:28 UTC (permalink / raw)
  To: Richard Purdie, Nathan Rossi, Khem Raj
  Cc: Adhemerval Zanella, Alexandre Belloni, Lee Chee Yang,
	Patches and discussions about the oe-core layer, Lukasz Majewski

This patch introduces new recipe - namely 'glibc-tests', which
builds and installs time related (to check if Y2038 support works) glibc
test suite to OE/Yocto built image.

It reuses code from already available 'glibc-testsuite' recipe,
which is run with 'bitbake glibc-testsuite -c check' and uses qemu
to execute remotely (via SSH) tests on some emulated machine.

This recipe installs time related glibc tests on some rootfs image.
Afterwards, those tests can be executed on the real hardware, to
facilitate validation of it with Y2038 problem compliance.

To test time related subset - one needs to call:
ptest-runner glibc-tests
then change the date after Y2038 threshold for 32 bit systems:
date -s "20 JAN 2038 18:00:00"
and then run ptest-runner again.

To facilitate debugging, source files are provided by default with
the unstripped debugging symbols. Such approach would reduce the
already complex recipe (as it inherits base glibc one), so there
is no need to also install *-dbg and *-src packages.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---
Changes for v4:
- Add entry for 'glibc-tests' in the maintainers.inc file
- Remove nativesdk from BBCLASSEXTEND as this resipe is not supposed
  to be the part of SDK

Changes for v3:
- Provide missing ${PN}-ptest for PACKAGES, PROVIDES and
  RPROVIDES variables

Changes for v2:
- Just focus on time related set of tests as those can be run as
  standalone
- Reuse of already built tests (from glibc-tests.inc) and depoloy
  them on the HW target.
- Provide single 'run-ptest' script.
- Update the recipe to run with newest poky's -master
---
 meta/conf/distro/include/maintainers.inc      |   1 +
 .../distro/include/ptest-packagelists.inc     |   1 +
 meta/recipes-core/glibc/glibc-tests_2.34.bb   | 113 ++++++++++++++++++
 meta/recipes-core/glibc/glibc/run-ptest       |  37 ++++++
 4 files changed, 152 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
 create mode 100755 meta/recipes-core/glibc/glibc/run-ptest

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index baec2bef4d..7104e091fc 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -209,6 +209,7 @@ RECIPE_MAINTAINER:pn-glibc = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER:pn-glibc-locale = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER:pn-glibc-mtrace = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER:pn-glibc-scripts = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER:pn-glibc-tests = "Lukasz Majewski <lukma@denx.de>"
 RECIPE_MAINTAINER:pn-glibc-testsuite = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER:pn-glide = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
 RECIPE_MAINTAINER:pn-gmp = "Khem Raj <raj.khem@gmail.com>"
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 2e324f8da4..fd52fa72a4 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -61,6 +61,7 @@ PTESTS_FAST = "\
     slang-ptest \
     wayland-ptest \
     zlib-ptest \
+    glibc-tests-ptest \
 "
 PTESTS_FAST:remove:mips64 = "qemu-ptest"
 PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb b/meta/recipes-core/glibc/glibc-tests_2.34.bb
new file mode 100644
index 0000000000..d2d3cfff91
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
@@ -0,0 +1,113 @@
+require glibc_${PV}.bb
+require glibc-tests.inc
+
+inherit ptest
+
+SRC_URI:append = " \
+	file://run-ptest \
+"
+
+SUMMARY = "glibc tests to be run with ptest"
+
+# Erase some variables already set by glibc_${PV}
+python __anonymous() {
+       # Remove packages provided by glibc build, we only need a subset of them
+       d.setVar("PACKAGES", "${PN} ${PN}-ptest")
+
+       d.setVar("PROVIDES", "${PN} ${PN}-ptest")
+       d.setVar("RPROVIDES", "${PN} ${PN}-ptest")
+
+       d.setVar("BBCLASSEXTEND", "")
+       d.setVar("RRECOMMENDS", "")
+}
+
+# Remove any lefovers from original glibc recipe
+RPROVIDES:${PN} = "${PN}"
+RRECOMMENDS:${PN} = ""
+RDEPENDS:${PN} = " glibc sed"
+DEPENDS:append = " sed"
+
+# Just build tests for target - do not run them
+do_check:append () {
+	oe_runmake -i check run-built-tests=no
+}
+addtask do_check after do_compile before do_install_ptest_base
+
+glibc_strip_build_directory () {
+	# Delete all non executable files from build directory
+	find ${B} ! -executable -type f -delete
+
+	# Remove build dynamic libraries and links to them as
+	# those are already installed in the target device
+	find ${B} -type f -name "*.so" -delete
+	find ${B} -type l -name "*.so*" -delete
+
+	# Remove headers (installed with glibc)
+	find ${B} -type f -name "*.h" -delete
+
+	find ${B} -type f -name "isomac" -delete
+	find ${B} -type f -name "annexc" -delete
+}
+
+do_install_ptest_base () {
+	glibc_strip_build_directory
+
+	ls -r ${B}/*/*-time64 > ${B}/tst_time64
+
+	# Remove '-time64' suffix - those tests are also time related
+	sed -e "s/-time64$//" ${B}/tst_time64 > ${B}/tst_time_tmp
+	tst_time=$(cat ${B}/tst_time_tmp ${B}/tst_time64)
+
+	rm ${B}/tst_time_tmp ${B}/tst_time64
+	echo "${tst_time}"
+
+	# Install build test programs to the image
+	install -d ${D}${PTEST_PATH}/tests/glibc-ptest/
+
+	for f in "${tst_time}"
+	do
+	    cp -r ${f} ${D}${PTEST_PATH}/tests/glibc-ptest/
+	done
+
+	install -d ${D}${PTEST_PATH}
+	cp ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/
+
+}
+
+# The datadir directory is required to allow core (and reused)
+# glibc cleanup function to finish correctly, as this directory
+# is not created for ptests
+stash_locale_package_cleanup:prepend () {
+	mkdir -p ${PKGD}${datadir}
+}
+
+stash_locale_sysroot_cleanup:prepend () {
+	mkdir -p ${SYSROOT_DESTDIR}${datadir}
+}
+
+# Prevent the do_package() task to set 'libc6' prefix
+# for glibc tests related packages
+python populate_packages:prepend () {
+    if d.getVar('DEBIAN_NAMES'):
+        d.setVar('DEBIAN_NAMES', '')
+}
+
+FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/glibc-tests/*"
+
+EXCLUDE_FROM_SHLIBS = "1"
+
+# Install debug data in .debug and sources in /usr/src/debug
+# It is more handy to have _all_ the sources and symbols in one
+# place (package) as this recipe will be used for validation and
+# debugging.
+PACKAGE_DEBUG_SPLIT_STYLE = "debug"
+
+# glibc test cases violate by default some Yocto/OE checks (staticdev,
+# textrel)
+# 'debug-files' - add everything (including debug) into one package
+#                 (no need to install/build *-src package)
+INSANE_SKIP:${PN} += "staticdev textrel debug-files rpaths"
+
+deltask do_stash_locale
+do_install[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
diff --git a/meta/recipes-core/glibc/glibc/run-ptest b/meta/recipes-core/glibc/glibc/run-ptest
new file mode 100755
index 0000000000..f637986105
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/run-ptest
@@ -0,0 +1,37 @@
+#!/bin/sh
+# ptest script for glibc - to run time related tests to
+# facilitate Y2038 validation
+# Run with 'ptest-runner glibc-tests'
+
+output() {
+  retcode=$?
+  if [ $retcode -eq 0 ]
+    then echo "PASS: $i"
+  elif [ $retcode -eq 77 ]
+    then echo "SKIP: $i"
+  else echo "FAIL: $i"
+  fi
+}
+
+# Allow altering time on the target
+export GLIBC_TEST_ALLOW_TIME_SETTING="1"
+
+tst_time64=$(ls -r ${PWD}/tests/glibc-ptest/*-time64)
+
+# Remove '-time64' suffix - those tests are also time
+# related
+tst_time_tmp=$(sed -e "s/-time64$//" <<< ${tst_time64})
+
+# Run tests supporting only 32 bit time
+for i in ${tst_time_tmp}
+do
+	$i >/dev/null 2>&1
+	output
+done
+
+# Run tests supporting only 64 bit time
+for i in ${tst_time64}
+do
+	$i >/dev/null 2>&1
+	output
+done
-- 
2.20.1



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

* Re: [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest
  2021-11-09 15:28 [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest Lukasz Majewski
@ 2021-11-10 17:12 ` Khem Raj
  2021-11-12  8:41   ` [OE-core] " Lukasz Majewski
  2021-11-11 13:51 ` Khem Raj
  1 sibling, 1 reply; 8+ messages in thread
From: Khem Raj @ 2021-11-10 17:12 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Richard Purdie, Nathan Rossi, Adhemerval Zanella,
	Alexandre Belloni, Lee Chee Yang,
	Patches and discussions about the oe-core layer

seeing this

https://errors.yoctoproject.org/Errors/Details/616955/

On Tue, Nov 9, 2021 at 7:29 AM Lukasz Majewski <lukma@denx.de> wrote:
>
> This patch introduces new recipe - namely 'glibc-tests', which
> builds and installs time related (to check if Y2038 support works) glibc
> test suite to OE/Yocto built image.
>
> It reuses code from already available 'glibc-testsuite' recipe,
> which is run with 'bitbake glibc-testsuite -c check' and uses qemu
> to execute remotely (via SSH) tests on some emulated machine.
>
> This recipe installs time related glibc tests on some rootfs image.
> Afterwards, those tests can be executed on the real hardware, to
> facilitate validation of it with Y2038 problem compliance.
>
> To test time related subset - one needs to call:
> ptest-runner glibc-tests
> then change the date after Y2038 threshold for 32 bit systems:
> date -s "20 JAN 2038 18:00:00"
> and then run ptest-runner again.
>
> To facilitate debugging, source files are provided by default with
> the unstripped debugging symbols. Such approach would reduce the
> already complex recipe (as it inherits base glibc one), so there
> is no need to also install *-dbg and *-src packages.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>
> ---
> Changes for v4:
> - Add entry for 'glibc-tests' in the maintainers.inc file
> - Remove nativesdk from BBCLASSEXTEND as this resipe is not supposed
>   to be the part of SDK
>
> Changes for v3:
> - Provide missing ${PN}-ptest for PACKAGES, PROVIDES and
>   RPROVIDES variables
>
> Changes for v2:
> - Just focus on time related set of tests as those can be run as
>   standalone
> - Reuse of already built tests (from glibc-tests.inc) and depoloy
>   them on the HW target.
> - Provide single 'run-ptest' script.
> - Update the recipe to run with newest poky's -master
> ---
>  meta/conf/distro/include/maintainers.inc      |   1 +
>  .../distro/include/ptest-packagelists.inc     |   1 +
>  meta/recipes-core/glibc/glibc-tests_2.34.bb   | 113 ++++++++++++++++++
>  meta/recipes-core/glibc/glibc/run-ptest       |  37 ++++++
>  4 files changed, 152 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
>  create mode 100755 meta/recipes-core/glibc/glibc/run-ptest
>
> diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
> index baec2bef4d..7104e091fc 100644
> --- a/meta/conf/distro/include/maintainers.inc
> +++ b/meta/conf/distro/include/maintainers.inc
> @@ -209,6 +209,7 @@ RECIPE_MAINTAINER:pn-glibc = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-glibc-locale = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-glibc-mtrace = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-glibc-scripts = "Khem Raj <raj.khem@gmail.com>"
> +RECIPE_MAINTAINER:pn-glibc-tests = "Lukasz Majewski <lukma@denx.de>"
>  RECIPE_MAINTAINER:pn-glibc-testsuite = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-glide = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
>  RECIPE_MAINTAINER:pn-gmp = "Khem Raj <raj.khem@gmail.com>"
> diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
> index 2e324f8da4..fd52fa72a4 100644
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -61,6 +61,7 @@ PTESTS_FAST = "\
>      slang-ptest \
>      wayland-ptest \
>      zlib-ptest \
> +    glibc-tests-ptest \
>  "
>  PTESTS_FAST:remove:mips64 = "qemu-ptest"
>  PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
> diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> new file mode 100644
> index 0000000000..d2d3cfff91
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> @@ -0,0 +1,113 @@
> +require glibc_${PV}.bb
> +require glibc-tests.inc
> +
> +inherit ptest
> +
> +SRC_URI:append = " \
> +       file://run-ptest \
> +"
> +
> +SUMMARY = "glibc tests to be run with ptest"
> +
> +# Erase some variables already set by glibc_${PV}
> +python __anonymous() {
> +       # Remove packages provided by glibc build, we only need a subset of them
> +       d.setVar("PACKAGES", "${PN} ${PN}-ptest")
> +
> +       d.setVar("PROVIDES", "${PN} ${PN}-ptest")
> +       d.setVar("RPROVIDES", "${PN} ${PN}-ptest")
> +
> +       d.setVar("BBCLASSEXTEND", "")
> +       d.setVar("RRECOMMENDS", "")
> +}
> +
> +# Remove any lefovers from original glibc recipe
> +RPROVIDES:${PN} = "${PN}"
> +RRECOMMENDS:${PN} = ""
> +RDEPENDS:${PN} = " glibc sed"
> +DEPENDS:append = " sed"
> +
> +# Just build tests for target - do not run them
> +do_check:append () {
> +       oe_runmake -i check run-built-tests=no
> +}
> +addtask do_check after do_compile before do_install_ptest_base
> +
> +glibc_strip_build_directory () {
> +       # Delete all non executable files from build directory
> +       find ${B} ! -executable -type f -delete
> +
> +       # Remove build dynamic libraries and links to them as
> +       # those are already installed in the target device
> +       find ${B} -type f -name "*.so" -delete
> +       find ${B} -type l -name "*.so*" -delete
> +
> +       # Remove headers (installed with glibc)
> +       find ${B} -type f -name "*.h" -delete
> +
> +       find ${B} -type f -name "isomac" -delete
> +       find ${B} -type f -name "annexc" -delete
> +}
> +
> +do_install_ptest_base () {
> +       glibc_strip_build_directory
> +
> +       ls -r ${B}/*/*-time64 > ${B}/tst_time64
> +
> +       # Remove '-time64' suffix - those tests are also time related
> +       sed -e "s/-time64$//" ${B}/tst_time64 > ${B}/tst_time_tmp
> +       tst_time=$(cat ${B}/tst_time_tmp ${B}/tst_time64)
> +
> +       rm ${B}/tst_time_tmp ${B}/tst_time64
> +       echo "${tst_time}"
> +
> +       # Install build test programs to the image
> +       install -d ${D}${PTEST_PATH}/tests/glibc-ptest/
> +
> +       for f in "${tst_time}"
> +       do
> +           cp -r ${f} ${D}${PTEST_PATH}/tests/glibc-ptest/
> +       done
> +
> +       install -d ${D}${PTEST_PATH}
> +       cp ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/
> +
> +}
> +
> +# The datadir directory is required to allow core (and reused)
> +# glibc cleanup function to finish correctly, as this directory
> +# is not created for ptests
> +stash_locale_package_cleanup:prepend () {
> +       mkdir -p ${PKGD}${datadir}
> +}
> +
> +stash_locale_sysroot_cleanup:prepend () {
> +       mkdir -p ${SYSROOT_DESTDIR}${datadir}
> +}
> +
> +# Prevent the do_package() task to set 'libc6' prefix
> +# for glibc tests related packages
> +python populate_packages:prepend () {
> +    if d.getVar('DEBIAN_NAMES'):
> +        d.setVar('DEBIAN_NAMES', '')
> +}
> +
> +FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/glibc-tests/*"
> +
> +EXCLUDE_FROM_SHLIBS = "1"
> +
> +# Install debug data in .debug and sources in /usr/src/debug
> +# It is more handy to have _all_ the sources and symbols in one
> +# place (package) as this recipe will be used for validation and
> +# debugging.
> +PACKAGE_DEBUG_SPLIT_STYLE = "debug"
> +
> +# glibc test cases violate by default some Yocto/OE checks (staticdev,
> +# textrel)
> +# 'debug-files' - add everything (including debug) into one package
> +#                 (no need to install/build *-src package)
> +INSANE_SKIP:${PN} += "staticdev textrel debug-files rpaths"
> +
> +deltask do_stash_locale
> +do_install[noexec] = "1"
> +do_populate_sysroot[noexec] = "1"
> diff --git a/meta/recipes-core/glibc/glibc/run-ptest b/meta/recipes-core/glibc/glibc/run-ptest
> new file mode 100755
> index 0000000000..f637986105
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/run-ptest
> @@ -0,0 +1,37 @@
> +#!/bin/sh
> +# ptest script for glibc - to run time related tests to
> +# facilitate Y2038 validation
> +# Run with 'ptest-runner glibc-tests'
> +
> +output() {
> +  retcode=$?
> +  if [ $retcode -eq 0 ]
> +    then echo "PASS: $i"
> +  elif [ $retcode -eq 77 ]
> +    then echo "SKIP: $i"
> +  else echo "FAIL: $i"
> +  fi
> +}
> +
> +# Allow altering time on the target
> +export GLIBC_TEST_ALLOW_TIME_SETTING="1"
> +
> +tst_time64=$(ls -r ${PWD}/tests/glibc-ptest/*-time64)
> +
> +# Remove '-time64' suffix - those tests are also time
> +# related
> +tst_time_tmp=$(sed -e "s/-time64$//" <<< ${tst_time64})
> +
> +# Run tests supporting only 32 bit time
> +for i in ${tst_time_tmp}
> +do
> +       $i >/dev/null 2>&1
> +       output
> +done
> +
> +# Run tests supporting only 64 bit time
> +for i in ${tst_time64}
> +do
> +       $i >/dev/null 2>&1
> +       output
> +done
> --
> 2.20.1
>


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

* Re: [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest
  2021-11-09 15:28 [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest Lukasz Majewski
  2021-11-10 17:12 ` Khem Raj
@ 2021-11-11 13:51 ` Khem Raj
  2021-11-11 21:28   ` Richard Purdie
  1 sibling, 1 reply; 8+ messages in thread
From: Khem Raj @ 2021-11-11 13:51 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Richard Purdie, Nathan Rossi, Adhemerval Zanella,
	Alexandre Belloni, Lee Chee Yang,
	Patches and discussions about the oe-core layer

On Tue, Nov 9, 2021 at 7:29 AM Lukasz Majewski <lukma@denx.de> wrote:
>
> This patch introduces new recipe - namely 'glibc-tests', which
> builds and installs time related (to check if Y2038 support works) glibc
> test suite to OE/Yocto built image.
>
> It reuses code from already available 'glibc-testsuite' recipe,
> which is run with 'bitbake glibc-testsuite -c check' and uses qemu
> to execute remotely (via SSH) tests on some emulated machine.
>
> This recipe installs time related glibc tests on some rootfs image.
> Afterwards, those tests can be executed on the real hardware, to
> facilitate validation of it with Y2038 problem compliance.
>
> To test time related subset - one needs to call:
> ptest-runner glibc-tests
> then change the date after Y2038 threshold for 32 bit systems:
> date -s "20 JAN 2038 18:00:00"
> and then run ptest-runner again.
>
> To facilitate debugging, source files are provided by default with
> the unstripped debugging symbols. Such approach would reduce the
> already complex recipe (as it inherits base glibc one), so there
> is no need to also install *-dbg and *-src packages.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>
> ---
> Changes for v4:
> - Add entry for 'glibc-tests' in the maintainers.inc file
> - Remove nativesdk from BBCLASSEXTEND as this resipe is not supposed
>   to be the part of SDK
>
> Changes for v3:
> - Provide missing ${PN}-ptest for PACKAGES, PROVIDES and
>   RPROVIDES variables
>
> Changes for v2:
> - Just focus on time related set of tests as those can be run as
>   standalone
> - Reuse of already built tests (from glibc-tests.inc) and depoloy
>   them on the HW target.
> - Provide single 'run-ptest' script.
> - Update the recipe to run with newest poky's -master
> ---
>  meta/conf/distro/include/maintainers.inc      |   1 +
>  .../distro/include/ptest-packagelists.inc     |   1 +
>  meta/recipes-core/glibc/glibc-tests_2.34.bb   | 113 ++++++++++++++++++
>  meta/recipes-core/glibc/glibc/run-ptest       |  37 ++++++
>  4 files changed, 152 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
>  create mode 100755 meta/recipes-core/glibc/glibc/run-ptest
>
> diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
> index baec2bef4d..7104e091fc 100644
> --- a/meta/conf/distro/include/maintainers.inc
> +++ b/meta/conf/distro/include/maintainers.inc
> @@ -209,6 +209,7 @@ RECIPE_MAINTAINER:pn-glibc = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-glibc-locale = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-glibc-mtrace = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-glibc-scripts = "Khem Raj <raj.khem@gmail.com>"
> +RECIPE_MAINTAINER:pn-glibc-tests = "Lukasz Majewski <lukma@denx.de>"
>  RECIPE_MAINTAINER:pn-glibc-testsuite = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-glide = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
>  RECIPE_MAINTAINER:pn-gmp = "Khem Raj <raj.khem@gmail.com>"
> diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
> index 2e324f8da4..fd52fa72a4 100644
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -61,6 +61,7 @@ PTESTS_FAST = "\
>      slang-ptest \
>      wayland-ptest \
>      zlib-ptest \
> +    glibc-tests-ptest \

this will break musl. So lets change this to

PTESTS_FAST:append:libc-glibc = " glibc-tests-ptest"

>  "
>  PTESTS_FAST:remove:mips64 = "qemu-ptest"
>  PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
> diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> new file mode 100644
> index 0000000000..d2d3cfff91
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> @@ -0,0 +1,113 @@
> +require glibc_${PV}.bb
> +require glibc-tests.inc
> +
> +inherit ptest
> +
> +SRC_URI:append = " \
> +       file://run-ptest \
> +"
> +
> +SUMMARY = "glibc tests to be run with ptest"
> +
> +# Erase some variables already set by glibc_${PV}
> +python __anonymous() {
> +       # Remove packages provided by glibc build, we only need a subset of them
> +       d.setVar("PACKAGES", "${PN} ${PN}-ptest")
> +
> +       d.setVar("PROVIDES", "${PN} ${PN}-ptest")
> +       d.setVar("RPROVIDES", "${PN} ${PN}-ptest")
> +
> +       d.setVar("BBCLASSEXTEND", "")
> +       d.setVar("RRECOMMENDS", "")
> +}
> +
> +# Remove any lefovers from original glibc recipe
                              ^^^^^^
typo

> +RPROVIDES:${PN} = "${PN}"
> +RRECOMMENDS:${PN} = ""
> +RDEPENDS:${PN} = " glibc sed"
> +DEPENDS:append = " sed"
> +
> +# Just build tests for target - do not run them
> +do_check:append () {
> +       oe_runmake -i check run-built-tests=no
> +}
> +addtask do_check after do_compile before do_install_ptest_base
> +
> +glibc_strip_build_directory () {
> +       # Delete all non executable files from build directory
> +       find ${B} ! -executable -type f -delete
> +
> +       # Remove build dynamic libraries and links to them as
> +       # those are already installed in the target device
> +       find ${B} -type f -name "*.so" -delete
> +       find ${B} -type l -name "*.so*" -delete
> +
> +       # Remove headers (installed with glibc)
> +       find ${B} -type f -name "*.h" -delete
> +
> +       find ${B} -type f -name "isomac" -delete
> +       find ${B} -type f -name "annexc" -delete
> +}
> +
> +do_install_ptest_base () {
> +       glibc_strip_build_directory
> +
> +       ls -r ${B}/*/*-time64 > ${B}/tst_time64
> +
> +       # Remove '-time64' suffix - those tests are also time related
> +       sed -e "s/-time64$//" ${B}/tst_time64 > ${B}/tst_time_tmp
> +       tst_time=$(cat ${B}/tst_time_tmp ${B}/tst_time64)
> +
> +       rm ${B}/tst_time_tmp ${B}/tst_time64
> +       echo "${tst_time}"
> +
> +       # Install build test programs to the image
> +       install -d ${D}${PTEST_PATH}/tests/glibc-ptest/
> +
> +       for f in "${tst_time}"
> +       do
> +           cp -r ${f} ${D}${PTEST_PATH}/tests/glibc-ptest/
> +       done
> +
> +       install -d ${D}${PTEST_PATH}
> +       cp ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/
> +
> +}
> +
> +# The datadir directory is required to allow core (and reused)
> +# glibc cleanup function to finish correctly, as this directory
> +# is not created for ptests
> +stash_locale_package_cleanup:prepend () {
> +       mkdir -p ${PKGD}${datadir}
> +}
> +
> +stash_locale_sysroot_cleanup:prepend () {
> +       mkdir -p ${SYSROOT_DESTDIR}${datadir}
> +}
> +
> +# Prevent the do_package() task to set 'libc6' prefix
> +# for glibc tests related packages
> +python populate_packages:prepend () {
> +    if d.getVar('DEBIAN_NAMES'):
> +        d.setVar('DEBIAN_NAMES', '')
> +}
> +
> +FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/glibc-tests/*"
> +
> +EXCLUDE_FROM_SHLIBS = "1"
> +
> +# Install debug data in .debug and sources in /usr/src/debug
> +# It is more handy to have _all_ the sources and symbols in one
> +# place (package) as this recipe will be used for validation and
> +# debugging.
> +PACKAGE_DEBUG_SPLIT_STYLE = "debug"
> +
> +# glibc test cases violate by default some Yocto/OE checks (staticdev,
> +# textrel)
> +# 'debug-files' - add everything (including debug) into one package
> +#                 (no need to install/build *-src package)
> +INSANE_SKIP:${PN} += "staticdev textrel debug-files rpaths"
> +
> +deltask do_stash_locale
> +do_install[noexec] = "1"
> +do_populate_sysroot[noexec] = "1"
> diff --git a/meta/recipes-core/glibc/glibc/run-ptest b/meta/recipes-core/glibc/glibc/run-ptest
> new file mode 100755
> index 0000000000..f637986105
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/run-ptest
> @@ -0,0 +1,37 @@
> +#!/bin/sh
> +# ptest script for glibc - to run time related tests to
> +# facilitate Y2038 validation
> +# Run with 'ptest-runner glibc-tests'
> +
> +output() {
> +  retcode=$?
> +  if [ $retcode -eq 0 ]
> +    then echo "PASS: $i"
> +  elif [ $retcode -eq 77 ]
> +    then echo "SKIP: $i"
> +  else echo "FAIL: $i"
> +  fi
> +}
> +
> +# Allow altering time on the target
> +export GLIBC_TEST_ALLOW_TIME_SETTING="1"
> +
> +tst_time64=$(ls -r ${PWD}/tests/glibc-ptest/*-time64)
> +
> +# Remove '-time64' suffix - those tests are also time
> +# related
> +tst_time_tmp=$(sed -e "s/-time64$//" <<< ${tst_time64})
> +
> +# Run tests supporting only 32 bit time
> +for i in ${tst_time_tmp}
> +do
> +       $i >/dev/null 2>&1
> +       output
> +done
> +
> +# Run tests supporting only 64 bit time
> +for i in ${tst_time64}
> +do
> +       $i >/dev/null 2>&1
> +       output
> +done
> --
> 2.20.1
>


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

* Re: [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest
  2021-11-11 13:51 ` Khem Raj
@ 2021-11-11 21:28   ` Richard Purdie
  2021-11-12  8:48     ` Lukasz Majewski
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2021-11-11 21:28 UTC (permalink / raw)
  To: Khem Raj, Lukasz Majewski
  Cc: Nathan Rossi, Adhemerval Zanella, Alexandre Belloni,
	Lee Chee Yang, Patches and discussions about the oe-core layer

On Thu, 2021-11-11 at 05:51 -0800, Khem Raj wrote:
> On Tue, Nov 9, 2021 at 7:29 AM Lukasz Majewski <lukma@denx.de> wrote:
> > 
> > This patch introduces new recipe - namely 'glibc-tests', which
> > builds and installs time related (to check if Y2038 support works) glibc
> > test suite to OE/Yocto built image.
> > 
> > It reuses code from already available 'glibc-testsuite' recipe,
> > which is run with 'bitbake glibc-testsuite -c check' and uses qemu
> > to execute remotely (via SSH) tests on some emulated machine.
> > 
> > This recipe installs time related glibc tests on some rootfs image.
> > Afterwards, those tests can be executed on the real hardware, to
> > facilitate validation of it with Y2038 problem compliance.
> > 
> > To test time related subset - one needs to call:
> > ptest-runner glibc-tests
> > then change the date after Y2038 threshold for 32 bit systems:
> > date -s "20 JAN 2038 18:00:00"
> > and then run ptest-runner again.
> > 
> > To facilitate debugging, source files are provided by default with
> > the unstripped debugging symbols. Such approach would reduce the
> > already complex recipe (as it inherits base glibc one), so there
> > is no need to also install *-dbg and *-src packages.
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > 
> > ---
> > Changes for v4:
> > - Add entry for 'glibc-tests' in the maintainers.inc file
> > - Remove nativesdk from BBCLASSEXTEND as this resipe is not supposed
> >   to be the part of SDK
> > 
> > Changes for v3:
> > - Provide missing ${PN}-ptest for PACKAGES, PROVIDES and
> >   RPROVIDES variables
> > 
> > Changes for v2:
> > - Just focus on time related set of tests as those can be run as
> >   standalone
> > - Reuse of already built tests (from glibc-tests.inc) and depoloy
> >   them on the HW target.
> > - Provide single 'run-ptest' script.
> > - Update the recipe to run with newest poky's -master
> > ---
> >  meta/conf/distro/include/maintainers.inc      |   1 +
> >  .../distro/include/ptest-packagelists.inc     |   1 +
> >  meta/recipes-core/glibc/glibc-tests_2.34.bb   | 113 ++++++++++++++++++
> >  meta/recipes-core/glibc/glibc/run-ptest       |  37 ++++++
> >  4 files changed, 152 insertions(+)
> >  create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
> >  create mode 100755 meta/recipes-core/glibc/glibc/run-ptest
> > 
> > diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
> > index baec2bef4d..7104e091fc 100644
> > --- a/meta/conf/distro/include/maintainers.inc
> > +++ b/meta/conf/distro/include/maintainers.inc
> > @@ -209,6 +209,7 @@ RECIPE_MAINTAINER:pn-glibc = "Khem Raj <raj.khem@gmail.com>"
> >  RECIPE_MAINTAINER:pn-glibc-locale = "Khem Raj <raj.khem@gmail.com>"
> >  RECIPE_MAINTAINER:pn-glibc-mtrace = "Khem Raj <raj.khem@gmail.com>"
> >  RECIPE_MAINTAINER:pn-glibc-scripts = "Khem Raj <raj.khem@gmail.com>"
> > +RECIPE_MAINTAINER:pn-glibc-tests = "Lukasz Majewski <lukma@denx.de>"
> >  RECIPE_MAINTAINER:pn-glibc-testsuite = "Khem Raj <raj.khem@gmail.com>"
> >  RECIPE_MAINTAINER:pn-glide = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
> >  RECIPE_MAINTAINER:pn-gmp = "Khem Raj <raj.khem@gmail.com>"
> > diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
> > index 2e324f8da4..fd52fa72a4 100644
> > --- a/meta/conf/distro/include/ptest-packagelists.inc
> > +++ b/meta/conf/distro/include/ptest-packagelists.inc
> > @@ -61,6 +61,7 @@ PTESTS_FAST = "\
> >      slang-ptest \
> >      wayland-ptest \
> >      zlib-ptest \
> > +    glibc-tests-ptest \
> 
> this will break musl. So lets change this to
> 
> PTESTS_FAST:append:libc-glibc = " glibc-tests-ptest"

FWIW I tested a tweak in master-next for that...

Cheers,

Richard



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

* Re: [OE-core] [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest
  2021-11-10 17:12 ` Khem Raj
@ 2021-11-12  8:41   ` Lukasz Majewski
  2021-11-12  8:54     ` Richard Purdie
  0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Majewski @ 2021-11-12  8:41 UTC (permalink / raw)
  To: Khem Raj
  Cc: Richard Purdie, Nathan Rossi, Adhemerval Zanella,
	Alexandre Belloni, Lee Chee Yang,
	Patches and discussions about the oe-core layer

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

Hi Khem,

> seeing this
> 
> https://errors.yoctoproject.org/Errors/Details/616955/

The error is about autoconf version:

DEBUG: Executing shell function do_configure
aclocal.m4:6: error: Exactly version 2.69 of Autoconf is required but
you have 2.71

aclocal.m4:6: the top level
autom4te: error: m4 failed with exit status: 63

This is strange, as on my setup (qemuarm, qemuarm64, qemux86) the glibc
and glibc-tests are built without any issues with autoconf version 2.71.


I've built the glibc-tests without issues with:

Build Configuration:
BB_VERSION           = "1.52.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "riscv64-poky-linux"
MACHINE              = "qemuriscv64"
DISTRO               = "poky"
DISTRO_VERSION       = "3.4"
TUNE_FEATURES        = "riscv64"
meta
meta-poky
meta-yocto-bsp       =
"glibc-ptest_v4:164923f0586ac189f01938a32fa102c2df7cc447"

DISTRO=poky MACHINE=qemuriscv64 bitbake glibc-tests


Khem, could you help me with setting up environment to reproduce this
issue?

> 
> On Tue, Nov 9, 2021 at 7:29 AM Lukasz Majewski <lukma@denx.de> wrote:
> >
> > This patch introduces new recipe - namely 'glibc-tests', which
> > builds and installs time related (to check if Y2038 support works)
> > glibc test suite to OE/Yocto built image.
> >
> > It reuses code from already available 'glibc-testsuite' recipe,
> > which is run with 'bitbake glibc-testsuite -c check' and uses qemu
> > to execute remotely (via SSH) tests on some emulated machine.
> >
> > This recipe installs time related glibc tests on some rootfs image.
> > Afterwards, those tests can be executed on the real hardware, to
> > facilitate validation of it with Y2038 problem compliance.
> >
> > To test time related subset - one needs to call:
> > ptest-runner glibc-tests
> > then change the date after Y2038 threshold for 32 bit systems:
> > date -s "20 JAN 2038 18:00:00"
> > and then run ptest-runner again.
> >
> > To facilitate debugging, source files are provided by default with
> > the unstripped debugging symbols. Such approach would reduce the
> > already complex recipe (as it inherits base glibc one), so there
> > is no need to also install *-dbg and *-src packages.
> >
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> >
> > ---
> > Changes for v4:
> > - Add entry for 'glibc-tests' in the maintainers.inc file
> > - Remove nativesdk from BBCLASSEXTEND as this resipe is not supposed
> >   to be the part of SDK
> >
> > Changes for v3:
> > - Provide missing ${PN}-ptest for PACKAGES, PROVIDES and
> >   RPROVIDES variables
> >
> > Changes for v2:
> > - Just focus on time related set of tests as those can be run as
> >   standalone
> > - Reuse of already built tests (from glibc-tests.inc) and depoloy
> >   them on the HW target.
> > - Provide single 'run-ptest' script.
> > - Update the recipe to run with newest poky's -master
> > ---
> >  meta/conf/distro/include/maintainers.inc      |   1 +
> >  .../distro/include/ptest-packagelists.inc     |   1 +
> >  meta/recipes-core/glibc/glibc-tests_2.34.bb   | 113
> > ++++++++++++++++++ meta/recipes-core/glibc/glibc/run-ptest       |
> > 37 ++++++ 4 files changed, 152 insertions(+)
> >  create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
> >  create mode 100755 meta/recipes-core/glibc/glibc/run-ptest
> >
> > diff --git a/meta/conf/distro/include/maintainers.inc
> > b/meta/conf/distro/include/maintainers.inc index
> > baec2bef4d..7104e091fc 100644 ---
> > a/meta/conf/distro/include/maintainers.inc +++
> > b/meta/conf/distro/include/maintainers.inc @@ -209,6 +209,7 @@
> > RECIPE_MAINTAINER:pn-glibc = "Khem Raj <raj.khem@gmail.com>"
> > RECIPE_MAINTAINER:pn-glibc-locale = "Khem Raj <raj.khem@gmail.com>"
> > RECIPE_MAINTAINER:pn-glibc-mtrace = "Khem Raj <raj.khem@gmail.com>"
> > RECIPE_MAINTAINER:pn-glibc-scripts = "Khem Raj
> > <raj.khem@gmail.com>" +RECIPE_MAINTAINER:pn-glibc-tests = "Lukasz
> > Majewski <lukma@denx.de>" RECIPE_MAINTAINER:pn-glibc-testsuite =
> > "Khem Raj <raj.khem@gmail.com>" RECIPE_MAINTAINER:pn-glide =
> > "Otavio Salvador <otavio.salvador@ossystems.com.br>"
> > RECIPE_MAINTAINER:pn-gmp = "Khem Raj <raj.khem@gmail.com>" diff
> > --git a/meta/conf/distro/include/ptest-packagelists.inc
> > b/meta/conf/distro/include/ptest-packagelists.inc index
> > 2e324f8da4..fd52fa72a4 100644 ---
> > a/meta/conf/distro/include/ptest-packagelists.inc +++
> > b/meta/conf/distro/include/ptest-packagelists.inc @@ -61,6 +61,7 @@
> > PTESTS_FAST = "\ slang-ptest \ wayland-ptest \ zlib-ptest \
> > +    glibc-tests-ptest \
> >  "
> >  PTESTS_FAST:remove:mips64 = "qemu-ptest"
> >  PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
> > diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > b/meta/recipes-core/glibc/glibc-tests_2.34.bb new file mode 100644
> > index 0000000000..d2d3cfff91
> > --- /dev/null
> > +++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > @@ -0,0 +1,113 @@
> > +require glibc_${PV}.bb
> > +require glibc-tests.inc
> > +
> > +inherit ptest
> > +
> > +SRC_URI:append = " \
> > +       file://run-ptest \
> > +"
> > +
> > +SUMMARY = "glibc tests to be run with ptest"
> > +
> > +# Erase some variables already set by glibc_${PV}
> > +python __anonymous() {
> > +       # Remove packages provided by glibc build, we only need a
> > subset of them
> > +       d.setVar("PACKAGES", "${PN} ${PN}-ptest")
> > +
> > +       d.setVar("PROVIDES", "${PN} ${PN}-ptest")
> > +       d.setVar("RPROVIDES", "${PN} ${PN}-ptest")
> > +
> > +       d.setVar("BBCLASSEXTEND", "")
> > +       d.setVar("RRECOMMENDS", "")
> > +}
> > +
> > +# Remove any lefovers from original glibc recipe
> > +RPROVIDES:${PN} = "${PN}"
> > +RRECOMMENDS:${PN} = ""
> > +RDEPENDS:${PN} = " glibc sed"
> > +DEPENDS:append = " sed"
> > +
> > +# Just build tests for target - do not run them
> > +do_check:append () {
> > +       oe_runmake -i check run-built-tests=no
> > +}
> > +addtask do_check after do_compile before do_install_ptest_base
> > +
> > +glibc_strip_build_directory () {
> > +       # Delete all non executable files from build directory
> > +       find ${B} ! -executable -type f -delete
> > +
> > +       # Remove build dynamic libraries and links to them as
> > +       # those are already installed in the target device
> > +       find ${B} -type f -name "*.so" -delete
> > +       find ${B} -type l -name "*.so*" -delete
> > +
> > +       # Remove headers (installed with glibc)
> > +       find ${B} -type f -name "*.h" -delete
> > +
> > +       find ${B} -type f -name "isomac" -delete
> > +       find ${B} -type f -name "annexc" -delete
> > +}
> > +
> > +do_install_ptest_base () {
> > +       glibc_strip_build_directory
> > +
> > +       ls -r ${B}/*/*-time64 > ${B}/tst_time64
> > +
> > +       # Remove '-time64' suffix - those tests are also time
> > related
> > +       sed -e "s/-time64$//" ${B}/tst_time64 > ${B}/tst_time_tmp
> > +       tst_time=$(cat ${B}/tst_time_tmp ${B}/tst_time64)
> > +
> > +       rm ${B}/tst_time_tmp ${B}/tst_time64
> > +       echo "${tst_time}"
> > +
> > +       # Install build test programs to the image
> > +       install -d ${D}${PTEST_PATH}/tests/glibc-ptest/
> > +
> > +       for f in "${tst_time}"
> > +       do
> > +           cp -r ${f} ${D}${PTEST_PATH}/tests/glibc-ptest/
> > +       done
> > +
> > +       install -d ${D}${PTEST_PATH}
> > +       cp ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/
> > +
> > +}
> > +
> > +# The datadir directory is required to allow core (and reused)
> > +# glibc cleanup function to finish correctly, as this directory
> > +# is not created for ptests
> > +stash_locale_package_cleanup:prepend () {
> > +       mkdir -p ${PKGD}${datadir}
> > +}
> > +
> > +stash_locale_sysroot_cleanup:prepend () {
> > +       mkdir -p ${SYSROOT_DESTDIR}${datadir}
> > +}
> > +
> > +# Prevent the do_package() task to set 'libc6' prefix
> > +# for glibc tests related packages
> > +python populate_packages:prepend () {
> > +    if d.getVar('DEBIAN_NAMES'):
> > +        d.setVar('DEBIAN_NAMES', '')
> > +}
> > +
> > +FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/glibc-tests/*"
> > +
> > +EXCLUDE_FROM_SHLIBS = "1"
> > +
> > +# Install debug data in .debug and sources in /usr/src/debug
> > +# It is more handy to have _all_ the sources and symbols in one
> > +# place (package) as this recipe will be used for validation and
> > +# debugging.
> > +PACKAGE_DEBUG_SPLIT_STYLE = "debug"
> > +
> > +# glibc test cases violate by default some Yocto/OE checks
> > (staticdev, +# textrel)
> > +# 'debug-files' - add everything (including debug) into one package
> > +#                 (no need to install/build *-src package)
> > +INSANE_SKIP:${PN} += "staticdev textrel debug-files rpaths"
> > +
> > +deltask do_stash_locale
> > +do_install[noexec] = "1"
> > +do_populate_sysroot[noexec] = "1"
> > diff --git a/meta/recipes-core/glibc/glibc/run-ptest
> > b/meta/recipes-core/glibc/glibc/run-ptest new file mode 100755
> > index 0000000000..f637986105
> > --- /dev/null
> > +++ b/meta/recipes-core/glibc/glibc/run-ptest
> > @@ -0,0 +1,37 @@
> > +#!/bin/sh
> > +# ptest script for glibc - to run time related tests to
> > +# facilitate Y2038 validation
> > +# Run with 'ptest-runner glibc-tests'
> > +
> > +output() {
> > +  retcode=$?
> > +  if [ $retcode -eq 0 ]
> > +    then echo "PASS: $i"
> > +  elif [ $retcode -eq 77 ]
> > +    then echo "SKIP: $i"
> > +  else echo "FAIL: $i"
> > +  fi
> > +}
> > +
> > +# Allow altering time on the target
> > +export GLIBC_TEST_ALLOW_TIME_SETTING="1"
> > +
> > +tst_time64=$(ls -r ${PWD}/tests/glibc-ptest/*-time64)
> > +
> > +# Remove '-time64' suffix - those tests are also time
> > +# related
> > +tst_time_tmp=$(sed -e "s/-time64$//" <<< ${tst_time64})
> > +
> > +# Run tests supporting only 32 bit time
> > +for i in ${tst_time_tmp}
> > +do
> > +       $i >/dev/null 2>&1
> > +       output
> > +done
> > +
> > +# Run tests supporting only 64 bit time
> > +for i in ${tst_time64}
> > +do
> > +       $i >/dev/null 2>&1
> > +       output
> > +done
> > --
> > 2.20.1
> >  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest
  2021-11-11 21:28   ` Richard Purdie
@ 2021-11-12  8:48     ` Lukasz Majewski
  0 siblings, 0 replies; 8+ messages in thread
From: Lukasz Majewski @ 2021-11-12  8:48 UTC (permalink / raw)
  To: Richard Purdie, Khem Raj
  Cc: Nathan Rossi, Adhemerval Zanella, Alexandre Belloni,
	Lee Chee Yang, Patches and discussions about the oe-core layer

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

Hi Richard, Khem

> On Thu, 2021-11-11 at 05:51 -0800, Khem Raj wrote:
> > On Tue, Nov 9, 2021 at 7:29 AM Lukasz Majewski <lukma@denx.de>
> > wrote:  
> > > 
> > > This patch introduces new recipe - namely 'glibc-tests', which
> > > builds and installs time related (to check if Y2038 support
> > > works) glibc test suite to OE/Yocto built image.
> > > 
> > > It reuses code from already available 'glibc-testsuite' recipe,
> > > which is run with 'bitbake glibc-testsuite -c check' and uses qemu
> > > to execute remotely (via SSH) tests on some emulated machine.
> > > 
> > > This recipe installs time related glibc tests on some rootfs
> > > image. Afterwards, those tests can be executed on the real
> > > hardware, to facilitate validation of it with Y2038 problem
> > > compliance.
> > > 
> > > To test time related subset - one needs to call:
> > > ptest-runner glibc-tests
> > > then change the date after Y2038 threshold for 32 bit systems:
> > > date -s "20 JAN 2038 18:00:00"
> > > and then run ptest-runner again.
> > > 
> > > To facilitate debugging, source files are provided by default with
> > > the unstripped debugging symbols. Such approach would reduce the
> > > already complex recipe (as it inherits base glibc one), so there
> > > is no need to also install *-dbg and *-src packages.
> > > 
> > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > 
> > > ---
> > > Changes for v4:
> > > - Add entry for 'glibc-tests' in the maintainers.inc file
> > > - Remove nativesdk from BBCLASSEXTEND as this resipe is not
> > > supposed to be the part of SDK
> > > 
> > > Changes for v3:
> > > - Provide missing ${PN}-ptest for PACKAGES, PROVIDES and
> > >   RPROVIDES variables
> > > 
> > > Changes for v2:
> > > - Just focus on time related set of tests as those can be run as
> > >   standalone
> > > - Reuse of already built tests (from glibc-tests.inc) and depoloy
> > >   them on the HW target.
> > > - Provide single 'run-ptest' script.
> > > - Update the recipe to run with newest poky's -master
> > > ---
> > >  meta/conf/distro/include/maintainers.inc      |   1 +
> > >  .../distro/include/ptest-packagelists.inc     |   1 +
> > >  meta/recipes-core/glibc/glibc-tests_2.34.bb   | 113
> > > ++++++++++++++++++ meta/recipes-core/glibc/glibc/run-ptest
> > > |  37 ++++++ 4 files changed, 152 insertions(+)
> > >  create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
> > >  create mode 100755 meta/recipes-core/glibc/glibc/run-ptest
> > > 
> > > diff --git a/meta/conf/distro/include/maintainers.inc
> > > b/meta/conf/distro/include/maintainers.inc index
> > > baec2bef4d..7104e091fc 100644 ---
> > > a/meta/conf/distro/include/maintainers.inc +++
> > > b/meta/conf/distro/include/maintainers.inc @@ -209,6 +209,7 @@
> > > RECIPE_MAINTAINER:pn-glibc = "Khem Raj <raj.khem@gmail.com>"
> > > RECIPE_MAINTAINER:pn-glibc-locale = "Khem Raj
> > > <raj.khem@gmail.com>" RECIPE_MAINTAINER:pn-glibc-mtrace = "Khem
> > > Raj <raj.khem@gmail.com>" RECIPE_MAINTAINER:pn-glibc-scripts =
> > > "Khem Raj <raj.khem@gmail.com>" +RECIPE_MAINTAINER:pn-glibc-tests
> > > = "Lukasz Majewski <lukma@denx.de>"
> > > RECIPE_MAINTAINER:pn-glibc-testsuite = "Khem Raj
> > > <raj.khem@gmail.com>" RECIPE_MAINTAINER:pn-glide = "Otavio
> > > Salvador <otavio.salvador@ossystems.com.br>"
> > > RECIPE_MAINTAINER:pn-gmp = "Khem Raj <raj.khem@gmail.com>" diff
> > > --git a/meta/conf/distro/include/ptest-packagelists.inc
> > > b/meta/conf/distro/include/ptest-packagelists.inc index
> > > 2e324f8da4..fd52fa72a4 100644 ---
> > > a/meta/conf/distro/include/ptest-packagelists.inc +++
> > > b/meta/conf/distro/include/ptest-packagelists.inc @@ -61,6 +61,7
> > > @@ PTESTS_FAST = "\ slang-ptest \ wayland-ptest \ zlib-ptest \
> > > +    glibc-tests-ptest \  
> > 
> > this will break musl. So lets change this to
> > 
> > PTESTS_FAST:append:libc-glibc = " glibc-tests-ptest"  
> 
> FWIW I tested a tweak in master-next for that...
> 

Shall I prepare v5 with fix for that, or will you keep patches from
master-next (with your fix for this) ?

(I would prefer personally the latter option :-) ).

> Cheers,
> 
> Richard
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [OE-core] [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest
  2021-11-12  8:41   ` [OE-core] " Lukasz Majewski
@ 2021-11-12  8:54     ` Richard Purdie
  2021-11-12 15:02       ` Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2021-11-12  8:54 UTC (permalink / raw)
  To: Lukasz Majewski, Khem Raj
  Cc: Nathan Rossi, Adhemerval Zanella, Alexandre Belloni,
	Lee Chee Yang, Patches and discussions about the oe-core layer

On Fri, 2021-11-12 at 09:41 +0100, Lukasz Majewski wrote:
> Hi Khem,
> 
> > seeing this
> > 
> > https://errors.yoctoproject.org/Errors/Details/616955/
> 
> The error is about autoconf version:
> 
> DEBUG: Executing shell function do_configure
> aclocal.m4:6: error: Exactly version 2.69 of Autoconf is required but
> you have 2.71
> 
> aclocal.m4:6: the top level
> autom4te: error: m4 failed with exit status: 63
> 
> This is strange, as on my setup (qemuarm, qemuarm64, qemux86) the glibc
> and glibc-tests are built without any issues with autoconf version 2.71.
> 
> 
> I've built the glibc-tests without issues with:
> 
> Build Configuration:
> BB_VERSION           = "1.52.0"
> BUILD_SYS            = "x86_64-linux"
> NATIVELSBSTRING      = "universal"
> TARGET_SYS           = "riscv64-poky-linux"
> MACHINE              = "qemuriscv64"
> DISTRO               = "poky"
> DISTRO_VERSION       = "3.4"
> TUNE_FEATURES        = "riscv64"
> meta
> meta-poky
> meta-yocto-bsp       =
> "glibc-ptest_v4:164923f0586ac189f01938a32fa102c2df7cc447"
> 
> DISTRO=poky MACHINE=qemuriscv64 bitbake glibc-tests
> 
> 
> Khem, could you help me with setting up environment to reproduce this
> issue?

The autoconf version message isn't a fatal error and if you look at your own
build logs you probably have that too. What looks like it is the issue is:

checking if riscv64-yoe-linux-clang -target riscv64-yoe-linux    -mlittle-endian -mno-relax -Qunused-arguments -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/build/tmp/work/riscv64-yoe-linux/glibc-tests/2.34-r0/recipe-sysroot is sufficient to build libc... no

which I think leads to:

configure: error: 
*** These critical programs are missing or too old: compiler

Khem was implying this was a musl build, I can't see that from the logs but if
it is a musl build, it shouldn't be building glibc tests.

For that reason I did add:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=master-next&id=f54774199ef09b655de1b586045995e0f284925a

to master-next since I believe that was the remaining issue blocking the patch
apart from a typo Khem also mentioned which I meant to find and tweak.

I still am concerned about having duplication of tests but I don't see any way
around that since you want to get this patch merged and I don't have any
solution for that.

Cheers,

Richard




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

* Re: [OE-core] [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest
  2021-11-12  8:54     ` Richard Purdie
@ 2021-11-12 15:02       ` Khem Raj
  0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2021-11-12 15:02 UTC (permalink / raw)
  To: Richard Purdie
  Cc: Adhemerval Zanella, Alexandre Belloni, Lee Chee Yang,
	Lukasz Majewski, Nathan Rossi,
	Patches and discussions about the oe-core layer

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

On Fri, Nov 12, 2021 at 12:54 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Fri, 2021-11-12 at 09:41 +0100, Lukasz Majewski wrote:
> > Hi Khem,
> >
> > > seeing this
> > >
> > > https://errors.yoctoproject.org/Errors/Details/616955/
> >
> > The error is about autoconf version:
> >
> > DEBUG: Executing shell function do_configure
> > aclocal.m4:6: error: Exactly version 2.69 of Autoconf is required but
> > you have 2.71
> >
> > aclocal.m4:6: the top level
> > autom4te: error: m4 failed with exit status: 63
> >
> > This is strange, as on my setup (qemuarm, qemuarm64, qemux86) the glibc
> > and glibc-tests are built without any issues with autoconf version 2.71.
> >
> >
> > I've built the glibc-tests without issues with:
> >
> > Build Configuration:
> > BB_VERSION           = "1.52.0"
> > BUILD_SYS            = "x86_64-linux"
> > NATIVELSBSTRING      = "universal"
> > TARGET_SYS           = "riscv64-poky-linux"
> > MACHINE              = "qemuriscv64"
> > DISTRO               = "poky"
> > DISTRO_VERSION       = "3.4"
> > TUNE_FEATURES        = "riscv64"
> > meta
> > meta-poky
> > meta-yocto-bsp       =
> > "glibc-ptest_v4:164923f0586ac189f01938a32fa102c2df7cc447"
> >
> > DISTRO=poky MACHINE=qemuriscv64 bitbake glibc-tests
> >
> >
> > Khem, could you help me with setting up environment to reproduce this
> > issue?
>
> The autoconf version message isn't a fatal error and if you look at your
> own
> build logs you probably have that too. What looks like it is the issue is:
>
> checking if riscv64-yoe-linux-clang -target riscv64-yoe-linux
> -mlittle-endian -mno-relax -Qunused-arguments -fstack-protector-strong  -O2
> -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
> --sysroot=TOPDIR/build/tmp/work/riscv64-yoe-linux/glibc-tests/2.34-r0/recipe-sysroot
> is sufficient to build libc... no
>

Right so perhaps we need to set TOOLCHAIN to gcc for this in meta-clang
which should fix it


> which I think leads to:
>
> configure: error:
> *** These critical programs are missing or too old: compiler
>
> Khem was implying this was a musl build, I can't see that from the logs
> but if
> it is a musl build, it shouldn't be building glibc tests.
>
> For that reason I did add:
>
>
> http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=master-next&id=f54774199ef09b655de1b586045995e0f284925a
>
> to master-next since I believe that was the remaining issue blocking the
> patch
> apart from a typo Khem also mentioned which I meant to find and tweak.
>
> I still am concerned about having duplication of tests but I don't see any
> way
> around that since you want to get this patch merged and I don't have any
> solution for that.
>
> Cheers,
>
> Richard
>
>
>

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

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

end of thread, other threads:[~2021-11-12 15:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 15:28 [PATCH v4] glibc: ptest: Add running glibc time related test suite (Y2038) with ptest Lukasz Majewski
2021-11-10 17:12 ` Khem Raj
2021-11-12  8:41   ` [OE-core] " Lukasz Majewski
2021-11-12  8:54     ` Richard Purdie
2021-11-12 15:02       ` Khem Raj
2021-11-11 13:51 ` Khem Raj
2021-11-11 21:28   ` Richard Purdie
2021-11-12  8:48     ` Lukasz Majewski

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.