Revision e9a52589
Added by Oleh Fedorenko about 3 years ago
test/unit/foreman/renderer/scope/macros/host_template_test.rb | ||
---|---|---|
|
||
test 'grub_pass helper returns the grub password if enabled' do
|
||
@scope.instance_variable_set('@host', host)
|
||
@scope.instance_variable_set('@grub', true)
|
||
FactoryBot.create(:parameter, name: 'encrypt_grub', value: 'true')
|
||
assert_equal "--iscrypted --password=#{host.grub_pass}", @scope.grub_pass
|
||
end
|
||
|
||
test "grub_pass helper doesn't return the grub password if disabled" do
|
||
@scope.instance_variable_set('@host', host)
|
||
FactoryBot.create(:parameter, name: 'encrypt_grub', value: 'false')
|
||
assert_equal '', @scope.grub_pass
|
||
end
|
||
end
|
||
|
||
describe '#ks_console' do
|
Also available in: Unified diff
Fixes #32394 - Use grub_pass macro instead of variable
The default Kickstart template uses obsolete @grub_pass variable
which are not being set anywhere. Maybe it's due to typo or else.
I suggest to use macro instead so it's possible to set the password
via host params and do not clone the template for this purpose only.