Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/aws: disable, enable and fix tests #2262

Merged
merged 5 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/cloud-api-adaptor/test/e2e/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package e2e

import (
"fmt"
"testing"

_ "github.com/confidential-containers/cloud-api-adaptor/src/cloud-api-adaptor/test/provisioner/aws"
Expand All @@ -17,7 +18,6 @@ func TestAwsCreateSimplePod(t *testing.T) {
}

func TestAwsCreatePodWithConfigMap(t *testing.T) {
t.Skip("Test not passing")
assert := NewAWSAssert()

DoTestCreatePodWithConfigMap(t, testEnv, assert)
Expand Down Expand Up @@ -101,13 +101,19 @@ func TestAwsDeletePod(t *testing.T) {
}

func TestAwsCreateNginxDeployment(t *testing.T) {
t.Skip("Test not passing")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, isn't this a basic test? Any idea why is it failing ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bpradipt !

The nginx test was unstable on libvirt while ago (#2046) but then got re-enabled recently. Interestingly that I tried to reproduce the fails locally many time but I never caught it, it seems something related with CI environment. As for AWS, I didn't have time to debug it yet....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wainersm. I was just curious :-) ..

assert := NewAWSAssert()
DoTestNginxDeployment(t, testEnv, assert)
}

func TestAwsCreatePeerPodContainerWithInvalidAlternateImage(t *testing.T) {
assert := NewAWSAssert()
nonExistingImageName := "ami-123456"
expectedErrorMessage := "InvalidAMIID.NotFound: The image id '[ami-1234567]' does not exist: not found"
expectedErrorMessage := fmt.Sprintf("InvalidAMIID.NotFound: The image id '[%s]' does not exist: not found", nonExistingImageName)
DoTestCreatePeerPodContainerWithInvalidAlternateImage(t, testEnv, assert, nonExistingImageName, expectedErrorMessage)
}

func TestAwsPodWithInitContainer(t *testing.T) {
assert := NewAWSAssert()
DoTestPodWithInitContainer(t, testEnv, assert)
}
15 changes: 13 additions & 2 deletions src/cloud-api-adaptor/test/provisioner/aws/provision_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,19 @@ func (v *Vpc) deleteVpc() error {

// createBucket Creates the S3 bucket
func (b *S3Bucket) createBucket() error {
// No harm creating a bucket that already exist.
_, err := b.Client.CreateBucket(context.TODO(), &s3.CreateBucketInput{
buckets, err := b.Client.ListBuckets(context.TODO(), &s3.ListBucketsInput{})
if err != nil {
return err
}

for _, bucket := range buckets.Buckets {
if *bucket.Name == b.Name {
// Bucket exists
return nil
}
}

_, err = b.Client.CreateBucket(context.TODO(), &s3.CreateBucketInput{
Bucket: &b.Name,
})
if err != nil {
Expand Down
Loading