diff --git a/validation/policies/io/konveyor/forklift/vmware/tpm_enabled.rego b/validation/policies/io/konveyor/forklift/vmware/tpm_enabled.rego new file mode 100644 index 000000000..22708e0b3 --- /dev/null +++ b/validation/policies/io/konveyor/forklift/vmware/tpm_enabled.rego @@ -0,0 +1,16 @@ +package io.konveyor.forklift.vmware + +default has_tpm_enabled = false + +has_tpm_enabled = true { + input.tpmEnabled == true +} + +concerns[flag] { + has_tpm_enabled + flag := { + "category": "Warning", + "label": "VM configured with a TPM device", + "assessment": "The VM is configured with a TPM device. TPM data is not transferred during the migration." + } +} \ No newline at end of file diff --git a/validation/policies/io/konveyor/forklift/vmware/tpm_enabled_test.rego b/validation/policies/io/konveyor/forklift/vmware/tpm_enabled_test.rego new file mode 100644 index 000000000..d9b2a80b5 --- /dev/null +++ b/validation/policies/io/konveyor/forklift/vmware/tpm_enabled_test.rego @@ -0,0 +1,19 @@ +package io.konveyor.forklift.vmware + +test_with_tpm_disabled { + mock_vm := { + "name": "test", + "tpmEnabled": false, + } + results := concerns with input as mock_vm + count(results) == 0 +} + +test_with_cpu_hot_add_enabled { + mock_vm := { + "name": "test", + "tpmEnabled": true + } + results := concerns with input as mock_vm + count(results) == 1 +} \ No newline at end of file