Skip to content

Commit

Permalink
[Bug] Adding different values for kernel-open option (#2733)
Browse files Browse the repository at this point in the history
Co-authored-by: Himani Deshpande <[email protected]>
  • Loading branch information
himani2411 and Himani Deshpande authored May 23, 2024
1 parent 26a3c9d commit 136014b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def compiler_version
end

def nvidia_kernel_module
if node['cluster']['nvidia']['kernel_open'] == "false"
if ['false', 'no', false].include?(node['cluster']['nvidia']['kernel_open'])
"kernel"
else
"kernel-open"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def self.setup(chef_run, nvidia_driver_version: nil)
end

describe 'nvidia_driver:nvidia_kernel_module' do
[%w(false kernel), %w(true kernel-open)].each do |kernel_open, kernel_module|
[%w(false kernel), [false, 'kernel'], %w(no kernel), %w(true kernel-open), [true, 'kernel-open'], %w(yes kernel-open)].each do |kernel_open, kernel_module|
context "node['cluster']['nvidia']['kernel_open'] is #{kernel_open}" do
cached(:chef_run) do
ChefSpec::SoloRunner.new(step_into: ['nvidia_driver']) do |node|
Expand Down

0 comments on commit 136014b

Please sign in to comment.