@@ -154,13 +154,26 @@ def self.update(chef_run)
154154 cached ( :chef_run ) do
155155 runner ( platform : platform , version : version , step_into : [ 'block_topology' ] ) do |node |
156156 node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = nil
157+ node . override [ 'cluster' ] [ 'slurm' ] [ 'install_dir' ] = slurm_install_dir
157158 end
158159 end
159160 cached ( :resource ) do
160161 ConvergeBlockTopology . update ( chef_run )
161162 chef_run . find_resource ( 'block_topology' , 'update' )
162163 end
163164
165+ context "when queues are updated and topolog.conf does exists" do
166+ before do
167+ allow_any_instance_of ( Object ) . to receive ( :are_queues_updated? ) . and_return ( true )
168+ allow ( File ) . to receive ( :exist? ) . with ( "#{ slurm_install_dir } /etc/topology.conf" ) . and_return ( true )
169+ chef_run . node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = nil
170+ end
171+
172+ it 'returns cleanup' do
173+ expect ( resource . topology_generator_command_args ) . to eq ( " --cleanup" )
174+ end
175+ end
176+
164177 context "when queues are not updated and topolog.conf does not exists" do
165178 before do
166179 allow_any_instance_of ( Object ) . to receive ( :are_queues_updated? ) . and_return ( false )
@@ -172,6 +185,18 @@ def self.update(chef_run)
172185 end
173186 end
174187
188+ context "when queues are updated and topolog.conf does not exists" do
189+ before do
190+ allow_any_instance_of ( Object ) . to receive ( :are_queues_updated? ) . and_return ( true )
191+ allow ( File ) . to receive ( :exist? ) . with ( "#{ slurm_install_dir } /etc/topology.conf" ) . and_return ( false )
192+ chef_run . node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = block_sizes
193+ end
194+
195+ it 'returns block-sizes argument' do
196+ expect ( resource . topology_generator_command_args ) . to eq ( " --block-sizes #{ block_sizes } " )
197+ end
198+ end
199+
175200 context "when block sizes is not nil" do
176201 before do
177202 chef_run . node . override [ 'cluster' ] [ 'p6egb200_block_sizes' ] = block_sizes
0 commit comments