Skip to content
Snippets Groups Projects
Commit b1cf7b08 authored by Morris Jette's avatar Morris Jette
Browse files

harden test38.6 more

parent 3cdc190f
No related branches found
No related tags found
No related merge requests found
...@@ -276,18 +276,23 @@ if {[wait_for_file $file_out] == 0} { ...@@ -276,18 +276,23 @@ if {[wait_for_file $file_out] == 0} {
wait wait
} }
} }
set fail_cnt 0
if {$matches_sbatch != 2} { if {$matches_sbatch != 2} {
send_user "\nFAILURE: local (sbatch) sbatch spank plugin failure ($matches_sbatch != 2)\n" send_user "\nFAILURE: local (sbatch) sbatch spank plugin failure ($matches_sbatch != 2)\n"
end_it 1 set fail_cnt 1
} elseif {$matches_srun != 2} { }
if {$matches_srun != 2} {
send_user "\nFAILURE: local (srun) srun spank plugin failure ($matches_srun != 2)\n" send_user "\nFAILURE: local (srun) srun spank plugin failure ($matches_srun != 2)\n"
end_it 1 set fail_cnt 1
} elseif {$matches != 2} { }
if {$matches != 2} {
send_user "\nFAILURE: local (srun) spank plugin failure ($matches != 2)\n" send_user "\nFAILURE: local (srun) spank plugin failure ($matches != 2)\n"
set fail_cnt 1
}
if {$fail_cnt != 0} {
end_it 1 end_it 1
} else {
send_user "\nlocal (srun) spank plugin success\n"
} }
send_user "\nlocal (srun) spank plugin success\n"
} else { } else {
end_it 1 end_it 1
} }
...@@ -363,6 +368,8 @@ if {[wait_for_file $spank_out] == 0} { ...@@ -363,6 +368,8 @@ if {[wait_for_file $spank_out] == 0} {
end_it 1 end_it 1
} }
send_user "\nRemote (slurmd) spank plugin success\n" send_user "\nRemote (slurmd) spank plugin success\n"
} else {
end_it 1
} }
end_it $exit_code end_it $exit_code
...@@ -147,16 +147,19 @@ int slurm_spank_task_init(spank_t sp, int ac, char **av) ...@@ -147,16 +147,19 @@ int slurm_spank_task_init(spank_t sp, int ac, char **av)
char hostname[64] = ""; char hostname[64] = "";
gethostname(hostname, sizeof(hostname)); gethostname(hostname, sizeof(hostname));
if (opt_out_file) { if (opt_out_file && (opt_arg_sbatch || opt_arg_srun)) {
FILE *fp = NULL; FILE *fp = NULL;
usleep(getpid() % 500000); /* Reduce NFS collisions */
for (i = 0; (i < 10) && !fp; i++) for (i = 0; (i < 10) && !fp; i++)
fp = fopen(opt_out_file, "a"); fp = fopen(opt_out_file, "a");
if (!fp) if (!fp) {
slurm_error("%s: could not open %s",
__func__, opt_out_file);
return -1; return -1;
if (opt_arg_sbatch || opt_arg_srun) }
usleep(getpid() % 500000); /* Reduce NFS collisions */
fprintf(fp, "%s: opt_arg_sbatch=%d opt_arg_srun=%d hostname=%s\n", fprintf(fp, "%s: opt_arg_sbatch=%d opt_arg_srun=%d hostname=%s\n",
__func__, opt_arg_sbatch, opt_arg_srun, hostname); __func__, opt_arg_sbatch, opt_arg_srun, hostname);
fflush(fp);
if (spank_get_item(sp, S_JOB_UID, &my_uid) == ESPANK_SUCCESS) if (spank_get_item(sp, S_JOB_UID, &my_uid) == ESPANK_SUCCESS)
fprintf(fp, "spank_get_item: my_uid=%d\n", my_uid); fprintf(fp, "spank_get_item: my_uid=%d\n", my_uid);
if (spank_get_item(sp, S_JOB_ARGV, &argc, &argv) == if (spank_get_item(sp, S_JOB_ARGV, &argc, &argv) ==
...@@ -189,14 +192,16 @@ int slurm_spank_exit(spank_t sp, int ac, char **av) ...@@ -189,14 +192,16 @@ int slurm_spank_exit(spank_t sp, int ac, char **av)
int i; int i;
gethostname(hostname, sizeof(hostname)); gethostname(hostname, sizeof(hostname));
if (opt_out_file) { if (opt_out_file && (opt_arg_sbatch || opt_arg_srun)) {
FILE *fp = NULL; FILE *fp = NULL;
usleep(getpid() % 500000); /* Reduce NFS collisions */
for (i = 0; (i < 10) && !fp; i++) for (i = 0; (i < 10) && !fp; i++)
fp = fopen(opt_out_file, "a"); fp = fopen(opt_out_file, "a");
if (!fp) if (!fp) {
slurm_error("%s: could not open %s",
__func__, opt_out_file);
return -1; return -1;
if (opt_arg_sbatch || opt_arg_srun) }
usleep(getpid() % 500000); /* Reduce NFS collisions */
fprintf(fp, "%s: opt_arg_sbatch=%d opt_arg_srun=%d hostname=%s\n", fprintf(fp, "%s: opt_arg_sbatch=%d opt_arg_srun=%d hostname=%s\n",
__func__, opt_arg_sbatch, opt_arg_srun, hostname); __func__, opt_arg_sbatch, opt_arg_srun, hostname);
fclose(fp); fclose(fp);
......
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