-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OCM-7535 | fix: change not found to info
Signed-off-by: Maggie Chen <magchen@redhat.com> rephrase Signed-off-by: Maggie Chen <magchen@redhat.com> fmt Signed-off-by: Maggie Chen <magchen@redhat.com> change text Signed-off-by: Maggie Chen <magchen@redhat.com> fix text Signed-off-by: Maggie Chen <magchen@redhat.com>
- Loading branch information
Showing
5 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
cmd/list/breakglasscredential/breakglasscredential_suite_test.go
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package breakglasscredential_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestBreakGlassCredential(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Breakglasscredential Suite") | ||
} |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package breakglasscredential | ||
|
||
import ( | ||
"net/http" | ||
|
||
. "github.com/onsi/ginkgo/v2/dsl/core" | ||
. "github.com/onsi/gomega" | ||
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" | ||
. "github.com/openshift-online/ocm-sdk-go/testing" | ||
|
||
"github.com/openshift/rosa/pkg/test" | ||
) | ||
|
||
var _ = Describe("list break-glass-credential", func() { | ||
var testRuntime test.TestingRuntime | ||
|
||
Context("List break glass credential command", func() { | ||
mockClusterReady := test.MockCluster(func(c *cmv1.ClusterBuilder) { | ||
c.AWS(cmv1.NewAWS().SubnetIDs("subnet-0b761d44d3d9a4663", "subnet-0f87f640e56934cbc")) | ||
c.Region(cmv1.NewCloudRegion().ID("us-east-1")) | ||
c.State(cmv1.ClusterStateReady) | ||
c.Hypershift(cmv1.NewHypershift().Enabled(true)) | ||
c.ExternalAuthConfig(cmv1.NewExternalAuthConfig().Enabled(true)) | ||
}) | ||
hypershiftClusterReady := test.FormatClusterList([]*cmv1.Cluster{mockClusterReady}) | ||
|
||
BeforeEach(func() { | ||
testRuntime.InitRuntime() | ||
// Reset flag to avoid any side effect on other tests | ||
Cmd.Flags().Set("output", "") | ||
}) | ||
|
||
It("Warning with zero results", func() { | ||
testRuntime.ApiServer.AppendHandlers(RespondWithJSON(http.StatusOK, hypershiftClusterReady)) | ||
testRuntime.ApiServer.AppendHandlers(RespondWithJSON(http.StatusNotFound, "")) | ||
stdout, stderr, err := test.RunWithOutputCapture(runWithRuntime, testRuntime.RosaRuntime, Cmd) | ||
Expect(err).To(BeNil()) | ||
Expect(stderr).To(Equal("")) | ||
Expect(stdout).To(Equal("INFO: There are no break glass credentials for cluster 'cluster1'\n")) | ||
}) | ||
}) | ||
}) |
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