Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nithyatsu committed Dec 5, 2024
1 parent ce06a5b commit a37e670
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/functional-test-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ jobs:
# aws-region: ${{ env.AWS_REGION }}

# create kind cluster with OIDC provider.

- name: Create KinD cluster
run: |
curl -sSLo "kind" "https://github.com/kubernetes-sigs/kind/releases/download/${{ env.KIND_VER }}/kind-linux-amd64"
Expand Down
15 changes: 13 additions & 2 deletions test/functional-portable/ucp/cloud/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ import (

awsgo "github.com/aws/aws-sdk-go-v2/aws"
awsconfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials/stscreds"
"github.com/aws/aws-sdk-go-v2/service/cloudcontrol"
"github.com/aws/aws-sdk-go-v2/service/sts"
"github.com/google/uuid"
"github.com/radius-project/radius/pkg/ucp/api/v20231001preview"
"github.com/radius-project/radius/pkg/ucp/aws"

ucp_aws "github.com/radius-project/radius/pkg/ucp/aws"
"github.com/radius-project/radius/pkg/ucp/frontend/controller/awsproxy"
test "github.com/radius-project/radius/test/ucp"
"github.com/radius-project/radius/test/validation"
Expand Down Expand Up @@ -148,7 +152,14 @@ func setupTestAWSResource(t *testing.T, ctx context.Context, resourceName string
// Test setup - Create AWS resource using AWS APIs
cfg, err := awsconfig.LoadDefaultConfig(ctx)
require.NoError(t, err)
var awsClient aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)
//var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)

stsClient := sts.NewFromConfig(cfg)
roleARN := "arn:aws:iam::179022619019:role/radius_func_test"
creds := stscreds.NewAssumeRoleProvider(stsClient, roleARN)
cfg.Credentials = awsgo.NewCredentialsCache(creds)
var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)

desiredState := map[string]any{
"BucketName": resourceName,
"AccessControl": "Private",
Expand Down Expand Up @@ -188,7 +199,7 @@ func setupTestAWSResource(t *testing.T, ctx context.Context, resourceName string
// End of test setup
}

func waitForSuccess(t *testing.T, ctx context.Context, awsClient aws.AWSCloudControlClient, requestToken *string) {
func waitForSuccess(t *testing.T, ctx context.Context, awsClient ucp_aws.AWSCloudControlClient, requestToken *string) {
// Wait till the create is complete
maxWaitTime := 300 * time.Second
waiter := cloudcontrol.NewResourceRequestSuccessWaiter(awsClient)
Expand Down
16 changes: 9 additions & 7 deletions test/rp/rptest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ import (
"testing"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/credentials/stscreds"
"github.com/aws/aws-sdk-go-v2/service/cloudcontrol"
"github.com/aws/aws-sdk-go-v2/service/sts"
ucp_aws "github.com/radius-project/radius/pkg/ucp/aws"
"github.com/stretchr/testify/require"
apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand Down Expand Up @@ -185,15 +188,14 @@ func NewRPTestOptions(t *testing.T) RPTestOptions {

cfg, err := awsconfig.LoadDefaultConfig(ctx)
require.NoError(t, err)
//var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)

stsClient := sts.NewFromConfig(cfg)
roleARN := "arn:aws:iam::179022619019:role/radius_func_test"
creds := stscreds.NewAssumeRoleProvider(stsClient, roleARN)
cfg.Credentials = aws.NewCredentialsCache(creds)
var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)

/*
stsClient := sts.NewFromConfig(cfg)
roleARN := "arn:aws:iam::179022619019:role/radius_func_test"
creds := stscreds.NewAssumeRoleProvider(stsClient, roleARN)
cfg.Credentials = aws.NewCredentialsCache(creds)
var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)
*/
return RPTestOptions{
TestOptions: test.NewTestOptions(t),
Workspace: workspace,
Expand Down

0 comments on commit a37e670

Please sign in to comment.