From 941da674d80bf35a6c5913165d7c419e7f84c4e7 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Fri, 6 Dec 2024 12:59:15 +0100 Subject: [PATCH] tests/nested: check for plainkey used when tokens are in use --- tests/nested/core/core22-basic/task.yaml | 4 ++++ tests/nested/manual/uc20-fde-hooks/task.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/nested/core/core22-basic/task.yaml b/tests/nested/core/core22-basic/task.yaml index 3975a226b17..783d779ea50 100644 --- a/tests/nested/core/core22-basic/task.yaml +++ b/tests/nested/core/core22-basic/task.yaml @@ -54,15 +54,19 @@ execute: | data_default_platform_name="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default").ubuntu_fde_data.platform_name' data.json)" data_fallback_token_type="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default-fallback").type' data.json)" data_fallback_platform_name="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default-fallback").ubuntu_fde_data.platform_name' data.json)" + save_default_token_type="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default").type' save.json)" + save_default_platform_name="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default").ubuntu_fde_data.platform_name' save.json)" save_fallback_token_type="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default-fallback").type' save.json)" save_fallback_platform_name="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default-fallback").ubuntu_fde_data.platform_name' save.json)" test "${data_default_token_type}" = "ubuntu-fde" test "${data_fallback_token_type}" = "ubuntu-fde" + test "${save_default_token_type}" = "ubuntu-fde" test "${save_fallback_token_type}" = "ubuntu-fde" test "${data_default_platform_name}" = "tpm2" test "${data_fallback_platform_name}" = "tpm2" + test "${save_default_platform_name}" = "plainkey" test "${save_fallback_platform_name}" = "tpm2" remote.exec "! test -f /run/mnt/ubuntu-boot/device/fde/ubuntu-data.sealed-key" diff --git a/tests/nested/manual/uc20-fde-hooks/task.yaml b/tests/nested/manual/uc20-fde-hooks/task.yaml index 8bd338dc288..cde66ee80b1 100644 --- a/tests/nested/manual/uc20-fde-hooks/task.yaml +++ b/tests/nested/manual/uc20-fde-hooks/task.yaml @@ -57,15 +57,19 @@ execute: | data_default_platform_name="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default").ubuntu_fde_data.platform_name' data.json)" data_fallback_token_type="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default-fallback").type' data.json)" data_fallback_platform_name="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default-fallback").ubuntu_fde_data.platform_name' data.json)" + save_default_token_type="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default").type' save.json)" + save_default_platform_name="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default").ubuntu_fde_data.platform_name' save.json)" save_fallback_token_type="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default-fallback").type' save.json)" save_fallback_platform_name="$(jq -r '.tokens.[]|select(.ubuntu_fde_name=="default-fallback").ubuntu_fde_data.platform_name' save.json)" test "${data_default_token_type}" = "ubuntu-fde" test "${data_fallback_token_type}" = "ubuntu-fde" + test "${save_default_token_type}" = "ubuntu-fde" test "${save_fallback_token_type}" = "ubuntu-fde" test "${data_default_platform_name}" = "fde-hooks-v3" test "${data_fallback_platform_name}" = "fde-hooks-v3" + test "${save_default_platform_name}" = "plainkey" test "${save_fallback_platform_name}" = "fde-hooks-v3" remote.exec "! test -f /run/mnt/ubuntu-boot/device/fde/ubuntu-data.sealed-key"