test/e2e: new abstraction to run CoCo tests with pre-installed KBS #3365
are we sure we want to couple trustee-operator (kbs_operator_manager) to this repo?
I think it makes sense to have an option to use a KBS that has been provisioned outside of the test framework, but both trustee-operator and CAA are downstream consumers of trustee, and it feels a bit odd to actively manage operator-isms like populating secrets/configmaps here.
That said, I think an abstraction (I guess that's kbs_manager?) that enables a downstream extensions to support other means of kbs deployments is a great idea, it would also enable us to use a mock-kbs without all the state and admin headache in tests.
Hi @magowan ,
are we sure we want to couple trustee-operator (kbs_operator_manager) to this repo?
> I think it makes sense to have an option to use a KBS that has been provisioned outside of the test framework, but both trustee-operator and CAA are downstream consumers of trustee, and it feels a bit odd to actively manage operator-isms like populating secrets/configmaps here.
Good point. I added kbs_operator_manager because I will need it for my downstream CI and to account for TestTrusteeOperatorKeyReleaseForSpecificKey that was introduced in commit c15a519d5. But I can:
remove kbs_operator_manager entirely, then I carry a downstream implementation
get rid of TestTrusteeOperatorKeyReleaseForSpecificKey and ensure TestKbsKeyRelease works with any implementation of kbs_manager
Makes sense?
That said, I think an abstraction (I guess that's kbs_manager?) that enables a downstream extensions to support other means of kbs deployments is a great idea, it would also enable us to use a mock-kbs without all the state and admin headache in tests.
Good to hear that.
Never thought about mock-kbs...looks like a good idea, although in my case (downstream) I would prefer testing with a real kbs.
Good point. I added kbs_operator_manager because I will need it for my downstream CI and to account for TestTrusteeOperatorKeyReleaseForSpecificKey that was introduced in commit c15a519. But I can:
> remove kbs_operator_manager entirely, then I carry a downstream implementation
> get rid ofTestTrusteeOperatorKeyReleaseForSpecificKeyand ensureTestKbsKeyReleaseworks with any implementation ofkbs_manager
>
Makes sense?
yup sounds good
Hi @mkulke ,
this new version I removed the trustee-operator implementation and added a mechanism (2nd commit) to carry it downstream; it should work just like the provision abstraction. I didn't drop TestTrusteeOperatorKeyReleaseForSpecificKey yet because it will require a more changes (not much) and I don't want to mix up now, so I prefer to send in a follow up PR.
I didn't fully test the v2 yet, should be doing it soon. Nevertheless, let me know if it is acceptable.
I think this is based on (unmerged) #3333
should we merge this with DEPLOY_KBS? so something like KBS_MANAGEMENT=deploy or KBS_DEPLOYMENT=helm|external?
mkulke
wainersm
Extend the infrastructure to run the CoCo tests against cluster with a pre-installed KBS.
This introduces a KbsManager abstraction so one can implement back-ends tailored with different methods to deploy and and manage KBS. It implements the interface to:
current framework-deployed KBS (managed via kbs-client)
trustee-operator (managed via k8s resources)
Added a test for signed image as a proof of concept.
----
The short-story: I'm working to run cloud-api-adaptor's tests in our downstream CI. In our environment the KBS is installed by our operator (a fork of confidential-containers/trustee-operator) where any operations (e.g. change the resources policy) should be carried out via k8s resources (e.g. edit the kbsConfig configmap), hence, unlike the current implementation we cannot use the kbs-client for that purpose. Hence, the new abstraction is made to accommodate our needs as well as the current implementation.
I'm sending a new test that I used as a proof of concept. I know that this test is incomplete (misses the negative-cases, for example) and that @stevenhorsman has also one implementation of the same signed image tests. My intention is to reuse @stevenhorsman 's work as much as possible here.
I tested the changes with the new test in my CI but I could not verify (yet) it breaks others. Also I don't know caa's CI current status, so no idea if it can catch problems that might be introduced. I plan to work on all of that, to ensure upstream tests don't break.
However, before spend further time on the remaining work, I wanted to have an initial feedback on the overall thing.