Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions shared/applicability/bootc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ title: Bootable containers
# Bootable containers and running bootc systems both contain these packages.
# Normal bare-metal systems usually don't have the rpm-ostree, normal
# containers don't contain kernel.
#
# Also normal containers are not supposed to have the /run/ostree-booted file.
check_id: bootc
{{% if product == "fedora" or "rhel" in product %}}
{{% set kernel_package = "kernel-core" %}}
{{% else %}}
{{% set kernel_package = "kernel" %}}
{{% endif %}}
bash_conditional: "{ rpm --quiet -q {{{ kernel_package }}} ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} && { ! rpm --quiet -q openshift-kubelet ;}"
ansible_conditional: '"{{{ kernel_package }}}" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages and "bootc" in ansible_facts.packages and not "openshift-kubelet" in ansible_facts.packages'
bash_conditional: "{ rpm --quiet -q {{{ kernel_package }}} ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} && { ! rpm --quiet -q openshift-kubelet ;} && [ -f /run/ostree-booted ]"
ansible_conditional: '"{{{ kernel_package }}}" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages and "bootc" in ansible_facts.packages and not "openshift-kubelet" in ansible_facts.packages and "ostree" in ansible_proc_cmdline'
10 changes: 10 additions & 0 deletions shared/applicability/oval/bootc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<criterion comment="kernel is installed" test_ref="bootc_platform_test_kernel_installed" />
<criterion comment="rpm-ostree is installed" test_ref="bootc_platform_test_rpm_ostree_installed" />
<criterion comment="bootc is installed" test_ref="bootc_platform_test_bootc_installed" />
<criterion comment="/run/ostree-booted exists" test_ref="bootc_platform_test_run_ostree_booted_exists" />
<criterion comment="openshift-kubelet is not installed" test_ref="bootc_platform_test_openshift_kubelet_removed" />
</criteria>
</definition>
Expand All @@ -17,4 +18,13 @@
{{{ oval_test_package_installed(package="rpm-ostree", test_id="bootc_platform_test_rpm_ostree_installed") }}}
{{{ oval_test_package_installed(package="bootc", test_id="bootc_platform_test_bootc_installed") }}}
{{{ oval_test_package_removed(package="openshift-kubelet", test_id="bootc_platform_test_openshift_kubelet_removed") }}}

<unix:file_test id="bootc_platform_test_run_ostree_booted_exists" check="all" check_existence="all_exist" comment="The file /run/ostree-booted exists" version="1">
<unix:object object_ref="bootc_platform_obj_run_ostree_booted_exists" />
</unix:file_test>

<unix:file_object id="bootc_platform_obj_run_ostree_booted_exists" comment="The file /run/ostree-booted exists" version="1">
<unix:filepath operation="equals">/run/ostree-booted</unix:filepath>
</unix:file_object>

</def-group>
10 changes: 10 additions & 0 deletions shared/checks/oval/bootc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<criterion comment="kernel is installed" test_ref="bootc_platform_test_kernel_installed" />
<criterion comment="rpm-ostree is installed" test_ref="bootc_platform_test_rpm_ostree_installed" />
<criterion comment="bootc is installed" test_ref="bootc_platform_test_bootc_installed" />
<criterion comment="/run/ostree-booted exists" test_ref="bootc_platform_test_run_ostree_booted_exists" />
<criterion comment="openshift-kubelet is not installed" test_ref="bootc_platform_test_openshift_kubelet_removed" />
</criteria>
</definition>
Expand All @@ -17,4 +18,13 @@
{{{ oval_test_package_installed(package="rpm-ostree", test_id="bootc_platform_test_rpm_ostree_installed") }}}
{{{ oval_test_package_installed(package="bootc", test_id="bootc_platform_test_bootc_installed") }}}
{{{ oval_test_package_removed(package="openshift-kubelet", test_id="bootc_platform_test_openshift_kubelet_removed") }}}

<unix:file_test id="bootc_platform_test_run_ostree_booted_exists" check="all" check_existence="all_exist" comment="The file /run/ostree-booted exists" version="1">
<unix:object object_ref="bootc_platform_obj_run_ostree_booted_exists" />
</unix:file_test>

<unix:file_object id="bootc_platform_obj_run_ostree_booted_exists" comment="The file /run/ostree-booted exists" version="1">
<unix:filepath operation="equals">/run/ostree-booted</unix:filepath>
</unix:file_object>

</def-group>
Loading