From 223bc8e421b69cb6b30d5d41bf6d2b8bdc465b1e Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Mon, 12 Aug 2024 11:08:46 +0100 Subject: [PATCH] test/e2e: docker: Fix KBS test that doesn't compile As part of the work in #1935, EnableKbsCustomizedPolicy was replaced with EnableKbsCustomizedResourcePolicy and EnableKbsCustomizedAttestationPolicy, but the docker tests wasn't updated, so it doesn't compile, so fix this --- src/cloud-api-adaptor/test/e2e/common_suite.go | 4 ++-- src/cloud-api-adaptor/test/e2e/docker_test.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cloud-api-adaptor/test/e2e/common_suite.go b/src/cloud-api-adaptor/test/e2e/common_suite.go index f1f995aad1..1fd624da98 100644 --- a/src/cloud-api-adaptor/test/e2e/common_suite.go +++ b/src/cloud-api-adaptor/test/e2e/common_suite.go @@ -574,7 +574,7 @@ func DoTestPodsMTLSCommunication(t *testing.T, e env.Environment, assert CloudAs } -// DoTestKbsKeyRelease and DoTestKbsKeyReleaseForFailure should be run in a single test case if you're chaning opa in kbs +// DoTestKbsKeyRelease and DoTestKbsKeyReleaseForFailure should be run in a single test case if you're chaining opa in kbs // as test cases might be run in parallel func DoTestKbsKeyRelease(t *testing.T, e env.Environment, assert CloudAssert) { t.Log("Do test kbs key release") @@ -598,7 +598,7 @@ func DoTestKbsKeyRelease(t *testing.T, e env.Environment, assert CloudAssert) { NewTestCase(t, e, "KbsKeyReleasePod", assert, "Kbs key release is successful").WithPod(pod).WithTestCommands(testCommands).Run() } -// DoTestKbsKeyRelease and DoTestKbsKeyReleaseForFailure should be run in a single test case if you're chaning opa in kbs +// DoTestKbsKeyRelease and DoTestKbsKeyReleaseForFailure should be run in a single test case if you're chaining opa in kbs // as test cases might be run in parallel func DoTestKbsKeyReleaseForFailure(t *testing.T, e env.Environment, assert CloudAssert) { t.Log("Do test kbs key release failure case") diff --git a/src/cloud-api-adaptor/test/e2e/docker_test.go b/src/cloud-api-adaptor/test/e2e/docker_test.go index 13423d9e8b..0438b451d4 100644 --- a/src/cloud-api-adaptor/test/e2e/docker_test.go +++ b/src/cloud-api-adaptor/test/e2e/docker_test.go @@ -101,10 +101,11 @@ func TestDockerKbsKeyRelease(t *testing.T) { if !isTestWithKbs() { t.Skip("Skipping kbs related test as kbs is not deployed") } - _ = keyBrokerService.EnableKbsCustomizedPolicy("deny_all.rego") + keyBrokerService.SetSampleSecretKey() + keyBrokerService.EnableKbsCustomizedResourcePolicy("deny_all.rego") assert := DockerAssert{} t.Parallel() DoTestKbsKeyReleaseForFailure(t, testEnv, assert) - _ = keyBrokerService.EnableKbsCustomizedPolicy("allow_all.rego") + keyBrokerService.EnableKbsCustomizedResourcePolicy("allow_all.rego") DoTestKbsKeyRelease(t, testEnv, assert) }