Skip to content

Commit

Permalink
test/api: check openscap facts when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
croissanne committed Sep 5, 2024
1 parent 1ba071a commit 943d487
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/cases/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
Expand Down
15 changes: 14 additions & 1 deletion test/cases/api/common/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 943d487

Please sign in to comment.