-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move rdctl --output reg tests to bats.
Signed-off-by: Eric Promislow <epromislow@suse.com>
- Loading branch information
1 parent
d79b516
commit 94ca018
Showing
2 changed files
with
150 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters