Skip to content

Commit

Permalink
tests/e2e: Add auth registry libvirt tests
Browse files Browse the repository at this point in the history
Run the authenticated regsitry tests for libvirt cloud provider

Signed-off-by: stevenhorsman <[email protected]>
  • Loading branch information
stevenhorsman committed Aug 12, 2024
1 parent 6ed202d commit f239110
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/cloud-api-adaptor/test/e2e/libvirt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package e2e

import (
"os"
"testing"

_ "github.com/confidential-containers/cloud-api-adaptor/src/cloud-api-adaptor/test/provisioner/libvirt"
Expand Down Expand Up @@ -138,3 +139,21 @@ func TestLibvirtPermissivePolicyAllowsExec(t *testing.T) {
assert := LibvirtAssert{}
DoTestPermissivePolicyAllowsExec(t, testEnv, assert)
}

func TestLibvirtCreatePeerPodWithAuthenticatedImageWithoutCredentials(t *testing.T) {
assert := LibvirtAssert{}
if os.Getenv("AUTHENTICATED_REGISTRY_IMAGE") != "" {
DoTestCreatePeerPodWithAuthenticatedImageWithoutCredentials(t, testEnv, assert)
} else {
t.Skip("Authenticated Image Name not exported")
}
}

func TestLibvirtCreatePeerPodWithAuthenticatedImageWithValidCredentials(t *testing.T) {
assert := LibvirtAssert{}
if os.Getenv("REGISTRY_CREDENTIAL_ENCODED") != "" && os.Getenv("AUTHENTICATED_REGISTRY_IMAGE") != "" {
DoTestCreatePeerPodWithAuthenticatedImageWithValidCredentials(t, testEnv, assert)
} else {
t.Skip("Registry Credentials, or authenticated image name not exported")
}
}

0 comments on commit f239110

Please sign in to comment.