tests icon indicating copy to clipboard operation
tests copied to clipboard

CCv0: tests in agent_image_encrypted.bats can fail if there is running pod already

Open wainersm opened this issue 2 years ago • 2 comments

The tests in https://github.com/kata-containers/tests/blob/CCv0/integration/kubernetes/confidential/agent_image_encrypted.bats fail on the following scenario:

  1. There is a pod already running, for example, one called busybox-cc
  2. 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

wainersm avatar Aug 31 '22 17:08 wainersm

I came across that problem while running the tests with the operator.

wainersm avatar Aug 31 '22 17:08 wainersm

I guess we have a couple of potential fixes here with different pros/cons:

  1. 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?
  2. 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?

stevenhorsman avatar Sep 01 '22 16:09 stevenhorsman

Closed with #5103 merging

stevenhorsman avatar Oct 18 '22 09:10 stevenhorsman