tests
tests copied to clipboard
CCv0: tests in agent_image_encrypted.bats can fail if there is running pod already
The tests in https://github.com/kata-containers/tests/blob/CCv0/integration/kubernetes/confidential/agent_image_encrypted.bats fail on the following scenario:
- There is a pod already running, for example, one called
busybox-cc
- There is not the
ccv0-ssh
pod running
That happens because it gets the pod id of busybox-cc
in https://github.com/kata-containers/tests/blob/CCv0/integration/kubernetes/confidential/agent_image_encrypted.bats#L17 but it will attempt to delete another pod ( ccv0-ssh
) which doesn't exist (calls kubernetes_delete_ssh_demo_pod_if_exists
-> kubernetes_delete_ssh_demo_pod
then fail in https://github.com/kata-containers/tests/blob/CCv0/integration/kubernetes/confidential/lib.sh#L139)
Cc @GeorginaKin @Megan-Wright @stevenhorsman
I came across that problem while running the tests with the operator.
I guess we have a couple of potential fixes here with different pros/cons:
- We could just check for a pod running called
ccv0-ssh
(or by label?) and only delete it if so. I think this is probably the best option, but I'm not sure if having other of the previous test pods running could potentially impact the encrypted pod tests? - We could try and delete all pods in a generic 'clean-up' step, but this gets messy with deployments that would re-create them meaning we'd probably also have to delete all deployments at the same time. I think for simplicity I might go for 1) and see if that fixes the issues in the operator-ci?
Closed with #5103 merging