-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MGMT-19258: Identify and copy shared code
MGMT-19258: Copied context sensitive funcs into a context MGMT-19258: Ensure that all context sensitive code is in test context
- Loading branch information
1 parent
6c35570
commit 8930f91
Showing
23 changed files
with
3,570 additions
and
2,185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ import ( | |
"github.com/openshift/assisted-service/internal/common" | ||
"github.com/openshift/assisted-service/models" | ||
"github.com/openshift/assisted-service/pkg/auth" | ||
"github.com/openshift/assisted-service/subsystem/utils_test" | ||
) | ||
|
||
const psTemplate = "{\"auths\":{\"cloud.openshift.com\":{\"auth\":\"%s\",\"email\":\"[email protected]\"}}}" | ||
|
@@ -113,11 +114,11 @@ var _ = Describe("test authorization", func() { | |
Skip("auth is disabled") | ||
} | ||
|
||
userClusterID, err = registerCluster(ctx, userBMClient, "user-cluster", fmt.Sprintf(psTemplate, FakePS)) | ||
userClusterID, err = utils_test.TestContext.RegisterCluster(ctx, userBMClient, "user-cluster", fmt.Sprintf(psTemplate, FakePS)) | ||
Expect(err).ShouldNot(HaveOccurred()) | ||
userClusterID2, err = registerCluster(ctx, user2BMClient, "user2-cluster", fmt.Sprintf(psTemplate, FakePS2)) | ||
userClusterID2, err = utils_test.TestContext.RegisterCluster(ctx, user2BMClient, "user2-cluster", fmt.Sprintf(psTemplate, FakePS2)) | ||
Expect(err).ShouldNot(HaveOccurred()) | ||
userClusterID3, err = registerCluster(ctx, editclusterUserBMClient, "user3-cluster", fmt.Sprintf(psTemplate, FakePS3)) | ||
userClusterID3, err = utils_test.TestContext.RegisterCluster(ctx, editclusterUserBMClient, "user3-cluster", fmt.Sprintf(psTemplate, FakePS3)) | ||
Expect(err).ShouldNot(HaveOccurred()) | ||
}) | ||
|
||
|
@@ -171,7 +172,7 @@ var _ = Describe("test authorization", func() { | |
|
||
It("can update day2 cluster", func() { | ||
// Install day1 cluster | ||
clusterId, err := registerCluster(ctx, userBMClient, "test-cluster", pullSecret) | ||
clusterId, err := utils_test.TestContext.RegisterCluster(ctx, userBMClient, "test-cluster", pullSecret) | ||
Expect(err).ToNot(HaveOccurred()) | ||
infraEnvID := registerInfraEnv(&clusterId, models.ImageTypeMinimalIso).ID | ||
registerHostsAndSetRoles(clusterId, *infraEnvID, minHosts, "test-cluster", "example.com") | ||
|
@@ -234,7 +235,7 @@ var _ = Describe("test authorization", func() { | |
Name: swag.String("test-infra-env-2"), | ||
OpenshiftVersion: openshiftVersion, | ||
PullSecret: swag.String(fmt.Sprintf(psTemplate, FakePS2)), | ||
SSHAuthorizedKey: swag.String(sshPublicKey), | ||
SSHAuthorizedKey: swag.String(utils_test.SshPublicKey), | ||
ImageType: models.ImageTypeMinimalIso, | ||
ClusterID: &userClusterID2, | ||
}, | ||
|
@@ -293,7 +294,7 @@ var _ = Describe("test authorization", func() { | |
Name: swag.String("test-infra-env-agent-2"), | ||
OpenshiftVersion: openshiftVersion, | ||
PullSecret: swag.String(fmt.Sprintf(psTemplate, FakePS2)), | ||
SSHAuthorizedKey: swag.String(sshPublicKey), | ||
SSHAuthorizedKey: swag.String(utils_test.SshPublicKey), | ||
ImageType: models.ImageTypeMinimalIso, | ||
ClusterID: &userClusterID2, | ||
}, | ||
|
@@ -457,7 +458,7 @@ var _ = Describe("Make sure that sensitive files are accessible only by owners o | |
|
||
BeforeEach(func() { | ||
ctx = context.Background() | ||
cID, err := registerCluster(ctx, userBMClient, "test-cluster", pullSecret) | ||
cID, err := utils_test.TestContext.RegisterCluster(ctx, userBMClient, "test-cluster", pullSecret) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(err).ToNot(HaveOccurred()) | ||
clusterID = cID | ||
|
@@ -527,7 +528,7 @@ var _ = Describe("Cluster credentials should be accessed only by cluster owner", | |
|
||
BeforeEach(func() { | ||
ctx = context.Background() | ||
cID, err := registerCluster(ctx, userBMClient, "test-cluster", pullSecret) | ||
cID, err := utils_test.TestContext.RegisterCluster(ctx, userBMClient, "test-cluster", pullSecret) | ||
Expect(err).ToNot(HaveOccurred()) | ||
clusterID = cID | ||
infraEnvID = registerInfraEnv(&clusterID, models.ImageTypeMinimalIso).ID | ||
|
Oops, something went wrong.