diff --git a/per-rule/test.py b/per-rule/test.py index 9ed36626..90bb45b5 100755 --- a/per-rule/test.py +++ b/per-rule/test.py @@ -85,12 +85,14 @@ def report_test_with_log(status, note, log_dir, rule_name, test_name): our_rules_textblock = textwrap.indent(('\n'.join(our_rules)), ' ') util.log(f"testing rules:\n{our_rules_textblock}") -g = virt.Guest() - -# install a qcow2-backed VM, so automatus.py can snapshot it -# - use hardening-style partitions, automatus tests need them -ks = virt.Kickstart(partitions=partitions.partitions) -g.install(kickstart=ks, disk_format='qcow2') +# tag named after the tool that modifies the VM/image +g = virt.Guest('automatus') + +if not g.is_installed(): + # install a qcow2-backed VM, so automatus.py can snapshot it + # - use hardening-style partitions, automatus tests need them + ks = virt.Kickstart(partitions=partitions.partitions) + g.install(kickstart=ks, disk_format='qcow2') with util.get_content() as content_dir, g.booted(): env = os.environ.copy()