diff --git a/tests/kola/content-origins/data/commonlib.sh b/tests/kola/content-origins/data/commonlib.sh new file mode 120000 index 0000000000..1742d51e67 --- /dev/null +++ b/tests/kola/content-origins/data/commonlib.sh @@ -0,0 +1 @@ +../../data/commonlib.sh \ No newline at end of file diff --git a/tests/kola/content-origins/test.sh b/tests/kola/content-origins/test.sh new file mode 100755 index 0000000000..b67483d5ab --- /dev/null +++ b/tests/kola/content-origins/test.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# kola: {"platforms": "qemu", "exclusive": false, "distros": "fcos rhcos" } +# Verify the RPM %{vendor} flag for everything installed matches what we expect. +# +# - platforms: qemu +# - This test should pass everywhere if it passes anywhere. +# - distros: This only handles Fedora and RHEL today. + +set -xeuo pipefail + +. $KOLA_EXT_DATA/commonlib.sh + +. /usr/lib/os-release + +case "${ID}" in + fedora) vendor='Fedora Project';; + rhel|rhcos) vendor='Red Hat, Inc.';; + *) echo "Unknown operating system ID=${ID}; skipping this test"; exit 0;; +esac + +cd $(mktemp -d) +rpm -qa --queryformat='%{name},%{vendor}\n' > rpmvendors.txt +if grep -vF ",${vendor}" rpmvendors.txt > unmatched.txt; then + cat unmatched.txt + fatal "Expected only vendor ${vendor} for all packages" +fi +echo "ok all RPMs produced by Vendor: ${vendor}" +