Skip to content
Snippets Groups Projects
Commit 4e35e421 authored by Andreas Hamacher's avatar Andreas Hamacher
Browse files

adding an srun test

parent 57f53762
No related branches found
No related tags found
1 merge request!293Ubuntu
......@@ -147,6 +147,7 @@ tests:
- bash -e ./tests/run_tests.sh ManagementNodes "files/inventory.$STACKNAME" "../gc_key.pem"
- bash -e ./tests/run_tests.sh NFSNodes "files/inventory.$STACKNAME" "../gc_key.pem"
- bash -e ./tests/run_tests.sh SQLNodes "files/inventory.$STACKNAME" "../gc_key.pem"
- bash -e ./tests/run_tests.sh slurm "files/inventory.$STACKNAME" "../gc_key.pem"
extended:
stage: extended
......
#!/bin/bash
function usage {
echo $"Usage: $0 {all, ComputeNodes, LoginNodes, ManagementNodes, NFSNodes, sql}" INVENTORY_FILE KEY
echo $"Usage: $0 {all, ComputeNodes, LoginNodes, ManagementNodes, NFSNodes, sql, slurm}" INVENTORY_FILE KEY
exit 1
}
......@@ -23,22 +23,4 @@ function run_them ()
done
}
# I think I am just checking the if $1 is one of the listes strings (see usage) not proud of this at all but works
case "$1" in
all)
;;
ComputeNodes)
;;
ManagementNodes)
;;
NFSNodes)
;;
SQLNodes)
;;
LoginNodes)
;;
*)
usage
esac
run_them $1 $2 $3
\ No newline at end of file
---
- hosts: ManagementNodes,LoginNodes,ComputeNodes
gather_facts: false
tasks:
- name: add user hpctest
user:
name: hpctest
shell: /bin/bash
become: true
- hosts: ManagementNodes
gather_facts: false
tasks:
- name: Create a parent account
command: ./sacctmgr -i add account parentAccount cluster=m3 Description="Test parent account" Organization="Monash"
args:
chdir: '/opt/slurm-19.05.4/bin'
become: true
register: result
failed_when: result.rc != 0 and result.stdout != " Nothing new added."
- name: Create a project associated with a given parent
command: /opt/slurm-19.05.4/bin/sacctmgr -i add account testProject parent=parentAccount cluster=m3 Organization="Monash"
args:
chdir: '/opt/slurm-19.05.4/bin'
become: true
register: result
failed_when: result.rc != 0 and result.stdout != " Nothing new added."
- name: Create a user and associate them with a project
command: /opt/slurm-19.05.4/bin/sacctmgr -i create user hpctest cluster=m3 account=testProject
args:
chdir: '/opt/slurm-19.05.4/bin'
become: true
register: result
failed_when: result.rc != 0 and result.stdout != " Nothing new added."
- hosts: ComputeNodes
gather_facts: false
tasks:
- name:
command: ./srun --ntasks=1 --partition=batch hostname
args:
chdir: '/opt/slurm-19.05.4/bin/'
become: true
become_user: hpctest
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment