diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 875714e2..90347bea 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -58,7 +58,7 @@ jobs: run: | cd import-export-cli go vet ./... - ./build.sh -t apictl.go -v 4.1.3 + ./build.sh -t apictl.go -v 4.1.4 - name: Start APIM run: | @@ -69,4 +69,4 @@ jobs: - name: Test run: | cd import-export-cli/integration - go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -race -coverprofile=coverage.txt -covermode=atomic ./pkg/... + go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz -race -coverprofile=coverage.txt -covermode=atomic ./pkg/... diff --git a/import-export-cli/README.md b/import-export-cli/README.md index f5a49d26..578aa2a6 100644 --- a/import-export-cli/README.md +++ b/import-export-cli/README.md @@ -17,7 +17,7 @@ Command Line tool for importing and exporting APIs/Applications/API Products in - ### Building `cd` into `product-apim-tooling/import-export-cli` - Execute `./build.sh -t apictl.go -v 4.1.3 -f` to build for all platforms. + Execute `./build.sh -t apictl.go -v 4.1.4 -f` to build for all platforms. Created packages will be available at `build/target` directory @@ -65,11 +65,11 @@ Command Line tool for importing and exporting APIs/Applications/API Products in Usage: `docker build --build-arg version= -t apictl: .` - Example: `docker build --build-arg version=4.1.3.1 -t apictl:4.1.3.1 .` + Example: `docker build --build-arg version=4.1.4.1 -t apictl:4.1.4.1 .` - ### Using the Docker Image - `docker run -it -v $(pwd):/git -v ~/.wso2apictl:/root/.wso2apictl -v ~/.wso2apictl.local:/root/.wso2apictl.local apictl:4.1.3.1 ` + `docker run -it -v $(pwd):/git -v ~/.wso2apictl:/root/.wso2apictl -v ~/.wso2apictl.local:/root/.wso2apictl.local apictl:4.1.4.1 ` *** diff --git a/import-export-cli/integration/README.md b/import-export-cli/integration/README.md index 11b6ecfa..85818e29 100644 --- a/import-export-cli/integration/README.md +++ b/import-export-cli/integration/README.md @@ -52,7 +52,7 @@ devops-rest-api-version: v0 The version of the apictl that is being integration tested. ``` -apictl-version: 4.1.3 +apictl-version: 4.1.4 ``` @@ -95,7 +95,7 @@ apictl-version: 4.1.3 ``` go test -p 1 -timeout 0 -archive -example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz +example: go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz ``` @@ -104,7 +104,7 @@ example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz ``` go test -p 1 -timeout 0 -archive -run -example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -run TestVersion +example: go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz -run TestVersion ``` - Print verbose output @@ -112,7 +112,7 @@ example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -run Tes ``` go test -p 1 -timeout 0 -archive -v -example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -v +example: go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz -v ``` - Print http transport request/responses @@ -120,7 +120,7 @@ example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -v ``` go test -p 1 -timeout 0 -archive -logtransport -example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -logtransport +example: go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz -logtransport ``` --- diff --git a/import-export-cli/integration/config.yaml b/import-export-cli/integration/config.yaml index 62d4a34e..89746cf7 100644 --- a/import-export-cli/integration/config.yaml +++ b/import-export-cli/integration/config.yaml @@ -10,7 +10,7 @@ environments: host: localhost offset: 1 # duration tests will wait to allow APIM solr indexes to be updated -indexing-delay: 1000 +indexing-delay: 1500 # max number of retry attempts made to successfully invoke an API, to compensate for delay in API artifact deployment max-invocation-attempts: 10 @@ -19,5 +19,5 @@ admin-rest-api-version: v3 devportal-rest-api-version: v2 publisher-rest-api-version: v3 devops-rest-api-version: v0 -apictl-version: 4.1.3 +apictl-version: 4.1.4 diff --git a/import-export-cli/integration/testutils/apiParams.go b/import-export-cli/integration/testutils/apiParams.go index da07bbdd..5b0ec468 100644 --- a/import-export-cli/integration/testutils/apiParams.go +++ b/import-export-cli/integration/testutils/apiParams.go @@ -111,4 +111,5 @@ type MsslCert struct { TierName string `yaml:"tierName"` Alias string `yaml:"alias"` Path string `yaml:"path"` + KeyType string `yaml:"keyType"` } diff --git a/import-export-cli/integration/testutils/api_testUtils.go b/import-export-cli/integration/testutils/api_testUtils.go index cd28d730..d8deecd2 100644 --- a/import-export-cli/integration/testutils/api_testUtils.go +++ b/import-export-cli/integration/testutils/api_testUtils.go @@ -1085,7 +1085,7 @@ func ValidateAPIDeleteFailure(t *testing.T, args *ApiImportExportTestArgs) { } func exportApiImportedFromProject(t *testing.T, APIName string, APIVersion string, EnvName string) (string, error) { - return base.Execute(t, "export", "api", "-n", APIName, "-v", APIVersion, "-e", EnvName) + return base.Execute(t, "export", "api", "-n", APIName, "-v", APIVersion, "-e", EnvName, "-k") } func exportAllApisOfATenant(t *testing.T, args *ApiImportExportTestArgs) (string, error) { diff --git a/import-export-cli/integration/testutils/environment_testUtils.go b/import-export-cli/integration/testutils/environment_testUtils.go index a3e8e895..7ae728bb 100644 --- a/import-export-cli/integration/testutils/environment_testUtils.go +++ b/import-export-cli/integration/testutils/environment_testUtils.go @@ -136,7 +136,7 @@ func InitProjectWithOasFlag(t *testing.T, args *InitTestArgs) (string, error) { base.SetupEnvWithoutTokenFlag(t, args.SrcAPIM.GetEnvName(), args.SrcAPIM.GetApimURL()) base.Login(t, args.SrcAPIM.GetEnvName(), args.CtlUser.Username, args.CtlUser.Password) - output, err := base.Execute(t, "init", args.InitFlag, "--oas", args.OasFlag, "--verbose", "-f") + output, err := base.Execute(t, "init", args.InitFlag, "--oas", args.OasFlag, "--verbose", "-f", "-k") return output, err } @@ -330,7 +330,7 @@ func validateEndpointSecurity(t *testing.T, apiParams *Params, api *apim.API, en if strings.EqualFold(strings.ToUpper(endpointSecurityForEndpointType.Type), EndpointSecurityTypeOAuth) { // Validate Oauth 2.0 endpoint security related properties assert.Equal(t, endpointSecurityForEndpointType.ClientId, endpointSecurityForEndpointTypeInApi["clientId"]) - assert.Equal(t, endpointSecurityForEndpointType.ClientSecret, endpointSecurityForEndpointTypeInApi["clientSecret"]) + assert.Equal(t, "", endpointSecurityForEndpointTypeInApi["clientSecret"]) assert.Equal(t, endpointSecurityForEndpointType.TokenUrl, endpointSecurityForEndpointTypeInApi["tokenUrl"]) assert.Equal(t, strings.ToUpper(endpointSecurityForEndpointType.GrantType), endpointSecurityForEndpointTypeInApi["grantType"]) @@ -505,12 +505,16 @@ func validateMutualSSLCerts(t *testing.T, apiParams *Params, path string) { isClientCertsDirExists, _ := utils.IsDirExists(pathOfExportedMsslCerts) if isClientCertsDirExists { - files, _ := ioutil.ReadDir(pathOfExportedMsslCerts) for _, msslCert := range apiParams.Environments[0].Configs.MsslCerts { + pathToCert := pathOfExportedMsslCerts + string(os.PathSeparator) + msslCert.KeyType + isPathToCertExist, _ := utils.IsDirExists(pathToCert) msslCertExists := false - for _, file := range files { - if strings.EqualFold(file.Name(), msslCert.Path) { - msslCertExists = true + if isPathToCertExist { + files, _ := ioutil.ReadDir(pathToCert) + for _, file := range files { + if strings.EqualFold(file.Name(), msslCert.Path) { + msslCertExists = true + } } } if !msslCertExists { diff --git a/import-export-cli/mi/integration/README.md b/import-export-cli/mi/integration/README.md index f01a66e6..0ef62789 100644 --- a/import-export-cli/mi/integration/README.md +++ b/import-export-cli/mi/integration/README.md @@ -62,7 +62,7 @@ ``` go test -archive -example: go test -archive apictl-4.1.3-linux-x64.tar.gz +example: go test -archive apictl-4.1.4-linux-x64.tar.gz ``` @@ -71,7 +71,7 @@ example: go test -archive apictl-4.1.3-linux-x64.tar.gz ``` go test -archive -test.run -example: go test -archive apictl-4.1.3-linux-x64.tar.gz -test.run TestGetConnectors +example: go test -archive apictl-4.1.4-linux-x64.tar.gz -test.run TestGetConnectors ``` - Print verbose output @@ -79,7 +79,7 @@ example: go test -archive apictl-4.1.3-linux-x64.tar.gz -test.run TestGetConnect ``` go test -archive -test.v -example: go test -archive apictl-4.1.3-linux-x64.tar.gz -test.v +example: go test -archive apictl-4.1.4-linux-x64.tar.gz -test.v ``` - Print http transport request/responses @@ -87,5 +87,5 @@ example: go test -archive apictl-4.1.3-linux-x64.tar.gz -test.v ``` go test -archive -logtransport -example: go test -archive apictl-4.1.3-linux-x64.tar.gz -logtransport +example: go test -archive apictl-4.1.4-linux-x64.tar.gz -logtransport ```