Skip to content

Commit

Permalink
Add tests to verify --output reg options are handled correctly.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Promislow <epromislow@suse.com>
  • Loading branch information
ericpromislow committed Jun 21, 2023
1 parent 94ca018 commit 4a08b21
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions bats/tests/preferences/list-settings-output.bats
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,38 @@ RD_USE_IMAGE_ALLOW_LIST=true
done
}

@test 'generates registry output for hklm/defaults' {
for option in reg reg,hklm reg,hklm,defaults reg,defaults; do
run rdctl list-settings --output "$option"
assert_success
assert_output --partial '[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\defaults\application]'
done
}

@test 'generates registry output for hklm/locked' {
for option in reg,hklm,locked reg,locked; do
run rdctl list-settings --output "$option"
assert_success
assert_output --partial '[HKEY_LOCAL_MACHINE\SOFTWARE\Profiles\Rancher Desktop\locked\application]'
done
}

@test 'generates registry output for hkcu/defaults' {
for option in reg,hkcu,defaults reg,hkcu; do
run rdctl list-settings --output "$option"
assert_success
assert_output --partial '[HKEY_CURRENT_USER\SOFTWARE\Profiles\Rancher Desktop\defaults\application]'
done
}

@test 'generates registry output for hkcu/locked' {
run rdctl list-settings --output reg,hkcu,locked
assert_success
assert_output --partial '[HKEY_CURRENT_USER\SOFTWARE\Profiles\Rancher Desktop\locked\application]'
}

# The result of the `assert_output` for heredocuments looks suspicious (I see it always passing),
# but this serves to document the expected full reg output
@test 'generates registry output' {
run rdctl list-settings --output reg
assert_success
Expand Down

0 comments on commit 4a08b21

Please sign in to comment.