Skip to content

Commit dec56c0

Browse files
dreambeyondorangehanwen-pcluste
authored andcommitted
Fix the kitchen test condition for ptrace_scope to switch on node type and add an efa kitchen test suite for the head node
1 parent 990354b commit dec56c0

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

kitchen.resources-config.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,32 @@ suites:
2626
resource: sticky_bits
2727
- name: efa_configure_compute
2828
run_list:
29+
- recipe[aws-parallelcluster::add_dependencies]
2930
- recipe[aws-parallelcluster-common::test_resource]
3031
verifier:
3132
controls:
3233
- efa_debian_system_settings_configured
3334
attributes:
3435
resource: efa:configure
3536
cluster:
36-
enable_efa: compute
37+
enable_efa: efa
3738
node_type: ComputeFleet
39+
dependencies:
40+
- recipe:aws-parallelcluster-common::node_attributes
41+
- name: efa_configure_headnode
42+
run_list:
43+
- recipe[aws-parallelcluster::add_dependencies]
44+
- recipe[aws-parallelcluster-common::test_resource]
45+
verifier:
46+
controls:
47+
- efa_debian_system_settings_configured
48+
attributes:
49+
resource: efa:configure
50+
cluster:
51+
enable_efa: efa
52+
node_type: HeadNode
53+
dependencies:
54+
- recipe:aws-parallelcluster-common::node_attributes
3855
- name: efs_configure
3956
run_list:
4057
- recipe[aws-parallelcluster::add_dependencies]
@@ -131,4 +148,4 @@ suites:
131148
nvidia:
132149
enabled: true
133150
driver:
134-
instance_type: g4dn.2xlarge
151+
instance_type: g4dn.2xlarge

test/resources/controls/aws_parallelcluster_config/efa_spec.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,21 @@
33

44
only_if { os.debian? && !os_properties.virtualized? }
55

6+
ptrace_scope = instance.head_node? ? 1 : 0
7+
if ptrace_scope == 1
8+
describe 'Verify ptrace config file is not present' do
9+
subject { file('/etc/sysctl.d/99-chef-kernel.yama.ptrace_scope.conf') }
10+
it { should_not exist }
11+
end
12+
else
13+
describe 'Verify ptrace config file is present' do
14+
subject { file('/etc/sysctl.d/99-chef-kernel.yama.ptrace_scope.conf') }
15+
it { should exist }
16+
its('content') { should match /kernel.yama.ptrace_scope = #{ptrace_scope}/ }
17+
end
18+
end
19+
620
describe kernel_parameter('kernel.yama.ptrace_scope') do
7-
its('value') { should eq 0 }
21+
its('value') { should eq ptrace_scope }
822
end
923
end

0 commit comments

Comments
 (0)