-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In FCOS we have a kola test that basically does `rpm -q python`. It's...a bit silly to spawn a whole VM for this. Ensuring that some specific packages don't get included has come up in a few cases. I think FCOS/RHCOS at least will want to blacklist `dnf` for example. And as noted above, FCOS could blacklist `python`. One major benefit of doing this inside rpm-ostree is that one gets the full "libsolv error message experience" when dependency resolution fails, e.g. blacklisting `glibc` I get: ``` Problem 79: conflicting requests - package coreos-installer-systemd-0.1.2-1.fc31.x86_64 requires coreos-installer = 0.1.2-1.fc31, but none of the providers can be installed - package coreos-installer-0.1.2-1.fc31.x86_64 requires rtld(GNU_HASH), but none of the providers can be installed - package glibc-2.30-10.fc31.x86_64 is filtered out by exclude filtering - package glibc-2.30-7.fc31.x86_64 is filtered out by exclude filtering - package glibc-2.30-8.fc31.x86_64 is filtered out by exclude filtering - package glibc-2.30-5.fc31.i686 is filtered out by exclude filtering - package glibc-2.30-5.fc31.x86_64 is filtered out by exclude filtering - package glibc-2.30-10.fc31.i686 is filtered out by exclude filtering ```
- Loading branch information
1 parent
70c3856
commit 5a0d335
Showing
7 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
set -xeuo pipefail | ||
|
||
dn=$(cd "$(dirname "$0")" && pwd) | ||
# shellcheck source=libcomposetest.sh | ||
. "${dn}/libcomposetest.sh" | ||
|
||
# Add a local rpm-md repo for recommends testing | ||
treefile_append "repos" '["test-repo"]' | ||
build_rpm foodep | ||
build_rpm foobar recommends foobar-rec requires foodep | ||
build_rpm foobar-rec | ||
|
||
echo gpgcheck=0 >> yumrepo.repo | ||
ln "$PWD/yumrepo.repo" config/yumrepo.repo | ||
# the top-level manifest doesn't have any packages, so just set it | ||
treefile_append "packages" '["foobar"]' | ||
treefile_set 'recommends' "True" | ||
|
||
runcompose --dry-run >log.txt | ||
assert_file_has_content_literal log.txt 'foobar-1.0' | ||
assert_file_has_content_literal log.txt 'foobar-rec-1.0' | ||
rm -f log.txt | ||
echo "ok no exclude" | ||
|
||
# Test exclude | ||
treefile_append "exclude-packages" '["foobar-rec"]' | ||
|
||
runcompose --dry-run >log.txt | ||
assert_file_has_content_literal log.txt 'foobar-1.0' | ||
assert_not_file_has_content_literal log.txt 'foobar-rec-1.0' | ||
rm -f log.txt | ||
echo "ok exclude recommend" | ||
|
||
treefile_append "exclude-packages" '["foodep"]' | ||
|
||
if runcompose --dry-run &>err.txt; then | ||
fatal "compose unexpectedly succeeded" | ||
fi | ||
assert_file_has_content err.txt 'package foodep.*is filtered out by exclude filtering' | ||
echo "ok exclude included" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters