Skip to content

Commit a6ca546

Browse files
committed
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 d773755 commit a6ca546

File tree

3 files changed

+46
-18
lines changed

3 files changed

+46
-18
lines changed

test/e2e/features/basic.feature

+6
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,19 @@ Feature: Basic test
3131
@darwin @linux @windows @cleanup
3232
Scenario: CRC start usecase
3333
Given executing "crc setup --check-only" fails
34+
And unsetting config property "developer-password" succeeds
3435
# Request start with monitoring stack
3536
* setting config property "enable-cluster-monitoring" to value "true" succeeds
3637
* setting config property "memory" to value "16000" succeeds
3738
Given executing single crc setup command succeeds
3839
And executing "man -P cat crc" succeeds
3940
When starting CRC with default bundle succeeds
4041
Then stdout should contain "Started the OpenShift cluster"
42+
And stdout should contain "Log in as administrator:"
43+
And stdout should contain " Username: kubeadmin"
44+
And stdout should contain "Log in as user:"
45+
And stdout should contain " Username: developer"
46+
And stdout should contain " Password: developer"
4147
# Check if user can copy-paste login details for developer and kubeadmin users
4248
* stdout should match "(?s)(.*)oc login -u developer https:\/\/api\.crc\.testing:6443(.*)$"
4349
* stdout should match "(?s)(.*)https:\/\/console-openshift-console\.apps-crc\.testing(.*)$"

test/e2e/features/config.feature

+21-18
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)
@@ -171,14 +174,14 @@ Feature: Test configuration settings
171174
When unsetting config property "preset" succeeds
172175
And stdout should contain "Successfully unset configuration property 'preset'"
173176
And "JSON" config file "crc.json" in CRC home folder does not contain key "preset"
174-
175-
@linux @darwin @windows
177+
178+
@linux @darwin @windows
176179
Examples: Config property preset setting positive
177180
| preset-value |
178181
| microshift |
179182
| okd |
180183

181-
Scenario: CRC config set preset (negtive cases)
184+
Scenario: CRC config set preset (negative cases)
182185
When setting config property "preset" to value "<preset-value>" fails
183186
And stderr should contain "reason: Unknown preset"
184187

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)