Skip to content
Permalink
Browse files

TST: Cover slurm_ips()

  • Loading branch information
pan14001 committed Jun 22, 2017
1 parent ea7ff69 commit a80fe9a2150f7cfd63a0b3d4158c791455fd3db5
Showing with 9 additions and 1 deletion.
  1. +9 −1 tests/slurm.bats
10 tests/slurm.bats 100644 → 100755
@@ -4,10 +4,11 @@ source $BATS_TEST_DIRNAME/../dietslurm

setup() {
SLURM_JOB_ID=123
SLURM_JOB_NODELIST=login[1-3]
}

teardown() {
unset SLURM_JOB_ID
unset SLURM_JOB_ID SLURM_JOB_NODELIST
}

@test "SLURM job is detected" {
@@ -21,3 +22,10 @@ teardown() {
[[ $status = 1 ]]
[[ "${output}" == *"${magic_job_string}"* ]]
}

@test "SLURM IP addresses are returned one per line" {
run slurm_ips
nlines=$(nodeset -c ${SLURM_JOB_NODELIST})
[[ $status = 0 ]]
[[ ${#lines[*]} -eq $nlines ]]
}

0 comments on commit a80fe9a

Please sign in to comment.
You can’t perform that action at this time.