vmcheck/test-basic.sh: strengthen pkg-add test

This test would actually fail even if the bin user were allowed to
install a package because there are no enabled repos to install. Fix it
so that we know we have foo there and explicitly check that the error
message is what we expect.

Closes: #894
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2017-07-26 21:08:23 -07:00 committed by Atomic Bot
parent 577aef98e2
commit f6c422a6d5

View File

@ -38,9 +38,11 @@ echo "ok empty pkg arrays in status json"
vm_cmd getent passwd bin
# Make sure we can't layer as non-root
if vm_cmd "runuser -u bin rpm-ostree pkg-add foo-1.0"; then
vm_build_rpm foo
if vm_cmd "runuser -u bin rpm-ostree pkg-add foo" &> err.txt; then
assert_not_reached "Was able to install a package as non-root!"
fi
assert_file_has_content err.txt 'PkgChange not allowed for user'
echo "ok layering requires root"
# Assert that we can do status as non-root