-
Notifications
You must be signed in to change notification settings - Fork 284
/
list-settings-output.bats
150 lines (118 loc) · 4.56 KB
/
list-settings-output.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
load '../helpers/load'
RD_USE_IMAGE_ALLOW_LIST=true
@test 'factory reset' {
factory_reset
# bypass the defaults deployment file
mkdir -p "$(dirname "${PATH_CONFIG_FILE})")"
touch "$PATH_CONFIG_FILE"
}
@test 'start app' {
start_container_engine
wait_for_container_engine
}
@test 'report parameters for json' {
run rdctl list-settings '--output=json,fish'
assert_failure
assert_output --partial 'the json output format takes no sub-formats, got "json,fish"'
}
@test 'report unrecognized output-options' {
run rdctl list-settings '--output=bickley,ruff'
assert_failure
assert_output --partial $'expecting an output format of \'json\' or \'reg\', got "bickley,ruff"'
}
@test 'report unrecognized reg sub-options' {
run rdctl list-settings '--output=reg,hklm,ruff'
assert_failure
assert_output --partial 'expecting a reg output-format parameter, got "ruff" in "reg,hklm,ruff"'
}
@test 'report duplicate reg hives' {
for x in hklm hkcu; do
for y in hklm hkcu; do
option="reg,${x},locked,${y}"
run rdctl list-settings "--output=${option}"
assert_failure
assert_output --partial $"already specified registry hive \"${x}\" in \"${option}\", can't respecify"
done
done
}
@test 'report duplicate registry sections' {
for x in defaults locked; do
for y in defaults locked; do
option="reg,${x},hkcu,${y}"
run rdctl list-settings "--output=${option}"
assert_failure
assert_output --partial $"already specified registry section \"${x}\" in \"${option}\", can't respecify"
done
done
}
@test 'generates registry output' {
run rdctl list-settings --output reg
assert_success
assert_output <<'EOF'
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles]
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop]
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults]
"version"=dword:8
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\application]
"adminAccess"=dword:0
"debug"=dword:0
"pathManagementStrategy"="rcfiles"
"autoStart"=dword:0
"startInBackground"=dword:0
"hideNotificationIcon"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\application\extensions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\application\extensions\allowed]
"enabled"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\application\telemetry]
"enabled"=dword:1
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\application\updater]
"enabled"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\application\window]
"quitOnClose"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\containerEngine]
"name"="moby"
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\containerEngine\allowedImages]
"enabled"=dword:1
"patterns"=hex(7):66,00,69,00,73,00,68,00,00,00,73,00,68,00,65,00,65,00,70,00,00,00,63,00,6f,00,77,00,73,00,00,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\virtualMachine]
"memoryInGB"=dword:4
"numberCPUs"=dword:2
"hostResolver"=dword:1
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\kubernetes]
"version"="1.25.9"
"port"=dword:192b
"enabled"=dword:1
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\kubernetes\options]
"traefik"=dword:1
"flannel"=dword:1
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\kubernetes\ingress]
"localhostOnly"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\experimental]
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\experimental\virtualMachine]
"socketVMNet"=dword:0
"networkingTunnel"=dword:0
"type"="qemu"
"useRosetta"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\experimental\virtualMachine\mount]
"type"="reverse-sshfs"
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\experimental\virtualMachine\mount\9p]
"securityModel"="none"
"protocolVersion"="9p2000.L"
"msizeInKib"=dword:80
"cacheMode"="mmap"
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\experimental\virtualMachine\proxy]
"enabled"=dword:0
"address"=""
"password"=""
"port"=dword:c38
"username"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\portForwarding]
"includeKubernetesServices"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\images]
"showAll"=dword:1
"namespace"="k8s.io"
[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\diagnostics]
"showMuted"=dword:0
EOF
}