From b75cc5f54a1d1269bcb684b378689c01da924524 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 11 Jun 2016 19:54:30 +0100 Subject: [PATCH] Add patches to make sure the tests fail as soon as something goes wrong --- debian/changelog | 8 ++++ debian/patches/series | 2 + ...strict-mode-when-sourcing-libtest.sh.patch | 26 +++++++++++++ ...e-strict-mode-by-default-for-C-tests.patch | 37 +++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 debian/patches/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch create mode 100644 debian/patches/tests-Use-strict-mode-by-default-for-C-tests.patch diff --git a/debian/changelog b/debian/changelog index 94cea7d4..0fabf764 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ostree (2016.5-4) UNRELEASED; urgency=medium + + * d/p/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch, + d/p/tests-Use-strict-mode-by-default-for-C-tests.patch: add patches + to make sure the tests fail as soon as something goes wrong + + -- Simon McVittie Sat, 11 Jun 2016 19:52:40 +0100 + ostree (2016.5-3) unstable; urgency=medium * Remove ostree-grub2 and the boot-related parts of ostree, leaving diff --git a/debian/patches/series b/debian/patches/series index 6fd88097..865fdd1f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,4 @@ libtest-show-files-contents-when-assertions-about-them-fa.patch test-parent-this-test-requires-user-xattrs.patch +tests-Use-strict-mode-by-default-for-C-tests.patch +test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch diff --git a/debian/patches/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch b/debian/patches/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch new file mode 100644 index 00000000..b31f7656 --- /dev/null +++ b/debian/patches/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch @@ -0,0 +1,26 @@ +From: Simon McVittie +Date: Sat, 11 Jun 2016 19:07:40 +0100 +Subject: test-sysroot.js: set "strict mode" when sourcing libtest.sh + +As with the C tests in commit 08580118, this makes sure the test +fails as soon as something goes wrong. + +Signed-off-by: Simon McVittie +Forwarded: https://github.com/ostreedev/ostree/pull/335 +--- + tests/test-sysroot.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test-sysroot.js b/tests/test-sysroot.js +index 9468d2f..7c31659 100644 +--- a/tests/test-sysroot.js ++++ b/tests/test-sysroot.js +@@ -37,7 +37,7 @@ function libtestExec(shellCode) { + let testdatadir = GLib.getenv("G_TEST_SRCDIR"); + let libtestPath = GLib.build_filenamev([testdatadir, 'libtest.sh']) + let proc = GSystem.Subprocess.new_simple_argv(['bash', '-c', +- '. ' + GLib.shell_quote(libtestPath) + '; ' + shellCode], ++ 'set -xeuo pipefail; . ' + GLib.shell_quote(libtestPath) + '; ' + shellCode], + GSystem.SubprocessStreamDisposition.INHERIT, + GSystem.SubprocessStreamDisposition.INHERIT, + null); diff --git a/debian/patches/tests-Use-strict-mode-by-default-for-C-tests.patch b/debian/patches/tests-Use-strict-mode-by-default-for-C-tests.patch new file mode 100644 index 00000000..54d9f56c --- /dev/null +++ b/debian/patches/tests-Use-strict-mode-by-default-for-C-tests.patch @@ -0,0 +1,37 @@ +From: Colin Walters +Date: Mon, 6 Jun 2016 15:00:13 -0400 +Subject: tests: Use strict mode by default for C tests + +I was extending the C-based test suite to cover more, and noticed that +we weren't aborting if a command failed. That made the tests somewhat +less useful, so let's fix it. + +Closes: #321 +Approved by: jlebon +Origin: upstream, commit:085801185125893a53d7a65732c6832f875ed5d6 +--- + tests/libostreetest.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/libostreetest.c b/tests/libostreetest.c +index 5828336..a557ee3 100644 +--- a/tests/libostreetest.c ++++ b/tests/libostreetest.c +@@ -40,7 +40,7 @@ run_libtest (const char *cmd, GError **error) + g_ptr_array_add (argv, "bash"); + g_ptr_array_add (argv, "-c"); + +- g_string_append (cmdstr, ". "); ++ g_string_append (cmdstr, "set -xeuo pipefail; . "); + g_string_append (cmdstr, builddir); + g_string_append (cmdstr, "/tests/libtest.sh; "); + g_string_append (cmdstr, cmd); +@@ -68,7 +68,7 @@ ot_test_setup_repo (GCancellable *cancellable, + g_autoptr(GFile) repo_path = g_file_new_for_path ("repo"); + glnx_unref_object OstreeRepo* ret_repo = NULL; + +- if (!run_libtest ("setup_test_repository", error)) ++ if (!run_libtest ("setup_test_repository archive-z2", error)) + goto out; + + ret_repo = ostree_repo_new (repo_path);