Skip to content

Commit

Permalink
tests/compose: Fix unified rev-parse test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jlebon committed Jul 8, 2019
1 parent 9142595 commit 1e9152f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/compose-tests/test-basic-unified.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 1e9152f

Please sign in to comment.