File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
cookbooks/aws-parallelcluster-slurm/spec/unit/recipes Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ require 'spec_helper'
2+
3+ describe 'aws-parallelcluster-slurm::clear_slurm_accounting' do
4+ for_all_oses do |platform , version |
5+ context "on #{ platform } #{ version } " do
6+ cached ( :chef_run ) do
7+ runner = runner ( platform : platform , version : version ) do |node |
8+ mock_file_exists ( "/var/spool/slurm.state/clustername" , true )
9+ node . override [ 'cluster' ] [ 'slurmdbd_service_enabled' ] = true
10+ end
11+ runner . converge ( described_recipe )
12+ end
13+ cached ( :node ) { chef_run . node }
14+
15+ it 'stops the slurm database daemon' do
16+ is_expected . to disable_service ( "slurmdbd" )
17+ end
18+
19+ it 'deletes the Slurm database password update script' do
20+ is_expected . to delete_file ( "#{ node [ 'cluster' ] [ 'scripts_dir' ] } /slurm/update_slurm_database_password.sh" )
21+ end
22+
23+ it 'Removes existing cluster name state file' do
24+ is_expected . to run_bash ( "Remove existing cluster name state file" )
25+ end
26+ end
27+ end
28+ end
Original file line number Diff line number Diff line change 1010 allow_any_instance_of ( Object ) . to receive ( :are_mount_or_unmount_required? ) . and_return ( false )
1111 allow_any_instance_of ( Object ) . to receive ( :dig ) . and_return ( true )
1212 RSpec ::Mocks . configuration . allow_message_expectations_on_nil = true
13+ mock_file_exists ( "/var/spool/slurm.state/clustername" , true )
1314 node . override [ 'cluster' ] [ 'slurmdbd_service_enabled' ] = enable_service
1415 end
1516 runner . converge ( described_recipe )
7071 )
7172 end
7273 if enable_service == "true"
74+ it 'Removes existing cluster name state file' do
75+ is_expected . to run_bash ( "Remove existing cluster name state file" )
76+ end
7377 it 'starts the slurm database daemon' do
7478 is_expected . to enable_service ( "slurmdbd" )
7579 is_expected . to start_service ( "slurmdbd" )
You can’t perform that action at this time.
0 commit comments