@@ -21,6 +21,7 @@ def self.update(chef_run)
21
21
script_dir = 'SCRIPT_DIR'
22
22
slurm_install_dir = 'SLURM_INSTALL_DIR'
23
23
block_sizes = '9,18'
24
+ new_block_size = '1,2'
24
25
cluster_config = 'CONFIG_YAML'
25
26
cookbook_env = 'FAKE_COOKBOOK_PATH'
26
27
force_configuration_extra_args = ' --force-configuration'
@@ -162,9 +163,8 @@ def self.update(chef_run)
162
163
chef_run . find_resource ( 'block_topology' , 'update' )
163
164
end
164
165
165
- context "when queues are updated and topolog.conf does exists" do
166
+ context "when capacity block is removed and topolog.conf does exists" do
166
167
before do
167
- allow_any_instance_of ( Object ) . to receive ( :are_queues_updated? ) . and_return ( true )
168
168
allow ( File ) . to receive ( :exist? ) . with ( "#{ slurm_install_dir } /etc/topology.conf" ) . and_return ( true )
169
169
chef_run . node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = nil
170
170
end
@@ -174,20 +174,19 @@ def self.update(chef_run)
174
174
end
175
175
end
176
176
177
- context "when queues are not updated and topolog.conf does not exists" do
177
+ context "when capacity block is not used and topolog.conf does not exists" do
178
178
before do
179
- allow_any_instance_of ( Object ) . to receive ( :are_queues_updated? ) . and_return ( false )
180
179
allow ( File ) . to receive ( :exist? ) . with ( "#{ slurm_install_dir } /etc/topology.conf" ) . and_return ( false )
180
+ chef_run . node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = nil
181
181
end
182
182
183
183
it 'it gives nil' do
184
184
expect ( resource . topology_generator_command_args ) . to eq ( nil )
185
185
end
186
186
end
187
187
188
- context "when queues are updated and topolog.conf does not exists" do
188
+ context "when capacity block is updated and topolog.conf does not exists" do
189
189
before do
190
- allow_any_instance_of ( Object ) . to receive ( :are_queues_updated? ) . and_return ( true )
191
190
allow ( File ) . to receive ( :exist? ) . with ( "#{ slurm_install_dir } /etc/topology.conf" ) . and_return ( false )
192
191
chef_run . node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = block_sizes
193
192
end
@@ -197,6 +196,17 @@ def self.update(chef_run)
197
196
end
198
197
end
199
198
199
+ context "when capacity block is updated and topolog.conf does exists" do
200
+ before do
201
+ allow ( File ) . to receive ( :exist? ) . with ( "#{ slurm_install_dir } /etc/topology.conf" ) . and_return ( true )
202
+ chef_run . node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = new_block_size
203
+ end
204
+
205
+ it 'returns block-sizes argument' do
206
+ expect ( resource . topology_generator_command_args ) . to eq ( " --block-sizes #{ new_block_size } " )
207
+ end
208
+ end
209
+
200
210
context "when block sizes is not nil" do
201
211
before do
202
212
chef_run . node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = block_sizes
0 commit comments