test/api: check openscap facts when appropriate

This commit is contained in:
Sanne Raymaekers 2024-09-05 14:47:52 +02:00
parent b21f24e751
commit a6b87b58f2
2 changed files with 15 additions and 1 deletions

View file

@ -409,6 +409,7 @@ case "${IMAGE_TYPE}" in
,
"openscap": {
"profile_id": "pci-dss",
"policy_id": "1af6cced-581c-452c-89cd-33b7bddb816a",
"tailoring": {
"unselected": [ "rpm_verify_permissions" ]
}

View file

@ -40,11 +40,24 @@ function _instanceCheck() {
FACTS=$($_ssh sudo subscription-manager facts)
if ! grep -q "image-builder.osbuild-composer.api-type: cloudapi-v2" <<< "$FACTS"; then
echo "System doesn't contain the expected osbuild facts"
echo "System doesn't contain the expected image-builder.osbuild-composer facts"
echo "$FACTS" | grep image-builder
exit 1
fi
if [ -n "$OPENSCAP_CUSTOMIZATION_BLOCK" ]; then
if ! grep -q "image-builder.insights.openscap-profile-id: pci-dss" <<< "$FACTS"; then
echo "System doesn't contain the expected image-builder.insights facts (profile-id)"
echo "$FACTS"| grep image-builder
exit 1
fi
if ! grep -q "image-builder.insights.compliance-policy-id: 1af6cced-581c-452c-89cd-33b7bddb816a" <<< "$FACTS"; then
echo "System doesn't contain the expected image-builder.insights facts (policy-id)"
echo "$FACTS"| grep image-builder
exit 1
fi
fi
# Unregister subscription
$_ssh sudo subscription-manager unregister
else