rpm-ostree/tests/ex-container-tests/test-bash.sh
Colin Walters 3e9c6cf230 Fix "releasever" option, test it by default
In #875 AKA b46fc35901 we
added support for the `releasever` option in treefiles.  I am
pretty sure it worked at the time...but I didn't add tests.

Either it never worked or some refactoring broke it. The whole chain of
`GKeyFile` → `GVariant` is so confusing. Anyways fix it by copying the string.
Now let's use it by default in the compose tests, and while we're here bump
those to F27.

I'm doing this patch now as I was playing with doing a compose from
the `/usr/share/rpm-ostree/treefile.json` and wanted to use the stock
`.repo` files.

Closes: #1220
Approved by: jlebon
2018-01-23 15:18:52 +00:00

35 lines
762 B
Bash
Executable File

#!/usr/bin/bash
set -xeuo pipefail
cd ${test_tmpdir}
dn=$(cd $(dirname $0) && pwd)
. ${dn}/../common/libtest-core.sh
cat >bash.conf <<EOF
[tree]
ref=bash
packages=coreutils;bash;
repos=fedora;
releasever=27
EOF
rpm-ostree ex container assemble bash.conf
ostree --repo=repo fsck -q
ostree --repo=repo ls bash /usr/etc/shadow > shadowls.txt
assert_file_has_content shadowls.txt '^-00400 .*/usr/etc/shadow'
ostree --repo=repo ls bash /usr/share/doc/bash/README >/dev/null
cat >bash-nodocs.conf <<EOF
[tree]
ref=bash-nodocs
packages=coreutils;bash;
repos=fedora;
releasever=27
documentation=false;
EOF
rpm-ostree ex container assemble bash-nodocs.conf
ostree --repo=repo ls bash-nodocs /usr/share/doc/bash >docs.txt
assert_not_file_has_content docs.txt README