Skip to content

Commit

Permalink
e2e: Add minimal user story
Browse files Browse the repository at this point in the history
  • Loading branch information
jsliacan authored and praveenkumar committed Jun 23, 2023
1 parent 00da173 commit bb83956
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
18 changes: 18 additions & 0 deletions test/e2e/features/minimal.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@minimal @darwin @linux @windows
Feature: Minimal user story

User starts CRC cluster and checks status.

@cleanup
Scenario Outline: Start OpenShift cluster:
Given setting config property "preset" to value "<preset-value>" succeeds
And executing single crc setup command succeeds
And starting CRC with default bundle succeeds
Then checking that CRC is running

Examples:
| preset-value |
| podman |
| microshift |
| openshift |

23 changes: 21 additions & 2 deletions test/extended/crc/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,31 @@ func WaitForClusterInState(state string) error {
}

func CheckCRCStatus(state string) error {
expression := `.*OpenShift: .*Running \(v\d+\.\d+\.\d+.*\).*`
expressionOpenshift := `.*OpenShift: .*Running \(v\d+\.\d+\.\d+.*\).*`
expressionMicroshift := `.*MicroShift: .*Running \(v\d+\.\d+\.\d+.*\).*`
expressionPodman := `.*Podman: .*\d+\.\d+\.\d+.*`
var expression string

err := util.ExecuteCommand("crc config get preset")
if err != nil {
return err
}

containsPreset := util.GetLastCommandOutput("stdout")
switch {
case strings.Contains(containsPreset, "podman"):
expression = expressionPodman
case strings.Contains(containsPreset, "microshift"):
expression = expressionMicroshift
default:
expression = expressionOpenshift
}

if state == "stopped" {
expression = ".*OpenShift: .*Stopped.*"
}

err := util.ExecuteCommand(CRC("status").ToString())
err = util.ExecuteCommand(CRC("status").ToString())
if err != nil {
return err
}
Expand Down

0 comments on commit bb83956

Please sign in to comment.