diff --git a/testsuite/expect/inc21.30.1 b/testsuite/expect/inc21.30.1
index 0da815fbf5e01477cddce82fdb0f07870016f4bf..2b2f1065430f634640ba775488236abbc535fa2a 100644
--- a/testsuite/expect/inc21.30.1
+++ b/testsuite/expect/inc21.30.1
@@ -29,12 +29,13 @@ proc inc21_30_1 {} {
 
 #test GrpNode limit
 
-	global srun salloc acct bin_sleep number
+	global srun salloc acct bin_sleep number grn_num
 	global exit_code
 
+	send_user "\nStarting GrpNode limit test\n\n"
 	set job_id1  0
 	set job_id2  0
-	spawn $salloc -N1 --account=$acct $srun $bin_sleep 10
+	spawn $salloc -N$grn_num --account=$acct $srun $bin_sleep 10
 	expect {
 		-re "Granted job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
@@ -53,7 +54,7 @@ proc inc21_30_1 {} {
 		exit 1
 	}
 
-	spawn $salloc -N2 --account=$acct $srun $bin_sleep 10
+	spawn $salloc -N1 --account=$acct $srun $bin_sleep 10
 	expect {
 		-re "Granted job allocation ($number)" {
 			set job_id2 $expect_out(1,string)
diff --git a/testsuite/expect/inc21.30.2 b/testsuite/expect/inc21.30.2
index d97d560a9f9bbee968dcd060b8de4b0d885281af..9f3d590b1db36a41abd983ec6772d1b19c29ce13 100644
--- a/testsuite/expect/inc21.30.2
+++ b/testsuite/expect/inc21.30.2
@@ -31,9 +31,11 @@ proc inc21_30_2 {} {
 #test GrpCpus
 
      global srun salloc acct bin_sleep jobmatch job_id1 job_id2 number exit_code
+     global grcpu_num
 
+     send_user "\nStarting GrpCPUs limit test\n\n"
      set jobmatch 0
-     spawn $salloc --account=$acct -n6 $srun $bin_sleep 5
+     spawn $salloc --account=$acct -n$grcpu_num $srun $bin_sleep 5
      expect {
 	     -re "Granted job allocation ($number)" {
 		     set job_id1 $expect_out(1,string)
@@ -49,7 +51,7 @@ proc inc21_30_2 {} {
 	     }
      }
 
-     spawn $salloc --account=$acct -n6 $srun $bin_sleep 5
+     spawn $salloc --account=$acct -n1 $srun $bin_sleep 5
      expect {
 	     -re "job ($number)" {
 		     set job_id2 $expect_out(1,string)
diff --git a/testsuite/expect/inc21.30.3 b/testsuite/expect/inc21.30.3
index 6ca2c8d8d5620122d894576feabd6e73508b3791..843b3a1b704a9e898cc72d99a8aad9d51bd93a95 100644
--- a/testsuite/expect/inc21.30.3
+++ b/testsuite/expect/inc21.30.3
@@ -30,56 +30,42 @@
 proc inc21_30_3 {} {
 
 # test GrpJob limits
+	global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code grjobs_num
 
-	global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code
+	send_user "\nStarting GrpJob limit test\n\n"
+	set check_num $grjobs_num
 
 	set jobmatch 0
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "Granted job allocation ($number)" {
-			set job_id1 $expect_out(1,string)
-			send_user "\njob $job_id1 was submitted\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
-		}
-	}
-
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "Granted job allocation ($number)" {
-			set job_id2 $expect_out(1,string)
-			send_user "\njob $job_id2 was submitted\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-
-		}
-		eof {
-			wait
-		}
-	}
-
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "job ($number)" {
-			set job_id3 $expect_out(1,string)
-			send_user "\nJob $job_id3 is waiting for resources. This is expected\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
+	for {set inx 0} {$inx <= $check_num} {incr inx} {
+		spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
+		expect {
+			-re "Granted job allocation ($number)" {
+				set job_id($inx) $expect_out(1,string)
+				if {$inx < $check_num} {
+					send_user "\njob $inx $job_id($inx) was submitted\n"
+					incr jobmatch
+				} else {
+					send_user "\nFAILURE: Job $inx $job_id($inx) wasn't suppose to work but it did, limit was $check_num?\n"
+					set exit_code 1
+				}
+			}
+			-re "job ($number) queued and waiting for resources" {
+				set job_id($inx) $expect_out(1,string)
+				if {$inx >= $check_num} {
+					send_user "\nJob $inx $job_id($inx) is waiting for resources. This is expected\n"
+					incr jobmatch
+				} else {
+					send_user "\nFAILURE: Job $inx $job_id($inx) was suppose to work but it didn't, limit was $check_num?\n"
+					set exit_code 1
+				}
+			}
+			timeout {
+				send_user "\nFAILURE: salloc is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
 		}
 	}
 
@@ -89,13 +75,19 @@ proc inc21_30_3 {} {
 	}
 
 	#checks the job state
-	check_state $job_id3
-
-	# cancels the remaining jobs
-	cancel_job $job_id1
-	cancel_job $job_id2
-	cancel_job $job_id3
+	if [info exists job_id($check_num)] {
+		check_state $job_id($check_num)
+	} else {
+		send_user "\nFAILURE: didn't attempt to start enough jobs\n"
+		set exit_code 1
+	}
 
+	for {set inx 0} {$inx <= $check_num} {incr inx} {
+		if [info exists job_id($inx)] {
+			# cancels the jobs
+			cancel_job $job_id($inx)
+		}
+	}
 }
 
 
diff --git a/testsuite/expect/inc21.30.4 b/testsuite/expect/inc21.30.4
index 876dfdecb0222dc46a774d931cdf3f6adcd11507..e4f4b6e535677f9c22ed258739f3968cb4714984 100644
--- a/testsuite/expect/inc21.30.4
+++ b/testsuite/expect/inc21.30.4
@@ -31,70 +31,54 @@ proc inc21_30_4 {} {
 
 # test GrpSubmit
 
-	global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code
+	global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code grsub_num
 
-	set jobmatch 0
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "Granted job allocation ($number)" {
-			set job_id1 $expect_out(1,string)
-			send_user "\njob $job_id1 was submitted\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
-		}
-	}
+	send_user "\nStarting GrpSubmit limit test\n\n"
+	set check_num $grsub_num
 
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "Granted job allocation ($number)" {
-			set job_id2 $expect_out(1,string)
-			send_user "\njob $job_id2 was submitted\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
-		}
-	}
-
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "error" {
-			set job_id3 $expect_out(1,string)
-			send_user "\nThis error is expected do not worry\n"
-			incr jobmatch
-		}
-		-re "Granted job allocation" {
-			send_user "\nThis should have failed but did not\n"
-			set exit_code 1
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
+	set jobmatch 0
+	for {set inx 0} {$inx <= $check_num} {incr inx} {
+		spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
+		expect {
+			-re "Granted job allocation ($number)" {
+				set job_id($inx) $expect_out(1,string)
+				if {$inx < $check_num} {
+					send_user "\njob $inx $job_id($inx) was submitted\n"
+					incr jobmatch
+				} else {
+					send_user "\nFAILURE: Job $inx $job_id($inx) wasn't suppose to work but it did, limit was $check_num?\n"
+					set exit_code 1
+				}
+			}
+			-re "error" {
+				if {$inx >= $check_num} {
+					send_user "\nJob $inx didn't get submitted. This is expected\n"
+					incr jobmatch
+				} else {
+					send_user "\nFAILURE: Job $inx $job_id($inx) was suppose to work but it didn't, limit was $check_num?\n"
+					set exit_code 1
+				}
+			}
+			timeout {
+				send_user "\nFAILURE: salloc is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
 		}
 	}
 
-	if {$jobmatch==0} {
+	if {$jobmatch == 0} {
 		send_user "\nFAILURE: jobs were not submitted\n"
 		set exit_code 1
 	}
 
-	# cancels the remaining jobs
-	cancel_job $job_id1
-	cancel_job $job_id2
-	cancel_job $job_id3
-
+	for {set inx 0} {$inx <= $check_num} {incr inx} {
+		if [info exists job_id($inx)] {
+			# cancels the jobs
+			cancel_job $job_id($inx)
+		}
+	}
 }
 
diff --git a/testsuite/expect/inc21.30.5 b/testsuite/expect/inc21.30.5
index 0c13b7f63f0819351bf677fcbb6e7b564e66ec6f..7dcf189b523c7349ec42dc9470a5e543ebe473b5 100644
--- a/testsuite/expect/inc21.30.5
+++ b/testsuite/expect/inc21.30.5
@@ -31,16 +31,40 @@ proc inc21_30_5 {} {
 
 #test MaxCpus limits
 
-	global salloc acct number srun job_id1 bin_sleep
+	global salloc acct number srun bin_sleep maxcpu_num
 
-	spawn $salloc --account=$acct -n11 $srun $bin_sleep 2
+	send_user "\nStarting MaxCPUs limit test\n\n"
+	set job_id1 0
+
+	spawn $salloc --account=$acct -n$maxcpu_num $srun $bin_sleep 2
 	expect {
 		-re "job ($number)" {
 			set job_id1 $expect_out(1,string)
 			send_user "\nThis is expected do not worry\n"
+
+		}
+		-re "Granted job allocation ($number)" {
+		}
+		timeout {
+			send_user "\nFAILURE: salloc not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	# cancels remaining jobs
+	cancel_job $job_id1
+
+	spawn $salloc --account=$acct -n[expr $maxcpu_num + 1] $srun $bin_sleep 2
+	expect {
+		-re "Pending job allocation ($number)" {
+			set job_id1 $expect_out(1,string)
+			send_user "\nThis is expected do not worry\n"
 		}
 		-re "Granted job allocation ($number)" {
-			send_user "\nFAILURE: This should have failed but did not\n"
+			send_user "\nFAILURE: This should have pended but did not\n"
 			set exit_code 1
 		}
 		timeout {
diff --git a/testsuite/expect/inc21.30.6 b/testsuite/expect/inc21.30.6
index 393233ef5691cd479d74287d9a5039be8a486848..1d7b1f751ffc3dacccf66223d3a6a30c3f9f3027 100644
--- a/testsuite/expect/inc21.30.6
+++ b/testsuite/expect/inc21.30.6
@@ -31,16 +31,41 @@ proc inc21_30_6 {} {
 
 #test MaxNode limit
 
-	global salloc acct number srun job_id1 bin_sleep
+	global salloc acct number srun job_id1 bin_sleep maxnode_num
 
-	spawn $salloc --account=$acct -N11 $srun $bin_sleep 2
+	send_user "\nStarting MaxNode limit test\n\n"
+	set job_id1 0
+
+	spawn $salloc --account=$acct -N$maxnode_num $srun $bin_sleep 2
+	expect {
+		-re "Granted job allocation ($number)" {
+			set job_id1 $expect_out(1,string)
+		}
+		-re "Pending job allocation ($number)" {
+			set job_id1 $expect_out(1,string)
+			send_user "\nFAILURE: This should have ran but did not\n"
+			set exit_code 1
+		}
+		timeout {
+			send_user "\nFAILURE: salloc not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	# cancels remaining jobs
+	cancel_job $job_id1
+
+	spawn $salloc --account=$acct -N[expr $maxnode_num + 1] $srun $bin_sleep 2
 	expect {
-		-re "job ($number)" {
+		-re "Pending job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
 			send_user "\nThis is expected do not worry\n"
 		}
 		-re "Granted job allocation ($number)" {
-			send_user "\nFAILURE: This should have failed but did not\n"
+			send_user "\nFAILURE: This should have pended but did not\n"
 			set exit_code 1
 		}
 		timeout {
diff --git a/testsuite/expect/inc21.30.7 b/testsuite/expect/inc21.30.7
index bc6049304958f76461c486317ae99bb2f7f430f5..1db4623d27732fae9f6a5eee80f1705321cb3e4c 100644
--- a/testsuite/expect/inc21.30.7
+++ b/testsuite/expect/inc21.30.7
@@ -31,71 +31,62 @@ proc inc21_30_7 {} {
 
 #test MaxJobs limit
 
-	global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code
+	global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code maxjobs_num
 
-	set jobmatch 0
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "Granted job allocation ($number)" {
-			set job_id1 $expect_out(1,string)
-			send_user "\njob $job_id1 was submitted\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
-		}
-	}
-
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "Granted job allocation ($number)" {
-			set job_id2 $expect_out(1,string)
-			send_user "\njob $job_id2 was submitted\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
-		}
-	}
+	send_user "\nStarting MaxJob limit test\n\n"
+	set check_num $maxjobs_num
 
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "job ($number)" {
-			set job_id3 $expect_out(1,string)
-			send_user "\nThis error is expected do not worry\n"
-			incr jobmatch
-		}
-		-re "Granted job allocation" {
-			send_user "\nThis should have failed but did not\n"
-			set exit_code 1
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
+	set jobmatch 0
+	for {set inx 0} {$inx <= $check_num} {incr inx} {
+		spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
+		expect {
+			-re "Granted job allocation ($number)" {
+				set job_id($inx) $expect_out(1,string)
+				if {$inx < $check_num} {
+					send_user "\njob $inx $job_id($inx) was submitted\n"
+					incr jobmatch
+				} else {
+					send_user "\nFAILURE: Job $inx $job_id($inx) wasn't suppose to work but it did, limit was $check_num?\n"
+					set exit_code 1
+				}
+			}
+			-re "job ($number) queued and waiting for resources" {
+				set job_id($inx) $expect_out(1,string)
+				if {$inx >= $check_num} {
+					send_user "\nJob $inx $job_id($inx) is waiting for resources. This is expected\n"
+					incr jobmatch
+				} else {
+					send_user "\nFAILURE: Job $inx $job_id($inx) was suppose to work but it didn't, limit was $check_num?\n"
+					set exit_code 1
+				}
+			}
+			timeout {
+				send_user "\nFAILURE: salloc is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
 		}
 	}
 
-	check_state $job_id3
-
 	if {$jobmatch==0} {
 		send_user "\nFAILURE: jobs were not submitted\n"
 		set exit_code 1
 	}
 
-	# cancels the remaining jobs
-	cancel_job $job_id1
-	cancel_job $job_id2
-	cancel_job $job_id3
+	#checks the job state
+	if [info exists job_id($check_num)] {
+		check_state $job_id($check_num)
+	} else {
+		send_user "\nFAILURE: didn't attempt to start enough jobs\n"
+		set exit_code 1
+	}
 
+	for {set inx 0} {$inx <= $check_num} {incr inx} {
+		if [info exists job_id($inx)] {
+			# cancels the jobs
+			cancel_job $job_id($inx)
+		}
+	}
 }
diff --git a/testsuite/expect/inc21.30.8 b/testsuite/expect/inc21.30.8
index 60209544dc0ce529dca41c5b8a58cd992fb16f79..8dbf20d783918b28ba6d9f079cc08934a3f65ba8 100644
--- a/testsuite/expect/inc21.30.8
+++ b/testsuite/expect/inc21.30.8
@@ -31,66 +31,53 @@ proc inc21_30_8 {} {
 
 #test MaxJobsSubmits limit
 
-	global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code
+	global salloc srun acct bin_sleep jobmatch job_id1 job_id2 job_id3 number exit_code maxjobsub_num
 
-	set jobmatch 0
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "Granted job allocation ($number)" {
-			set job_id1 $expect_out(1,string)
-			send_user "\njob $job_id1 was submitted\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
-		}
-	}
+	send_user "\nStarting MaxJobsSubmits limit test\n\n"
+	set check_num $maxjobsub_num
 
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "Granted job allocation ($number)" {
-			set job_id2 $expect_out(1,string)
-			send_user "\njob $job_id2 was submitted\n"
-			incr jobmatch
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
+	set jobmatch 0
+	for {set inx 0} {$inx <= $check_num} {incr inx} {
+		spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
+		expect {
+			-re "Granted job allocation ($number)" {
+				set job_id($inx) $expect_out(1,string)
+				if {$inx < $check_num} {
+					send_user "\njob $inx $job_id($inx) was submitted\n"
+					incr jobmatch
+				} else {
+					send_user "\nFAILURE: Job $inx $job_id($inx) wasn't suppose to work but it did, limit was $check_num?\n"
+					set exit_code 1
+				}
+			}
+			-re "error" {
+				if {$inx >= $check_num} {
+					send_user "\nJob $inx didn't get submitted. This is expected\n"
+					incr jobmatch
+				} else {
+					send_user "\nFAILURE: Job $inx was suppose to work but it didn't, limit was $check_num?\n"
+					set exit_code 1
+				}
+			}
+			timeout {
+				send_user "\nFAILURE: salloc is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
 		}
 	}
 
-	spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
-	expect {
-		-re "error" {
-			send_user "\nThis error is expected do not worry\n"
-			incr jobmatch
-		}
-		-re "Granted job allocation" {
-			send_user "\nThis should have failed but did not\n"
-			set exit_code 1
-		}
-		timeout {
-			send_user "\nFAILURE: salloc is not responding\n"
-			set exit_code 1
-		}
-		eof {
-			wait
-		}
-	}
-	if {$jobmatch==0} {
+	if {$jobmatch == 0} {
 		send_user "\nFAILURE: jobs were not submitted\n"
 		set exit_code 1
 	}
 
-	# cancels the remaining jobs
-	cancel_job $job_id1
-	cancel_job $job_id2
-
+	for {set inx 0} {$inx <= $check_num} {incr inx} {
+		if [info exists job_id($inx)] {
+			# cancels the jobs
+			cancel_job $job_id($inx)
+		}
+	}
 }
diff --git a/testsuite/expect/test21.30 b/testsuite/expect/test21.30
index 10c2d4479473d8b1624bce3b9876785401f2f3e6..bb657e59719f17eb2136641d3fca6aca2728a11b 100755
--- a/testsuite/expect/test21.30
+++ b/testsuite/expect/test21.30
@@ -42,9 +42,6 @@ source ./inc21.30.8
 set test_id	"21.30"
 set exit_code	0
 set acct        test_acct
-set job_id1     ""
-set job_id2     ""
-set job_id3     ""
 set user_name   ""
 set qosname     name
 set qostest     [format "%s %s" $test_id "qosTest"]
@@ -89,7 +86,7 @@ proc check_state { job } {
 
 	if {$state_match != 1} {
 		send_user "\nFAILURE job should be pending, but is not\n"
-		exit 1
+		set exit_code 1
 	}
 
 }