From 33ca7f16de61fc1835c6110817cd390cec90ad09 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Mon, 28 Oct 2013 16:51:36 -0700
Subject: [PATCH] Handle situation to avoid shared nodes

---
 testsuite/expect/inc21.30.1 | 16 ++++++++--------
 testsuite/expect/inc21.30.6 |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/testsuite/expect/inc21.30.1 b/testsuite/expect/inc21.30.1
index 2b2f1065430..923450dca48 100644
--- a/testsuite/expect/inc21.30.1
+++ b/testsuite/expect/inc21.30.1
@@ -35,7 +35,7 @@ proc inc21_30_1 {} {
 	send_user "\nStarting GrpNode limit test\n\n"
 	set job_id1  0
 	set job_id2  0
-	spawn $salloc -N$grn_num --account=$acct $srun $bin_sleep 10
+	spawn $salloc -N$grn_num --account=$acct --exclusive $srun $bin_sleep 10
 	expect {
 		-re "Granted job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
@@ -51,10 +51,11 @@ proc inc21_30_1 {} {
 	}
 	if {$job_id1 == 0} {
 		send_user "\nFAILURE: jobs were not submitted\n"
-		exit 1
+		set exit_code 1
+		return
 	}
 
-	spawn $salloc -N1 --account=$acct $srun $bin_sleep 10
+	spawn $salloc -N1 --account=$acct --exclusive $srun $bin_sleep 10
 	expect {
 		-re "Granted job allocation ($number)" {
 			set job_id2 $expect_out(1,string)
@@ -74,13 +75,12 @@ proc inc21_30_1 {} {
 	}
 	if {$job_id2 == 0} {
 		send_user "\nFAILURE: jobs were not submitted\n"
-		cancel_job $job_id1
-		exit 1
+		set exit_code 1
+	} else {
+		# checks the state of the job
+		check_state $job_id2
 	}
 
-	# checks the state of the job
-	check_state $job_id2
-
 	# cancels remaining jobs
 	cancel_job $job_id1
 	cancel_job $job_id2
diff --git a/testsuite/expect/inc21.30.6 b/testsuite/expect/inc21.30.6
index 1d7b1f751ff..d5e3793b285 100644
--- a/testsuite/expect/inc21.30.6
+++ b/testsuite/expect/inc21.30.6
@@ -36,7 +36,7 @@ proc inc21_30_6 {} {
 	send_user "\nStarting MaxNode limit test\n\n"
 	set job_id1 0
 
-	spawn $salloc --account=$acct -N$maxnode_num $srun $bin_sleep 2
+	spawn $salloc --account=$acct -N$maxnode_num --exclusive -t1 $srun $bin_sleep 2
 	expect {
 		-re "Granted job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
@@ -58,7 +58,7 @@ proc inc21_30_6 {} {
 	# cancels remaining jobs
 	cancel_job $job_id1
 
-	spawn $salloc --account=$acct -N[expr $maxnode_num + 1] $srun $bin_sleep 2
+	spawn $salloc --account=$acct -N[expr $maxnode_num + 1] --exclusive -t1 $srun $bin_sleep 2
 	expect {
 		-re "Pending job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
-- 
GitLab