File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ load ' ../helpers/load'
2
+
3
+ # Verify various operations of `rdctl`
4
+
5
+ @test ' factory reset' {
6
+ factory_reset
7
+ }
8
+
9
+ @test ' start Rancher Desktop' {
10
+ start_container_engine
11
+ wait_for_container_engine
12
+ }
13
+
14
+ @test ' rdctl info' {
15
+ run --separate-stderr rdctl info
16
+ assert_success
17
+ assert_output --partial ' Version:'
18
+ }
19
+
20
+ @test ' rdctl info --output=json' {
21
+ run --separate-stderr rdctl info --output=json
22
+ assert_success
23
+ json=$output
24
+ run jq_output .version
25
+ assert_success
26
+ assert_output --regexp ' ^v1\.'
27
+ output=$json
28
+ run jq_output ' .["ip-address"]'
29
+ assert_success
30
+ assert_output --regexp ' ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
31
+ }
32
+
33
+ @test ' rdctl info --field version' {
34
+ run rdctl info --field version
35
+ assert_success
36
+ assert_output --regexp ' ^v1\.'
37
+ }
38
+
39
+ @test ' rdctl info --field ip-address' {
40
+ run rdctl info --field ip-address
41
+ assert_success
42
+ if is_windows; then
43
+ # On Windows, the IP address should be constant.
44
+ assert_output 192.168.127.2
45
+ elif is_linux; then
46
+ assert_output 192.168.5.15 # qemu slirp
47
+ elif is_macos; then
48
+ address=$output
49
+ if is_true " $( get_setting ' .application.adminAccess' ) " ; then
50
+ # This is provided by the user's DHCP server
51
+ output=$address assert_output --regexp ' ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
52
+ elif [[ $( get_setting .virtualMachine.type) == vz ]]; then
53
+ # macOS Virtualization.Framework NAT
54
+ output=$address assert_output --regexp ' ^192\.168\.205\.'
55
+ else
56
+ output=$address assert_output 192.168.5.15 # qemu slirp
57
+ fi
58
+ else
59
+ fail ' Unknown OS'
60
+ fi
61
+ }
You can’t perform that action at this time.
0 commit comments