Skip to content

Commit

Permalink
test-basic.sh: add test for bad out-of-branch deploy
Browse files Browse the repository at this point in the history
Closes: #495
Approved by: cgwalters
  • Loading branch information
jlebon authored and rh-atomic-bot committed Oct 20, 2016
1 parent 0b6721a commit 2d07772
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/check/test-basic.sh
Expand Up @@ -23,7 +23,7 @@ set -e

ensure_dbus

echo "1..9"
echo "1..10"

setup_os_repository "archive-z2" "syslinux"

Expand Down Expand Up @@ -100,6 +100,15 @@ rpm-ostree status | head --lines 5 | tee OUTPUT-status.txt
assert_file_has_content OUTPUT-status.txt '1\.0\.9'
echo "ok deploy older version by revision"

# Make a commit on a different branch and make sure that it doesn't let us
# deploy it
other_rev=$(ostree --repo=${test_tmpdir}/testos-repo commit -b other-branch --tree=ref=$revision)
if rpm-ostree deploy --os=testos REVISION=$other_rev 2>OUTPUT-err; then
assert_not_reached "Deploying an out-of-branch commit unexpectedly succeeded."
fi
assert_file_has_content OUTPUT-err 'Checksum .* not found in .*'
echo "ok error on deploying commit on other branch"

# Ensure it returns an error when passing a wrong option.
rpm-ostree --help | awk '/^$/ {in_commands=0} {if(in_commands==1){print $0}} /^Builtin Commands:/ {in_commands=1}' > commands
while read command; do
Expand Down

0 comments on commit 2d07772

Please sign in to comment.