diff options
| author | Alex Kiernan <alex.kiernan@gmail.com> | 2019-11-06 05:59:09 +0000 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2019-11-06 19:58:01 -0800 |
| commit | d764f9e3044ab8dd553fabe9c7a607a409613609 (patch) | |
| tree | ab71603d8c28958c399a34328b2464100e3ff51a | |
| parent | 19aadf45ccc1f97fb7b56d20c4251b17ed9351c8 (diff) | |
| download | meta-openembedded-d764f9e3044ab8dd553fabe9c7a607a409613609.tar.gz | |
ostree: Add support for ptest
Move ostree-trivial-httpd to its own package so we can RDEPEND on it in both
the main ostree and ptest packages. Drop the patches to remove
ostree-trivial-httpd based on --enable-trivial-httpd-cmdline as they break
installed tests (and were reverted upstream).
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
9 files changed, 271 insertions, 115 deletions
diff --git a/meta-oe/recipes-extended/ostree/ostree/0001-Always-enable-trivial-httpd-for-tests.patch b/meta-oe/recipes-extended/ostree/ostree/0001-Always-enable-trivial-httpd-for-tests.patch deleted file mode 100644 index c9e1306afd..0000000000 --- a/meta-oe/recipes-extended/ostree/ostree/0001-Always-enable-trivial-httpd-for-tests.patch +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | From 44e0647230b22cd136ae2fb252ce90eed4751970 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 3 | Date: Wed, 4 Sep 2019 17:29:15 +0100 | ||
| 4 | Subject: [PATCH 1/2] Always enable trivial-httpd for tests | ||
| 5 | |||
| 6 | When running tests we always need ostree-trivial-httpd, so enable it | ||
| 7 | unconditionally | ||
| 8 | |||
| 9 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 10 | Upstream-Status: Submitted [https://github.com/ostreedev/ostree/pull/1912] | ||
| 11 | --- | ||
| 12 | Makefile.am | 1 + | ||
| 13 | ci/build.sh | 5 +++++ | ||
| 14 | ci/travis-build.sh | 1 + | ||
| 15 | 3 files changed, 7 insertions(+) | ||
| 16 | |||
| 17 | diff --git a/Makefile.am b/Makefile.am | ||
| 18 | index cd04a055045a..673dbf88de55 100644 | ||
| 19 | --- a/Makefile.am | ||
| 20 | +++ b/Makefile.am | ||
| 21 | @@ -39,6 +39,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS += \ | ||
| 22 | --enable-gtk-doc \ | ||
| 23 | --enable-man \ | ||
| 24 | --disable-maintainer-mode \ | ||
| 25 | + --enable-trivial-httpd-cmdline \ | ||
| 26 | $(NULL) | ||
| 27 | |||
| 28 | GITIGNOREFILES = aclocal.m4 build-aux/ buildutil/*.m4 config.h.in gtk-doc.make | ||
| 29 | diff --git a/ci/build.sh b/ci/build.sh | ||
| 30 | index 0901507498f2..806af050b780 100755 | ||
| 31 | --- a/ci/build.sh | ||
| 32 | +++ b/ci/build.sh | ||
| 33 | @@ -22,6 +22,11 @@ case "${CONFIGOPTS:-}" in | ||
| 34 | fi | ||
| 35 | ;; | ||
| 36 | esac | ||
| 37 | +# unless libsoup is disabled, enable trivial-httpd for the tests | ||
| 38 | +case "${CONFIGOPTS:-}" in | ||
| 39 | + *--without-soup*) ;; | ||
| 40 | + *) CONFIGOPTS="${CONFIGOPTS:-} --enable-trivial-httpd-cmdline" ;; | ||
| 41 | +esac | ||
| 42 | |||
| 43 | # always fail on warnings; https://github.com/ostreedev/ostree/pull/971 | ||
| 44 | # NB: this disables the default set of flags from configure.ac | ||
| 45 | diff --git a/ci/travis-build.sh b/ci/travis-build.sh | ||
| 46 | index 3fd969bdced6..7c85313a2d32 100755 | ||
| 47 | --- a/ci/travis-build.sh | ||
| 48 | +++ b/ci/travis-build.sh | ||
| 49 | @@ -85,6 +85,7 @@ make="make -j${ci_parallel} V=1 VERBOSE=1" | ||
| 50 | |||
| 51 | ../configure \ | ||
| 52 | --enable-always-build-tests \ | ||
| 53 | + --enable-trivial-httpd-cmdline \ | ||
| 54 | ${ci_configopts} | ||
| 55 | "$@" | ||
| 56 | |||
| 57 | -- | ||
| 58 | 2.17.1 | ||
| 59 | |||
diff --git a/meta-oe/recipes-extended/ostree/ostree/0001-build-create-tests-directory-for-split-builds.patch b/meta-oe/recipes-extended/ostree/ostree/0001-build-create-tests-directory-for-split-builds.patch new file mode 100644 index 0000000000..d94b3ded9b --- /dev/null +++ b/meta-oe/recipes-extended/ostree/ostree/0001-build-create-tests-directory-for-split-builds.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 114fe5067b58a2434b44855eee48f865186fe0fa Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 3 | Date: Tue, 5 Nov 2019 22:26:23 +0000 | ||
| 4 | Subject: [PATCH] build: create tests directory for split builds | ||
| 5 | |||
| 6 | When `--disable-dependency-tracking` is in effect with separate build | ||
| 7 | directory, the tests directory isn't created as a result of the | ||
| 8 | dependency generation, which leads to a build race for the tests | ||
| 9 | directory being created and failures: | ||
| 10 | |||
| 11 | Making all in . | ||
| 12 | make[2]: Entering directory 'TOPDIR/build/tmp/work/riscv64-yoe-linux-musl/ostree/2019.5-r0/build' | ||
| 13 | (echo '[Test]' > tests/test-local-pull-depth.sh.test.tmp; \ | ||
| 14 | echo 'Type=session' >> tests/test-local-pull-depth.sh.test.tmp; \ | ||
| 15 | echo 'Exec=env G_TEST_SRCDIR=/usr/libexec/installed-tests/libostree G_TEST_BUILDDIR=/usr/libexec/installed-tests/libostree /usr/libexec/installed-tests/libostree/test-local-pull-depth.sh' >> tests/test-local-pull-depth.sh.test.tmp; \ | ||
| 16 | mv tests/test-local-pull-depth.sh.test.tmp tests/test-local-pull-depth.sh.test) | ||
| 17 | /bin/sh: tests/test-local-pull-depth.sh.test.tmp: No such file or directory | ||
| 18 | /bin/sh: line 1: tests/test-local-pull-depth.sh.test.tmp: No such file or directory | ||
| 19 | /bin/sh: line 2: tests/test-local-pull-depth.sh.test.tmp: No such file or directory | ||
| 20 | mv: cannot stat 'tests/test-local-pull-depth.sh.test.tmp': No such file or directory | ||
| 21 | make[2]: *** [Makefile:9282: tests/test-local-pull-depth.sh.test] Error 1 | ||
| 22 | |||
| 23 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 24 | Upstream-Status: Pending | ||
| 25 | --- | ||
| 26 | buildutil/glib-tap.mk | 1 + | ||
| 27 | 1 file changed, 1 insertion(+) | ||
| 28 | |||
| 29 | diff --git a/buildutil/glib-tap.mk b/buildutil/glib-tap.mk | ||
| 30 | index 34b8f21ea26a..9a944a0acc88 100644 | ||
| 31 | --- a/buildutil/glib-tap.mk | ||
| 32 | +++ b/buildutil/glib-tap.mk | ||
| 33 | @@ -116,6 +116,7 @@ installed_testcases = $(test_programs) $(installed_test_programs) \ | ||
| 34 | installed_test_meta_DATA = $(installed_testcases:=.test) | ||
| 35 | |||
| 36 | %.test: %$(EXEEXT) Makefile | ||
| 37 | + @$(MKDIR_P) $(dir $@) | ||
| 38 | $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ | ||
| 39 | echo 'Type=session' >> $@.tmp; \ | ||
| 40 | echo 'Exec=env G_TEST_SRCDIR=$(installed_testdir) G_TEST_BUILDDIR=$(installed_testdir) $(installed_testdir)/$(notdir $<)' >> $@.tmp; \ | ||
| 41 | -- | ||
| 42 | 2.17.1 | ||
| 43 | |||
diff --git a/meta-oe/recipes-extended/ostree/ostree/0001-tests-Handle-EPIPE-failures-when-head-terminates.patch b/meta-oe/recipes-extended/ostree/ostree/0001-tests-Handle-EPIPE-failures-when-head-terminates.patch new file mode 100644 index 0000000000..fdb733ebe4 --- /dev/null +++ b/meta-oe/recipes-extended/ostree/ostree/0001-tests-Handle-EPIPE-failures-when-head-terminates.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | From fb519f0361565cad0d340095263a1e8866ec4f89 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 3 | Date: Thu, 31 Oct 2019 11:30:00 +0000 | ||
| 4 | Subject: [PATCH 1/3] tests: Handle EPIPE failures when head terminates | ||
| 5 | |||
| 6 | When using musl, it appears that the default is line buffered output, so | ||
| 7 | when `head -1` reads from a pipe we have to handle the source end of the | ||
| 8 | pipe getting EPIPE. | ||
| 9 | |||
| 10 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 11 | Upstream-Status: Accepted [v2019.6] | ||
| 12 | --- | ||
| 13 | tests/pull-test.sh | 2 +- | ||
| 14 | tests/test-pull-mirrorlist.sh | 4 ++-- | ||
| 15 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/tests/pull-test.sh b/tests/pull-test.sh | ||
| 18 | index 0a97a1195582..2cfd8e02f790 100644 | ||
| 19 | --- a/tests/pull-test.sh | ||
| 20 | +++ b/tests/pull-test.sh | ||
| 21 | @@ -177,7 +177,7 @@ if ! skip_one_without_user_xattrs; then | ||
| 22 | ${CMD_PREFIX} ostree --repo=cacherepo pull-local ostree-srv/gnomerepo main | ||
| 23 | rev=$(ostree --repo=cacherepo rev-parse main) | ||
| 24 | ${CMD_PREFIX} ostree --repo=cacherepo ls -R -C main > ls.txt | ||
| 25 | - regfile_hash=$(grep -E -e '^-0' ls.txt | head -1 | awk '{ print $5 }') | ||
| 26 | + regfile_hash=$((grep -E -e '^-0' ls.txt || true) | head -1 | awk '{ print $5 }') | ||
| 27 | ${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false corruptrepo $(cat httpd-address)/ostree/corruptrepo | ||
| 28 | # Make this a loop so in the future we can add more object types like commit etc. | ||
| 29 | for object in ${regfile_hash}.file; do | ||
| 30 | diff --git a/tests/test-pull-mirrorlist.sh b/tests/test-pull-mirrorlist.sh | ||
| 31 | index 4e44852d3971..85ff66e99f8e 100755 | ||
| 32 | --- a/tests/test-pull-mirrorlist.sh | ||
| 33 | +++ b/tests/test-pull-mirrorlist.sh | ||
| 34 | @@ -47,12 +47,12 @@ setup_mirror content_mirror3 | ||
| 35 | |||
| 36 | # Let's delete a file from 1 so that it falls back on 2 | ||
| 37 | cd ${test_tmpdir}/content_mirror1/ostree/gnomerepo | ||
| 38 | -filez=$(find objects/ -name '*.filez' | head -n 1) | ||
| 39 | +filez=$((find objects/ -name '*.filez' || true) | head -n 1) | ||
| 40 | rm ${filez} | ||
| 41 | |||
| 42 | # Let's delete a file from 1 and 2 so that it falls back on 3 | ||
| 43 | cd ${test_tmpdir}/content_mirror1/ostree/gnomerepo | ||
| 44 | -filez=$(find objects/ -name '*.filez' | head -n 1) | ||
| 45 | +filez=$((find objects/ -name '*.filez' || true) | head -n 1) | ||
| 46 | rm ${filez} | ||
| 47 | cd ${test_tmpdir}/content_mirror2/ostree/gnomerepo | ||
| 48 | rm ${filez} | ||
| 49 | -- | ||
| 50 | 2.17.1 | ||
| 51 | |||
diff --git a/meta-oe/recipes-extended/ostree/ostree/0001-tests-core-Fallback-to-en_US.UTF-8-locale.patch b/meta-oe/recipes-extended/ostree/ostree/0001-tests-core-Fallback-to-en_US.UTF-8-locale.patch new file mode 100644 index 0000000000..dcafb09957 --- /dev/null +++ b/meta-oe/recipes-extended/ostree/ostree/0001-tests-core-Fallback-to-en_US.UTF-8-locale.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 4d17cd917fe4fb67d2f9e4881b6693ac7289f423 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 3 | Date: Wed, 30 Oct 2019 07:55:41 +0000 | ||
| 4 | Subject: [PATCH 1/4] tests/core: Fallback to en_US.UTF-8 locale | ||
| 5 | |||
| 6 | A number of tests expect explicit left/right single quotes in their | ||
| 7 | messages, which will never happen in the C locale. Change so we pick a | ||
| 8 | likely UTF-8 locale, or fail if we can't find one. | ||
| 9 | |||
| 10 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 11 | Upstream-Status: Accepted [v2019.6] | ||
| 12 | --- | ||
| 13 | tests/libtest-core.sh | 12 ++++-------- | ||
| 14 | 1 file changed, 4 insertions(+), 8 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/tests/libtest-core.sh b/tests/libtest-core.sh | ||
| 17 | index f6f94288fc61..bc191332c916 100644 | ||
| 18 | --- a/tests/libtest-core.sh | ||
| 19 | +++ b/tests/libtest-core.sh | ||
| 20 | @@ -35,15 +35,11 @@ assert_not_reached () { | ||
| 21 | } | ||
| 22 | |||
| 23 | # Some tests look for specific English strings. Use a UTF-8 version | ||
| 24 | -# of the C (POSIX) locale if we have one, or fall back to POSIX | ||
| 25 | +# of the C (POSIX) locale if we have one, or fall back to en_US.UTF-8 | ||
| 26 | # (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8) | ||
| 27 | -if locale -a | grep '^C.UTF-8$' >/dev/null; then | ||
| 28 | - export LC_ALL=C.UTF-8 | ||
| 29 | -elif locale -a | grep '^C.utf8$' >/dev/null; then | ||
| 30 | - export LC_ALL=C.utf8 | ||
| 31 | -else | ||
| 32 | - export LC_ALL=C | ||
| 33 | -fi | ||
| 34 | +export LC_ALL=$(locale -a | grep -Ee '\.(UTF-8|utf8)' | grep -iEe '^(C|en_US)' | head -1 || true) | ||
| 35 | +if [ -z "${LC_ALL}" ]; then fatal "Can't find suitable UTF-8 locale"; fi | ||
| 36 | + | ||
| 37 | # A GNU extension, used whenever LC_ALL is not C | ||
| 38 | unset LANGUAGE | ||
| 39 | |||
| 40 | -- | ||
| 41 | 2.17.1 | ||
| 42 | |||
diff --git a/meta-oe/recipes-extended/ostree/ostree/0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch b/meta-oe/recipes-extended/ostree/ostree/0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch deleted file mode 100644 index 362b2f36ab..0000000000 --- a/meta-oe/recipes-extended/ostree/ostree/0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | From 2629328b39ae117876f4854409c2231220a30b9c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 3 | Date: Thu, 5 Sep 2019 13:22:15 +0100 | ||
| 4 | Subject: [PATCH 2/2] Gate ostree-trivial-httpd on BUILDOPT_TRIVIAL_HTTPD | ||
| 5 | |||
| 6 | When building without --enable-trivial-httpd-cmdline, don't build or install | ||
| 7 | the ostree-trivial-httpd binary. | ||
| 8 | |||
| 9 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 10 | Upstream-Status: Submitted [https://github.com/ostreedev/ostree/pull/1912] | ||
| 11 | --- | ||
| 12 | Makefile-ostree.am | 3 ++- | ||
| 13 | configure.ac | 3 +++ | ||
| 14 | 2 files changed, 5 insertions(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/Makefile-ostree.am b/Makefile-ostree.am | ||
| 17 | index 76f39cad4b74..7b53cb148960 100644 | ||
| 18 | --- a/Makefile-ostree.am | ||
| 19 | +++ b/Makefile-ostree.am | ||
| 20 | @@ -143,12 +143,13 @@ ostree_SOURCES += src/ostree/ot-builtin-pull.c | ||
| 21 | endif | ||
| 22 | |||
| 23 | if USE_LIBSOUP | ||
| 24 | -# Eventually once we stop things from using this, we should support disabling this | ||
| 25 | +if BUILDOPT_TRIVIAL_HTTPD | ||
| 26 | ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c | ||
| 27 | pkglibexec_PROGRAMS += ostree-trivial-httpd | ||
| 28 | ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c | ||
| 29 | ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS) | ||
| 30 | ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS) | ||
| 31 | +endif | ||
| 32 | |||
| 33 | if !USE_CURL | ||
| 34 | # This is necessary for the cookie jar bits | ||
| 35 | diff --git a/configure.ac b/configure.ac | ||
| 36 | index 069bab01752e..ffc67980d507 100644 | ||
| 37 | --- a/configure.ac | ||
| 38 | +++ b/configure.ac | ||
| 39 | @@ -192,6 +192,9 @@ AC_ARG_ENABLE(trivial-httpd-cmdline, | ||
| 40 | [Continue to support "ostree trivial-httpd" [default=no]])],, | ||
| 41 | enable_trivial_httpd_cmdline=no) | ||
| 42 | AM_CONDITIONAL(BUILDOPT_TRIVIAL_HTTPD, test x$enable_trivial_httpd_cmdline = xyes) | ||
| 43 | +AS_IF([test x$with_soup = xno && test x$enable_trivial_httpd_cmdline = xyes], [ | ||
| 44 | + AC_MSG_ERROR([trivial-httpd enabled, but libsoup is not; libsoup is needed for trivial-httpd]) | ||
| 45 | +]) | ||
| 46 | AM_COND_IF(BUILDOPT_TRIVIAL_HTTPD, | ||
| 47 | [AC_DEFINE([BUILDOPT_ENABLE_TRIVIAL_HTTPD_CMDLINE], 1, [Define if we are enabling ostree trivial-httpd entrypoint])] | ||
| 48 | ) | ||
| 49 | -- | ||
| 50 | 2.17.1 | ||
| 51 | |||
diff --git a/meta-oe/recipes-extended/ostree/ostree/0002-tests-core-Assume-C.UTF-8-if-locale-isn-t-found.patch b/meta-oe/recipes-extended/ostree/ostree/0002-tests-core-Assume-C.UTF-8-if-locale-isn-t-found.patch new file mode 100644 index 0000000000..5ab9c8f6d7 --- /dev/null +++ b/meta-oe/recipes-extended/ostree/ostree/0002-tests-core-Assume-C.UTF-8-if-locale-isn-t-found.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | From 3d48021fb0892721fab8359b49470e521aaed493 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 3 | Date: Thu, 31 Oct 2019 11:28:07 +0000 | ||
| 4 | Subject: [PATCH 2/3] tests/core: Assume C.UTF-8 if locale isn't found | ||
| 5 | |||
| 6 | When building with musl there's no locale command, also its default | ||
| 7 | locale is C.UTF-8, so just get C.UTF-8 if we can't find locale. | ||
| 8 | |||
| 9 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 10 | Upstream-Status: Accepted [v2019.6] | ||
| 11 | --- | ||
| 12 | tests/libtest-core.sh | 12 +++++++++--- | ||
| 13 | 1 file changed, 9 insertions(+), 3 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/tests/libtest-core.sh b/tests/libtest-core.sh | ||
| 16 | index bc191332c916..46aafab03cc8 100644 | ||
| 17 | --- a/tests/libtest-core.sh | ||
| 18 | +++ b/tests/libtest-core.sh | ||
| 19 | @@ -37,9 +37,15 @@ assert_not_reached () { | ||
| 20 | # Some tests look for specific English strings. Use a UTF-8 version | ||
| 21 | # of the C (POSIX) locale if we have one, or fall back to en_US.UTF-8 | ||
| 22 | # (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8) | ||
| 23 | -export LC_ALL=$(locale -a | grep -Ee '\.(UTF-8|utf8)' | grep -iEe '^(C|en_US)' | head -1 || true) | ||
| 24 | -if [ -z "${LC_ALL}" ]; then fatal "Can't find suitable UTF-8 locale"; fi | ||
| 25 | - | ||
| 26 | +# | ||
| 27 | +# If we can't find the locale command assume we have support for C.UTF-8 | ||
| 28 | +# (e.g. musl based systems) | ||
| 29 | +if type -p locale >/dev/null; then | ||
| 30 | + export LC_ALL=$(locale -a | grep -Ee '\.(UTF-8|utf8)' | grep -iEe '^(C|en_US)' | head -1 || true) | ||
| 31 | + if [ -z "${LC_ALL}" ]; then fatal "Can't find suitable UTF-8 locale"; fi | ||
| 32 | +else | ||
| 33 | + export LC_ALL=C.UTF-8 | ||
| 34 | +fi | ||
| 35 | # A GNU extension, used whenever LC_ALL is not C | ||
| 36 | unset LANGUAGE | ||
| 37 | |||
| 38 | -- | ||
| 39 | 2.17.1 | ||
| 40 | |||
diff --git a/meta-oe/recipes-extended/ostree/ostree/0003-tests-Avoid-musl-failure-with-cp-a.patch b/meta-oe/recipes-extended/ostree/ostree/0003-tests-Avoid-musl-failure-with-cp-a.patch new file mode 100644 index 0000000000..834617c12d --- /dev/null +++ b/meta-oe/recipes-extended/ostree/ostree/0003-tests-Avoid-musl-failure-with-cp-a.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From abf1a7392b2fa1945286a39a35190d74fe141e52 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 3 | Date: Thu, 31 Oct 2019 17:09:36 +0000 | ||
| 4 | Subject: [PATCH 3/3] tests: Avoid musl failure with `cp -a` | ||
| 5 | |||
| 6 | When copying the tree, using musl and GNU coreutils, something gets confused | ||
| 7 | when setting the ownership of symlinks and the copy fails with: | ||
| 8 | |||
| 9 | cp: failed to preserve ownership for osdata-devel/bin: Not supported | ||
| 10 | |||
| 11 | Rework using tar to avoid the problem. | ||
| 12 | |||
| 13 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 14 | Upstream-Status: Accepted [v2019.6] | ||
| 15 | --- | ||
| 16 | tests/libtest.sh | 4 +++- | ||
| 17 | tests/test-admin-gpg.sh | 4 +++- | ||
| 18 | 2 files changed, 6 insertions(+), 2 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/tests/libtest.sh b/tests/libtest.sh | ||
| 21 | index ba00073a10a7..3f5fd931bc1e 100755 | ||
| 22 | --- a/tests/libtest.sh | ||
| 23 | +++ b/tests/libtest.sh | ||
| 24 | @@ -440,7 +440,9 @@ EOF | ||
| 25 | ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" | ||
| 26 | |||
| 27 | cd ${test_tmpdir} | ||
| 28 | - cp -a osdata osdata-devel | ||
| 29 | + rm -rf osdata-devel | ||
| 30 | + mkdir osdata-devel | ||
| 31 | + tar -C osdata -cf - . | tar -C osdata-devel -xf - | ||
| 32 | cd osdata-devel | ||
| 33 | mkdir -p usr/include | ||
| 34 | echo "a development header" > usr/include/foo.h | ||
| 35 | diff --git a/tests/test-admin-gpg.sh b/tests/test-admin-gpg.sh | ||
| 36 | index 1f50c8a9a508..dc776743776c 100755 | ||
| 37 | --- a/tests/test-admin-gpg.sh | ||
| 38 | +++ b/tests/test-admin-gpg.sh | ||
| 39 | @@ -90,7 +90,9 @@ EOF | ||
| 40 | ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome | ||
| 41 | |||
| 42 | cd ${test_tmpdir} | ||
| 43 | - cp -a osdata osdata-devel | ||
| 44 | + rm -rf osdata-devel | ||
| 45 | + mkdir osdata-devel | ||
| 46 | + tar -C osdata -cf - . | tar -C osdata-devel -xf - | ||
| 47 | cd osdata-devel | ||
| 48 | mkdir -p usr/include | ||
| 49 | echo "a development header" > usr/include/foo.h | ||
| 50 | -- | ||
| 51 | 2.17.1 | ||
| 52 | |||
diff --git a/meta-oe/recipes-extended/ostree/ostree/run-ptest b/meta-oe/recipes-extended/ostree/ostree/run-ptest new file mode 100644 index 0000000000..963d1f6928 --- /dev/null +++ b/meta-oe/recipes-extended/ostree/ostree/run-ptest | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | |||
| 3 | gnome-desktop-testing-runner libostree | ||
diff --git a/meta-oe/recipes-extended/ostree/ostree_2019.4.bb b/meta-oe/recipes-extended/ostree/ostree_2019.4.bb index 505c9fcccc..f438b35ebe 100644 --- a/meta-oe/recipes-extended/ostree/ostree_2019.4.bb +++ b/meta-oe/recipes-extended/ostree/ostree_2019.4.bb | |||
| @@ -25,8 +25,12 @@ PREMIRRORS = "" | |||
| 25 | SRC_URI = " \ | 25 | SRC_URI = " \ |
| 26 | gitsm://github.com/ostreedev/ostree \ | 26 | gitsm://github.com/ostreedev/ostree \ |
| 27 | file://0001-macros-Add-TEMP_FAILURE_RETRY-for-musl.patch \ | 27 | file://0001-macros-Add-TEMP_FAILURE_RETRY-for-musl.patch \ |
| 28 | file://0001-Always-enable-trivial-httpd-for-tests.patch \ | 28 | file://run-ptest \ |
| 29 | file://0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch \ | 29 | file://0001-tests-core-Fallback-to-en_US.UTF-8-locale.patch \ |
| 30 | file://0001-tests-Handle-EPIPE-failures-when-head-terminates.patch \ | ||
| 31 | file://0002-tests-core-Assume-C.UTF-8-if-locale-isn-t-found.patch \ | ||
| 32 | file://0003-tests-Avoid-musl-failure-with-cp-a.patch \ | ||
| 33 | file://0001-build-create-tests-directory-for-split-builds.patch \ | ||
| 30 | " | 34 | " |
| 31 | SRCREV = "9d39e7d91e8497987cad69a3fbed5c5fc91eebdc" | 35 | SRCREV = "9d39e7d91e8497987cad69a3fbed5c5fc91eebdc" |
| 32 | 36 | ||
| @@ -34,9 +38,9 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+)" | |||
| 34 | 38 | ||
| 35 | S = "${WORKDIR}/git" | 39 | S = "${WORKDIR}/git" |
| 36 | 40 | ||
| 37 | inherit autotools bash-completion gobject-introspection gtk-doc pkgconfig systemd | 41 | inherit autotools bash-completion gobject-introspection gtk-doc pkgconfig ptest-gnome systemd |
| 38 | 42 | ||
| 39 | # package configuration - match ostree defaults, but without rofiles-fuse | 43 | # Package configuration - match ostree defaults, but without rofiles-fuse |
| 40 | # otherwise we introduce a dependendency on meta-filesystems | 44 | # otherwise we introduce a dependendency on meta-filesystems |
| 41 | PACKAGECONFIG ??= " \ | 45 | PACKAGECONFIG ??= " \ |
| 42 | ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \ | 46 | ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \ |
| @@ -107,6 +111,7 @@ PACKAGES += " \ | |||
| 107 | ${PN}-grub \ | 111 | ${PN}-grub \ |
| 108 | ${PN}-mkinitcpio \ | 112 | ${PN}-mkinitcpio \ |
| 109 | ${PN}-switchroot \ | 113 | ${PN}-switchroot \ |
| 114 | ${PN}-trivial-httpd \ | ||
| 110 | " | 115 | " |
| 111 | 116 | ||
| 112 | FILES_${PN} = " \ | 117 | FILES_${PN} = " \ |
| @@ -118,7 +123,6 @@ FILES_${PN} = " \ | |||
| 118 | ${libdir}/girepository-1.0 \ | 123 | ${libdir}/girepository-1.0 \ |
| 119 | ${libdir}/lib*${SOLIBS} \ | 124 | ${libdir}/lib*${SOLIBS} \ |
| 120 | ${libdir}/tmpfiles.d/ostree-tmpfiles.conf \ | 125 | ${libdir}/tmpfiles.d/ostree-tmpfiles.conf \ |
| 121 | ${libexecdir}/libostree/ostree-trivial-httpd \ | ||
| 122 | ${sysconfdir}/ostree/remotes.d \ | 126 | ${sysconfdir}/ostree/remotes.d \ |
| 123 | ${systemd_unitdir}/system-generators/ostree-system-generator \ | 127 | ${systemd_unitdir}/system-generators/ostree-system-generator \ |
| 124 | ${systemd_unitdir}/system/ostree-finalize-staged.path \ | 128 | ${systemd_unitdir}/system/ostree-finalize-staged.path \ |
| @@ -141,17 +145,48 @@ FILES_${PN}-switchroot = " \ | |||
| 141 | ${libdir}/ostree/ostree-prepare-root \ | 145 | ${libdir}/ostree/ostree-prepare-root \ |
| 142 | ${systemd_unitdir}/system/ostree-prepare-root.service \ | 146 | ${systemd_unitdir}/system/ostree-prepare-root.service \ |
| 143 | " | 147 | " |
| 148 | FILES_${PN}-trivial-httpd = " \ | ||
| 149 | ${libexecdir}/libostree/ostree-trivial-httpd \ | ||
| 150 | " | ||
| 144 | 151 | ||
| 152 | RDEPENDS_${PN} = " \ | ||
| 153 | ${@bb.utils.contains('PACKAGECONFIG', 'trivial-httpd-cmdline', '${PN}-trivial-httpd', '', d)} \ | ||
| 154 | " | ||
| 145 | RDEPENDS_${PN}-dracut = "bash" | 155 | RDEPENDS_${PN}-dracut = "bash" |
| 146 | RDEPENDS_${PN}-mkinitcpio = "bash" | 156 | RDEPENDS_${PN}-mkinitcpio = "bash" |
| 147 | RDEPENDS_${PN}_class-target = " \ | 157 | RDEPENDS_${PN}_class-target = " \ |
| 148 | gnupg \ | 158 | gnupg \ |
| 149 | ${PN}-switchroot \ | 159 | ${PN}-switchroot \ |
| 150 | " | 160 | " |
| 161 | RDEPENDS_${PN}-ptest += " \ | ||
| 162 | attr \ | ||
| 163 | bash \ | ||
| 164 | coreutils \ | ||
| 165 | cpio \ | ||
| 166 | diffutils \ | ||
| 167 | findutils \ | ||
| 168 | grep \ | ||
| 169 | python3-core \ | ||
| 170 | python3-multiprocessing \ | ||
| 171 | python3-pyyaml \ | ||
| 172 | ${PN}-trivial-httpd \ | ||
| 173 | " | ||
| 174 | RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils glibc-localedata-en-us" | ||
| 151 | 175 | ||
| 152 | RRECOMMENDS_${PN} += "kernel-module-overlay" | 176 | RRECOMMENDS_${PN} += "kernel-module-overlay" |
| 177 | RRECOMMENDS_${PN}-ptest += "strace" | ||
| 153 | 178 | ||
| 154 | SYSTEMD_SERVICE_${PN} = "ostree-remount.service ostree-finalize-staged.path" | 179 | SYSTEMD_SERVICE_${PN} = "ostree-remount.service ostree-finalize-staged.path" |
| 155 | SYSTEMD_SERVICE_${PN}-switchroot = "ostree-prepare-root.service" | 180 | SYSTEMD_SERVICE_${PN}-switchroot = "ostree-prepare-root.service" |
| 156 | 181 | ||
| 157 | BBCLASSEXTEND = "native" | 182 | BBCLASSEXTEND = "native" |
| 183 | |||
| 184 | python __anonymous() { | ||
| 185 | if bb.utils.contains('PTEST_ENABLED', '1', 'True', 'False', d): | ||
| 186 | if 'meta-python' not in d.getVar('BBFILE_COLLECTIONS').split(): | ||
| 187 | raise bb.parse.SkipRecipe('ptest requires meta-python to be present.') | ||
| 188 | elif 'soup' not in d.getVar('PACKAGECONFIG').split(): | ||
| 189 | raise bb.parse.SkipRecipe('ptest requires soup enabled in PACKAGECONFIG.') | ||
| 190 | elif not oe.utils.any_distro_features(d, "xattr"): | ||
| 191 | raise bb.parse.SkipRecipe('ptest requires xattr enabled in DISTRO_FEATURES.') | ||
| 192 | } | ||
