diff --git a/debian/patches/In-tests-that-use-gpg-terminate-the-gpg-agent-after-testi.patch b/debian/patches/In-tests-that-use-gpg-terminate-the-gpg-agent-after-testi.patch index 7b6fff29..15032e06 100644 --- a/debian/patches/In-tests-that-use-gpg-terminate-the-gpg-agent-after-testi.patch +++ b/debian/patches/In-tests-that-use-gpg-terminate-the-gpg-agent-after-testi.patch @@ -5,7 +5,7 @@ Subject: In tests that use gpg, terminate the gpg-agent after testing Otherwise we leak those processes. Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/b25ddd29ab8eb56bc1022dd38758e54dc4b2ccbe +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/b25ddd29ab8eb56bc1022dd38758e54dc4b2ccbe --- tests/test-commit-sign.sh | 1 + tests/test-gpg-signed-commit.sh | 2 ++ diff --git a/debian/patches/Load-g-i-bindings-from-builddir-during-build-time-testing.patch b/debian/patches/Load-g-i-bindings-from-builddir-during-build-time-testing.patch index 6542d01a..cb673ce6 100644 --- a/debian/patches/Load-g-i-bindings-from-builddir-during-build-time-testing.patch +++ b/debian/patches/Load-g-i-bindings-from-builddir-during-build-time-testing.patch @@ -1,28 +1,26 @@ From: Simon McVittie -Date: Thu, 31 Mar 2016 09:02:23 +0100 +Date: Thu, 31 Mar 2016 18:36:04 +0100 Subject: Load g-i bindings from builddir during build-time testing Previously, the build-time tests would only pass if the g-i bindings to OSTree were already installed, with a reasonably similar version. Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/07aa8e1c76463e3de0ffc79d0271773ababf05b4 -[smcv: rebased on 2016.4] +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/07aa8e1c76463e3de0ffc79d0271773ababf05b4 +[smcv: backport to 2016.4] --- - Makefile-tests.am | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) + Makefile-tests.am | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile-tests.am b/Makefile-tests.am -index 9eb9ad8..f10c23f 100644 +index 9eb9ad8..e7c2395 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am -@@ -23,7 +23,12 @@ include $(top_srcdir)/buildutil/glib-tap.mk +@@ -23,7 +23,10 @@ include $(top_srcdir)/buildutil/glib-tap.mk # include the builddir in $PATH so we find our just-built ostree # binary. TESTS_ENVIRONMENT += OT_TESTS_DEBUG=1 \ - PATH=$$(cd $(top_builddir) && pwd):$${PATH} -+ SRCDIR=$$(cd $(top_srcdir) && pwd) \ -+ BUILDDIR=$$(cd $(top_builddir) && pwd) \ + GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd) \ + LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd) \ + PATH=$$(cd $(top_builddir) && pwd):$${PATH} \ diff --git a/debian/patches/Probe-for-GNU-parallel-more-accurately.patch b/debian/patches/Probe-for-GNU-parallel-more-accurately.patch index 6532bd87..d13e53af 100644 --- a/debian/patches/Probe-for-GNU-parallel-more-accurately.patch +++ b/debian/patches/Probe-for-GNU-parallel-more-accurately.patch @@ -16,7 +16,7 @@ some versions optionally supported an incompatible command-line syntax taken from moreutils parallel. Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/9dafc820241ed6e663ad4093660fc255f549aa26 +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/9dafc820241ed6e663ad4093660fc255f549aa26 --- tests/test-admin-locking.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/patches/Skip-tests-that-run-rofiles-fuse-if-dev-fuse-or-etc-mtab-.patch b/debian/patches/Skip-tests-that-run-rofiles-fuse-if-dev-fuse-or-etc-mtab-.patch index 08b683e5..a0a548b2 100644 --- a/debian/patches/Skip-tests-that-run-rofiles-fuse-if-dev-fuse-or-etc-mtab-.patch +++ b/debian/patches/Skip-tests-that-run-rofiles-fuse-if-dev-fuse-or-etc-mtab-.patch @@ -4,7 +4,7 @@ Subject: Skip tests that run rofiles-fuse if /dev/fuse or /etc/mtab unavailable Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/e1ce859368b41c863fe096df84f1ff33e90d725f +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/e1ce859368b41c863fe096df84f1ff33e90d725f --- tests/libtest.sh | 17 +++++++++++++++++ tests/test-demo-buildsystem.sh | 6 +----- diff --git a/debian/patches/Symlink-libreaddir-rand.so-into-tests-directory.patch b/debian/patches/Symlink-libreaddir-rand.so-into-tests-directory.patch index ef8cae10..a2f96746 100644 --- a/debian/patches/Symlink-libreaddir-rand.so-into-tests-directory.patch +++ b/debian/patches/Symlink-libreaddir-rand.so-into-tests-directory.patch @@ -5,7 +5,7 @@ Subject: Symlink libreaddir-rand.so into tests directory This means it can be LD_PRELOADed during build-time testing. Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/f8bef792cb9cdd8b9cd174dad5856727db3b9bad +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/f8bef792cb9cdd8b9cd174dad5856727db3b9bad --- .gitignore | 1 + Makefile-decls.am | 3 +++ diff --git a/debian/patches/libtest.sh-only-check-whether-pwd-is-empty-once.patch b/debian/patches/libtest.sh-only-check-whether-pwd-is-empty-once.patch new file mode 100644 index 00000000..1fc111a9 --- /dev/null +++ b/debian/patches/libtest.sh-only-check-whether-pwd-is-empty-once.patch @@ -0,0 +1,31 @@ +From: Simon McVittie +Date: Thu, 31 Mar 2016 17:52:57 +0100 +Subject: libtest.sh: only check whether $(pwd) is empty once + +test-sysroot.js runs libtestExec() twice, one of which is after +creating non-hidden directories in $(pwd), so this check needs to be +skipped the second time. + +Signed-off-by: Simon McVittie +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/18e9169d7ae76149833475c14f4c7147f6f91c9e +--- + tests/libtest.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/libtest.sh b/tests/libtest.sh +index f588e65..f22ba4b 100755 +--- a/tests/libtest.sh ++++ b/tests/libtest.sh +@@ -41,8 +41,12 @@ test_tmpdir=$(pwd) + if ! test -f .testtmp; then + files=$(ls) + if test -n "${files}"; then ++ ls -l + assert_not_reached "test tmpdir=${test_tmpdir} is not empty; run this test via \`make check TESTS=\`, not directly" + fi ++ # Remember that this is an acceptable test $(pwd), for the benefit of ++ # C and JS tests which may source this file again ++ touch .testtmp + fi + + export G_DEBUG=fatal-warnings diff --git a/debian/patches/libtest.sh-use-G_TEST_SRCDIR-G_TEST_BUILDDIR-to-find-reso.patch b/debian/patches/libtest.sh-use-G_TEST_SRCDIR-G_TEST_BUILDDIR-to-find-reso.patch new file mode 100644 index 00000000..743c1f11 --- /dev/null +++ b/debian/patches/libtest.sh-use-G_TEST_SRCDIR-G_TEST_BUILDDIR-to-find-reso.patch @@ -0,0 +1,109 @@ +From: Simon McVittie +Date: Thu, 31 Mar 2016 18:29:44 +0100 +Subject: libtest.sh: use G_TEST_SRCDIR, G_TEST_BUILDDIR to find resources + +This fixes the bug that in installed-tests that run testlib.sh under +"bash -c" (i.e. the C and JS tests), $(dirname $0) is "." and we can't do +the LD_PRELOAD correctly: + +ERROR: ld.so: object './libreaddir-rand.so' from LD_PRELOAD cannot be +preloaded (cannot open shared object file): ignored. + +Similarly, those tests can't copy gpghome correctly. + +This also removes the confusing situation that SRCDIR in libtest.sh +(which is ${top_srcdir}/tests) does not mean the same thing as SRCDIR +in test-abi.sh (which is just ${top_srcdir}). + +Signed-off-by: Simon McVittie +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/efb86ba9d32a038dd90f47f6e82f578e91b5fef5 +--- + tests/libtest.sh | 18 ++++++++++++++---- + tests/test-archivez.sh | 2 +- + tests/test-delta.sh | 4 ++-- + tests/test-pull-archive-z.sh | 2 +- + 4 files changed, 18 insertions(+), 8 deletions(-) + +diff --git a/tests/libtest.sh b/tests/libtest.sh +index 3e4c4bd..f588e65 100755 +--- a/tests/libtest.sh ++++ b/tests/libtest.sh +@@ -17,7 +17,17 @@ + # Free Software Foundation, Inc., 59 Temple Place - Suite 330, + # Boston, MA 02111-1307, USA. + +-SRCDIR=$(dirname $0) ++if [ -n "${G_TEST_SRCDIR:-}" ]; then ++ test_srcdir="${G_TEST_SRCDIR}/tests" ++else ++ test_srcdir=$(dirname $0) ++fi ++ ++if [ -n "${G_TEST_BUILDDIR:-}" ]; then ++ test_builddir="${G_TEST_BUILDDIR}/tests" ++else ++ test_builddir=$(dirname $0) ++fi + + assert_not_reached () { + echo $@ 1>&2; exit 1 +@@ -54,7 +64,7 @@ export TEST_GPG_KEYID_3="DF444D67" + # homedir in order to create lockfiles. Work around + # this by copying locally. + echo "Copying gpghome to ${test_tmpdir}" +-cp -a ${SRCDIR}/gpghome ${test_tmpdir} ++cp -a "${test_srcdir}/gpghome" ${test_tmpdir} + export TEST_GPG_KEYHOME=${test_tmpdir}/gpghome + export OSTREE_GPG_HOME=${test_tmpdir}/gpghome/trusted + +@@ -63,9 +73,9 @@ if test -n "${OT_TESTS_DEBUG:-}"; then + fi + + if test -n "${OT_TESTS_VALGRIND:-}"; then +- CMD_PREFIX="env G_SLICE=always-malloc valgrind -q --leak-check=full --num-callers=30 --suppressions=${SRCDIR}/ostree-valgrind.supp" ++ CMD_PREFIX="env G_SLICE=always-malloc valgrind -q --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/ostree-valgrind.supp" + else +- CMD_PREFIX="env LD_PRELOAD=${SRCDIR}/libreaddir-rand.so" ++ CMD_PREFIX="env LD_PRELOAD=${test_builddir}/libreaddir-rand.so" + fi + + assert_streq () { +diff --git a/tests/test-archivez.sh b/tests/test-archivez.sh +index 999157d..b879328 100755 +--- a/tests/test-archivez.sh ++++ b/tests/test-archivez.sh +@@ -25,7 +25,7 @@ echo '1..11' + + setup_test_repository "archive-z2" + +-. ${SRCDIR}/archive-test.sh ++. ${test_srcdir}/archive-test.sh + + cd ${test_tmpdir} + mkdir repo2 +diff --git a/tests/test-delta.sh b/tests/test-delta.sh +index a6fd6f8..411e9b0 100755 +--- a/tests/test-delta.sh ++++ b/tests/test-delta.sh +@@ -130,9 +130,9 @@ assert_streq "${totalsize_orig}" "${totalsize_swapped}" + + echo 'ok generate + show endian swapped' + +-tar xf ${SRCDIR}/pre-endian-deltas-repo-big.tar.xz ++tar xf ${test_srcdir}/pre-endian-deltas-repo-big.tar.xz + mv pre-endian-deltas-repo{,-big} +-tar xf ${SRCDIR}/pre-endian-deltas-repo-little.tar.xz ++tar xf ${test_srcdir}/pre-endian-deltas-repo-little.tar.xz + mv pre-endian-deltas-repo{,-little} + legacy_origrev=$(${CMD_PREFIX} ostree --repo=pre-endian-deltas-repo-big rev-parse main^) + legacy_newrev=$(${CMD_PREFIX} ostree --repo=pre-endian-deltas-repo-big rev-parse main) +diff --git a/tests/test-pull-archive-z.sh b/tests/test-pull-archive-z.sh +index 2ea2387..66f8873 100755 +--- a/tests/test-pull-archive-z.sh ++++ b/tests/test-pull-archive-z.sh +@@ -23,4 +23,4 @@ set -euo pipefail + + setup_fake_remote_repo1 "archive-z2" + +-. ${SRCDIR}/pull-test.sh ++. ${test_srcdir}/pull-test.sh diff --git a/debian/patches/series b/debian/patches/series index e64eb1e1..8f932916 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,3 +7,6 @@ Load-g-i-bindings-from-builddir-during-build-time-testing.patch tests-admin-test.sh-this-is-a-bash-script-not-a-POSIX-sh-.patch Skip-tests-that-run-rofiles-fuse-if-dev-fuse-or-etc-mtab-.patch Probe-for-GNU-parallel-more-accurately.patch +libtest.sh-use-G_TEST_SRCDIR-G_TEST_BUILDDIR-to-find-reso.patch +test-xattrs-sync-how-this-is-skipped-with-test-rofiles-fu.patch +libtest.sh-only-check-whether-pwd-is-empty-once.patch diff --git a/debian/patches/tap-test-clean-up-temporary-test-directories-as-intended.patch b/debian/patches/tap-test-clean-up-temporary-test-directories-as-intended.patch index c7a21e36..45e5e55d 100644 --- a/debian/patches/tap-test-clean-up-temporary-test-directories-as-intended.patch +++ b/debian/patches/tap-test-clean-up-temporary-test-directories-as-intended.patch @@ -9,7 +9,7 @@ This means the various "ostree trivial-httpd --autoexit" processes actually exit, because their web roots are cleaned up now. Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/47fd5c74f1428d4cc02ff0061a4958c4b714e852 +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/47fd5c74f1428d4cc02ff0061a4958c4b714e852 --- buildutil/tap-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/patches/test-xattrs-sync-how-this-is-skipped-with-test-rofiles-fu.patch b/debian/patches/test-xattrs-sync-how-this-is-skipped-with-test-rofiles-fu.patch new file mode 100644 index 00000000..9a88fd67 --- /dev/null +++ b/debian/patches/test-xattrs-sync-how-this-is-skipped-with-test-rofiles-fu.patch @@ -0,0 +1,38 @@ +From: Simon McVittie +Date: Thu, 31 Mar 2016 17:47:36 +0100 +Subject: test-xattrs: sync how this is skipped with test-rofiles-fuse + +If we touch test-xattrs before sourcing libtest.sh, we get: + +test tmpdir=/tmp/test-tmp-ostree_test-xattrs.sh.test-HSEXEY is not +empty; run this test via `make check TESTS=`, not directly + +Signed-off-by: Simon McVittie +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/9c4babf316cfbfad61cfcd0ab8fd5e77e9df13be +--- + tests/test-xattrs.sh | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/tests/test-xattrs.sh b/tests/test-xattrs.sh +index 2f2d99c..cdc06e8 100755 +--- a/tests/test-xattrs.sh ++++ b/tests/test-xattrs.sh +@@ -19,15 +19,11 @@ + + set -euo pipefail + +-touch test-xattrs +-if ! setfattr -n user.testvalue -v somevalue test-xattrs; then +- echo "1..0 # SKIP: cannot run setfattr" +- exit 0 +-fi ++. $(dirname $0)/libtest.sh + +-echo "1..2" ++skip_without_user_xattrs + +-. $(dirname $0)/libtest.sh ++echo "1..2" + + setup_test_repository "archive-z2" + diff --git a/debian/patches/test-xattrs-use-TAP-syntax-to-skip-test.patch b/debian/patches/test-xattrs-use-TAP-syntax-to-skip-test.patch index b730f0fa..e5a169d6 100644 --- a/debian/patches/test-xattrs-use-TAP-syntax-to-skip-test.patch +++ b/debian/patches/test-xattrs-use-TAP-syntax-to-skip-test.patch @@ -3,7 +3,7 @@ Date: Mon, 28 Mar 2016 13:08:32 +0100 Subject: test-xattrs: use TAP syntax to skip test Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/c276025466af4319d603fe8b534dd3463818a168 +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/c276025466af4319d603fe8b534dd3463818a168 --- tests/test-xattrs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/patches/tests-admin-test.sh-this-is-a-bash-script-not-a-POSIX-sh-.patch b/debian/patches/tests-admin-test.sh-this-is-a-bash-script-not-a-POSIX-sh-.patch index e0b228b8..c462a643 100644 --- a/debian/patches/tests-admin-test.sh-this-is-a-bash-script-not-a-POSIX-sh-.patch +++ b/debian/patches/tests-admin-test.sh-this-is-a-bash-script-not-a-POSIX-sh-.patch @@ -7,7 +7,7 @@ PR #226 that he prefers to require bash rather than trying to support every POSIX shell. Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/1dd85513e540ef0b42f2fee7238fa1f710eaa4ca +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/1dd85513e540ef0b42f2fee7238fa1f710eaa4ca --- tests/admin-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/patches/various-tests-skip-if-temp-directory-lacks-xattr-support.patch b/debian/patches/various-tests-skip-if-temp-directory-lacks-xattr-support.patch index d34ec12c..8a340d50 100644 --- a/debian/patches/various-tests-skip-if-temp-directory-lacks-xattr-support.patch +++ b/debian/patches/various-tests-skip-if-temp-directory-lacks-xattr-support.patch @@ -6,7 +6,7 @@ Some autobuilder environments place the entire build chroot on tmpfs, so even /var/tmp might not have this. Signed-off-by: Simon McVittie -Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/3e3755c497bd85e22b01829c5715119d46394687 +Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/3e3755c497bd85e22b01829c5715119d46394687 --- tests/libtest.sh | 8 ++++++++ tests/test-basic-user.sh | 6 ++++--