-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Login Nodes] Add unit tests to cover loginmgtd.
Signed-off-by: Giacomo Marciani <mgiacomo@amazon.com>
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
cookbooks/aws-parallelcluster-slurm/spec/unit/recipes/login_nodes_daemon_service_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
require 'spec_helper' | ||
|
||
describe 'aws-parallelcluster-slurm::login_nodes_daemon_service' do | ||
for_all_oses do |platform, version| | ||
context "on #{platform}#{version}" do | ||
cached(:chef_run) do | ||
runner(platform: platform, version: version).converge(described_recipe) | ||
end | ||
|
||
it 'creates the loginmgtd configuration with the correct attributes' do | ||
is_expected.to create_template('/opt/parallelcluster/shared_login_nodes/loginmgtd_config.json').with( | ||
source: 'slurm/login/loginmgtd_config.json.erb', | ||
owner: 'pcluster-admin', | ||
group: 'pcluster-admin', | ||
mode: '0644' | ||
) | ||
end | ||
|
||
it 'creates the loginmgtd script with the correct attributes' do | ||
is_expected.to create_template('/opt/parallelcluster/shared_login_nodes/loginmgtd.sh').with( | ||
source: 'slurm/login/loginmgtd.sh.erb', | ||
owner: 'pcluster-admin', | ||
group: 'pcluster-admin', | ||
mode: '0744' | ||
) | ||
end | ||
|
||
it 'creates the loginmgtd termination hook script with the correct attributes' do | ||
is_expected.to create_template('/opt/parallelcluster/shared_login_nodes/loginmgtd_on_termination.sh').with( | ||
source: 'slurm/login/loginmgtd_on_termination.sh.erb', | ||
owner: 'pcluster-admin', | ||
group: 'pcluster-admin', | ||
mode: '0744' | ||
) | ||
end | ||
|
||
it 'creates the loginmgtd sudoers configuration with the correct attributes' do | ||
is_expected.to create_template('/etc/sudoers.d/99-parallelcluster-loginmgtd').with( | ||
source: 'slurm/login/99-parallelcluster-loginmgtd.erb', | ||
owner: 'root', | ||
group: 'root', | ||
mode: '0600' | ||
) | ||
end | ||
end | ||
end | ||
end |