From 7d3e69fb800c18fdb1330ac8aae53fba386e43fb Mon Sep 17 00:00:00 2001 From: Kameron Carr Date: Thu, 16 Jan 2025 15:01:49 -0800 Subject: [PATCH] Security Profile Information The test case results should be able to differentiate between standard, secure boot, and CVM; as well as between disk encryption and no disk encryption. --- lisa/sut_orchestrator/azure/platform_.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lisa/sut_orchestrator/azure/platform_.py b/lisa/sut_orchestrator/azure/platform_.py index 17d6091fce..03370181b0 100644 --- a/lisa/sut_orchestrator/azure/platform_.py +++ b/lisa/sut_orchestrator/azure/platform_.py @@ -53,7 +53,12 @@ from lisa import feature, schema, search_space from lisa.environment import Environment -from lisa.features import Disk +from lisa.features import ( + Disk, + SecurityProfile, + SecurityProfileSettings, + SecurityProfileType, +) from lisa.features.availability import AvailabilityType from lisa.node import Node, RemoteNode, local from lisa.platform_ import Platform @@ -716,6 +721,19 @@ def _get_node_information(self, node: Node) -> Dict[str, str]: node.log.debug("detecting vm generation...") information[KEY_VM_GENERATION] = node.tools[VmGeneration].get_generation() node.log.debug(f"vm generation: {information[KEY_VM_GENERATION]}") + + security_profile = node.features[SecurityProfile].get_settings() + if ( + security_profile + and isinstance(security_profile, SecurityProfileSettings) + and isinstance(security_profile.security_profile, SecurityProfileType) + ): + information[ + "security_profile" + ] = security_profile.security_profile.value + if security_profile.security_profile == SecurityProfileType.CVM: + information["encrypt_disk"] = security_profile.encrypt_disk + if node.capture_kernel_config: node.log.debug("detecting mana driver enabled...") information[