Add test7.15 to test for any signals blocked by default in job tasks.
---
testsuite/expect/Makefile.am | 2 +
testsuite/expect/Makefile.in | 2 +
testsuite/expect/README | 1 +
testsuite/expect/test7.15 | 87 ++++++++++++++++++++++++++++++++++++++
testsuite/expect/test7.15.prog.c | 25 +++++++++++
5 files changed, 117 insertions(+), 0 deletions(-)
create mode 100755 testsuite/expect/test7.15
create mode 100644 testsuite/expect/test7.15.prog.c
diff --git a/testsuite/expect/Makefile.am b/testsuite/expect/Makefile.am
index 2b40d4a..2f159b4 100644
--- a/testsuite/expect/Makefile.am
+++ b/testsuite/expect/Makefile.am
@@ -191,6 +191,8 @@ EXTRA_DIST = \
test7.14 \
test7.14.prog1.c \
test7.14.prog2.c \
+ test7.15 \
+ test7.15.prog.c \
test8.1 \
test8.2 \
test8.3 \
diff --git a/testsuite/expect/Makefile.in b/testsuite/expect/Makefile.in
index bb98c84..dad72be 100644
--- a/testsuite/expect/Makefile.in
+++ b/testsuite/expect/Makefile.in
@@ -471,6 +471,8 @@ EXTRA_DIST = \
test7.14 \
test7.14.prog1.c \
test7.14.prog2.c \
+ test7.15 \
+ test7.15.prog.c \
test8.1 \
test8.2 \
test8.3 \
diff --git a/testsuite/expect/README b/testsuite/expect/README
index 0e20828..da2bc85 100644
--- a/testsuite/expect/README
+++ b/testsuite/expect/README
@@ -316,6 +316,7 @@ test7.12 Test of slurm_job_step_stat() API call.
test7.13 Verify the correct setting of a job's ExitCode
test7.14 Verify the ability to modify the Derived Exit Code/String fields
of a job record in the database
+test7.15 Verify signal mask of tasks have no ignored signals.
test8.# Test of Blue Gene specific functionality.
diff --git a/testsuite/expect/test7.15 b/testsuite/expect/test7.15
new file mode 100755
index 0000000..29f6487
--- /dev/null
+++ b/testsuite/expect/test7.15
@@ -0,0 +1,87 @@
+#!/usr/bin/expect
+############################################################################
+# Purpose: Verify the ability to modify the Derived Exit Code and Comment
+# fields of a job record in the database.
+#
+# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+# "FAILURE: ..." otherwise with an explanation of the failure, OR
+# anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2010 Lawrence Livermore National Security.
+# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+# CODE-OCEC-09-009. All rights reserved.
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://www.schedmd.com/slurmdocs/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+############################################################################
+source ./globals
+
+set test_id "7.15"
+set exit_code 0
+set file_prog "test$test_id.prog"
+
+print_header $test_id
+
+#
+# Delete left-over programs and rebuild them.
+#
+exec $bin_rm -f $file_prog
+exec $bin_cc -O -o $file_prog ${file_prog}.c
+
+#
+# Run on multiple nodes in case the failure of this test
+# is intermittent.
+#
+if { $partition == "" } {
+ if { info exists $env(SLURM_PARTITION) } {
+ set partition $env(SLURM_PARTITION)
+ }
+ else {
+ set partition default_partition
+ }
+}
+set nnodes [available_nodes $partition]
+
+#
+# Run the test_prog to ensure that no signals are blocked by
+# default for the job.
+#
+set timeout $max_job_delay
+set srun_pid [exp_spawn $srun -N$nnodes -p $partition ./$file_prog]
+expect {
+ -re "Signal (.*) appears to be ignored" {
+ send_user "FAILURE: At least one signal is ignored!\n"
+ set exit_code 1
+ }
+ timeout {
+ send_user "\nFAILURE: srun not responding"
+ slow_kill $srun_pid
+ set exit_code 1
+ }
+ eof {
+ catch wait result
+ set exit_code [lindex $result 3]
+ }
+}
+
+if {$exit_code == 0} {
+ send_user "\nSUCCESS\n"
+ exec $bin_rm -f $file_prog
+}
+
+exit $exit_code
diff --git a/testsuite/expect/test7.15.prog.c b/testsuite/expect/test7.15.prog.c
new file mode 100644
index 0000000..456d5ba
--- /dev/null
+++ b/testsuite/expect/test7.15.prog.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+
+int main (int ac, char **av)
+{
+ char hostname[1024];
+ int i, rc = 0;
+ struct sigaction act;
+
+ if (gethostname (hostname, sizeof (hostname)) < 0) {
+ fprintf (stderr, "Failed to get hostname on this node\n");
+ strcpy (hostname, "Unknown");
+ }
+ for (i = 1; i < SIGRTMAX; i++) {
+ sigaction (i, NULL, &act);
+ if (act.sa_handler == SIG_DFL)
+ continue;
+ fprintf (stderr, "%s: Signal %d appears to be ignored!\n",
+ hostname, i);
+ rc = 1;
+ }
+ return (rc);
+}
--
1.7.1