Skip to content

Commit 695cab8

Browse files
rohanKanojiapraveenkumar
authored andcommitted
test (e2e) : add e2e test for developer-password config option
+ Add additional assertions in basic test to verify that when no developer password is configured, then "developer" value is used for password + Add custom_developer_password e2e test to verify that when custom developer-password configuration option is provided, then that custom value is used as developer password Signed-off-by: Rohan Kumar <[email protected]>
1 parent b8ed1ac commit 695cab8

File tree

3 files changed

+44
-16
lines changed

3 files changed

+44
-16
lines changed

test/e2e/features/basic.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,18 @@ Feature: Basic test
3030
@darwin @linux @windows @cleanup
3131
Scenario: CRC start usecase
3232
Given executing "crc setup --check-only" fails
33+
And unsetting config property "developer-password" succeeds
3334
# Request start with monitoring stack
3435
* setting config property "enable-cluster-monitoring" to value "true" succeeds
3536
* setting config property "memory" to value "16000" succeeds
3637
Given executing single crc setup command succeeds
3738
When starting CRC with default bundle succeeds
3839
Then stdout should contain "Started the OpenShift cluster"
40+
And stdout should contain "Log in as administrator:"
41+
And stdout should contain " Username: kubeadmin"
42+
And stdout should contain "Log in as user:"
43+
And stdout should contain " Username: developer"
44+
And stdout should contain " Password: developer"
3945
# Check if user can copy-paste login details for developer and kubeadmin users
4046
* stdout should match "(?s)(.*)oc login -u developer https:\/\/api\.crc\.testing:6443(.*)$"
4147
* stdout should match "(?s)(.*)https:\/\/console-openshift-console\.apps-crc\.testing(.*)$"

test/e2e/features/config.feature

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,30 @@ Feature: Test configuration settings
1717
# always return to default values
1818
@darwin
1919
Examples: Config settings on Mac
20-
| property | value1 | value2 |
21-
| cpus | 5 | 3 |
22-
| memory | 10753 | 4096 |
23-
| nameserver | 120.0.0.1 | 999.999.999.999 |
24-
| pull-secret-file | /etc | /nonexistent-file |
20+
| property | value1 | value2 |
21+
| cpus | 5 | 3 |
22+
| memory | 10753 | 4096 |
23+
| nameserver | 120.0.0.1 | 999.999.999.999 |
24+
| pull-secret-file | /etc | /nonexistent-file |
25+
| developer-password | secret1 | |
2526

2627
@linux
2728
Examples: Config settings on Linux
28-
| property | value1 | value2 |
29-
| cpus | 5 | 3 |
30-
| memory | 10753 | 4096 |
31-
| nameserver | 120.0.0.1 | 999.999.999.999 |
32-
| pull-secret-file | /etc | /nonexistent-file |
29+
| property | value1 | value2 |
30+
| cpus | 5 | 3 |
31+
| memory | 10753 | 4096 |
32+
| nameserver | 120.0.0.1 | 999.999.999.999 |
33+
| pull-secret-file | /etc | /nonexistent-file |
34+
| developer-password | secret1 | |
3335

3436
@windows
3537
Examples: Config settings on Windows
36-
| property | value1 | value2 |
37-
| cpus | 5 | 3 |
38-
| memory | 10753 | 4096 |
39-
| nameserver | 120.0.0.1 | 999.999.999.999 |
40-
| pull-secret-file | /Users | /nonexistent-file |
38+
| property | value1 | value2 |
39+
| cpus | 5 | 3 |
40+
| memory | 10753 | 4096 |
41+
| nameserver | 120.0.0.1 | 999.999.999.999 |
42+
| pull-secret-file | /Users | /nonexistent-file |
43+
| developer-password | secret1 | |
4144

4245
@linux @darwin @windows
4346
Scenario: CRC config checks (bundle version)
@@ -182,7 +185,7 @@ Feature: Test configuration settings
182185
| preset-value |
183186
| microshift |
184187

185-
Scenario: CRC config set preset (negtive cases)
188+
Scenario: CRC config set preset (negative cases)
186189
When setting config property "preset" to value "<preset-value>" fails
187190
And stderr should contain "reason: Unknown preset"
188191

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@story_custom_developer_password
2+
Feature: Custom Developer Password Test
3+
4+
User provides configuration property to override default developer user password
5+
6+
Background:
7+
Given ensuring CRC cluster is running
8+
9+
@linux @windows @darwin @cleanup
10+
Scenario: Override default developer password should be reflected during crc start
11+
Given executing "crc stop" succeeds
12+
And setting config property "developer-password" to value "secret-dev" succeeds
13+
When starting CRC with default bundle succeeds
14+
Then stdout should contain "Started the OpenShift cluster"
15+
And stdout should contain "Log in as administrator:"
16+
And stdout should contain " Username: kubeadmin"
17+
And stdout should contain "Log in as user:"
18+
And stdout should contain " Username: developer"
19+
And stdout should contain " Password: secret-dev"

0 commit comments

Comments
 (0)