Skip to content

Commit 7d3e69f

Browse files
kamalcaLiliDeng
authored andcommitted
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.
1 parent 50fee32 commit 7d3e69f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

lisa/sut_orchestrator/azure/platform_.py

+19-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@
5353

5454
from lisa import feature, schema, search_space
5555
from lisa.environment import Environment
56-
from lisa.features import Disk
56+
from lisa.features import (
57+
Disk,
58+
SecurityProfile,
59+
SecurityProfileSettings,
60+
SecurityProfileType,
61+
)
5762
from lisa.features.availability import AvailabilityType
5863
from lisa.node import Node, RemoteNode, local
5964
from lisa.platform_ import Platform
@@ -716,6 +721,19 @@ def _get_node_information(self, node: Node) -> Dict[str, str]:
716721
node.log.debug("detecting vm generation...")
717722
information[KEY_VM_GENERATION] = node.tools[VmGeneration].get_generation()
718723
node.log.debug(f"vm generation: {information[KEY_VM_GENERATION]}")
724+
725+
security_profile = node.features[SecurityProfile].get_settings()
726+
if (
727+
security_profile
728+
and isinstance(security_profile, SecurityProfileSettings)
729+
and isinstance(security_profile.security_profile, SecurityProfileType)
730+
):
731+
information[
732+
"security_profile"
733+
] = security_profile.security_profile.value
734+
if security_profile.security_profile == SecurityProfileType.CVM:
735+
information["encrypt_disk"] = security_profile.encrypt_disk
736+
719737
if node.capture_kernel_config:
720738
node.log.debug("detecting mana driver enabled...")
721739
information[

0 commit comments

Comments
 (0)