From 1e9152f5f697d1d04978febfcf46191114e96cd3 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Mon, 8 Jul 2019 12:22:29 -0400 Subject: [PATCH] tests/compose: Fix unified rev-parse test We were hitting the classic "negative test passes for the wrong reason". It was failing not because it didn't have a parent, but because we didn't pass `--repo`. Fix this and also explicitly check for the error message we expect. --- tests/compose-tests/test-basic-unified.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/compose-tests/test-basic-unified.sh b/tests/compose-tests/test-basic-unified.sh index 64066dcab3..a0b2d6a027 100755 --- a/tests/compose-tests/test-basic-unified.sh +++ b/tests/compose-tests/test-basic-unified.sh @@ -72,7 +72,8 @@ assert_not_streq "${origrev}" "${newrev}" echo "ok rerun" # And check that --no-parent worked. -if ostree rev-parse ${newrev}^; then +if ostree --repo "${repobuild}" rev-parse ${newrev}^ 2>error.txt; then assert_not_reached "New revision has a parent even with --no-parent?" fi +assert_file_has_content_literal error.txt 'has no parent' echo "ok --no-parent"