diff --git a/testsuite/expect/test1.17 b/testsuite/expect/test1.17
index c6516b811fd68d62025a9a940194ab792838dd81..b98a191e0283ed68a39b7eecc3b61a6b3610ad1f 100755
--- a/testsuite/expect/test1.17
+++ b/testsuite/expect/test1.17
@@ -37,7 +37,6 @@ set file_out    "test$test_id.output"
 set file_err    "test$test_id.error"
 set exit_code            0
 set login_grp_info       ""
-set job_grp_info         ""
 set got_job_grps         0
 set got_login_grps       0
 set got_sleep_err        0
@@ -61,7 +60,7 @@ exec echo "$bin_echo INITIAL_VALUE" >$file_out
 #
 spawn $bin_id
 expect {
-	-re "(uid=.*\n)" {
+	-re "(uid=$number)" {
 		set login_grp_info $expect_out(1,string)
 		set got_login_grps 1
 		exp_continue
@@ -99,8 +98,7 @@ if {[wait_for_file $file_out] == 0} {
 			send_user "\nFAILURE: stdout file not truncated\n"
 			set exit_code 1
 		}
-		-re "(uid=.*\n)" {
-			set job_grp_info $expect_out(1,string)
+		-re "$login_grp_info" {
 			incr got_job_grps
 			exp_continue
 		}
@@ -118,10 +116,6 @@ if {$got_job_grps != 1} {
 	send_user "\nFAILURE: User and group ID info missing from stdout\n"
 	set exit_code 1
 }
-if {[string compare $login_grp_info $job_grp_info] != 0} {
-	send_user "\nFAILURE: Login and slurm user info mismatch\n"
-	set exit_code 1
-}
 
 #
 # Check for sleep input specification error in stderr
@@ -182,8 +176,7 @@ set got_job_grps 0
 if {[wait_for_file $file_out] == 0} {
 	spawn $bin_cat $file_out
 	expect {
-		-re "(uid=.*\n)" {
-			set job_grp_info $expect_out(1,string)
+		-re "$login_grp_info" {
 			incr got_job_grps
 			exp_continue
 		}
diff --git a/testsuite/expect/test17.33 b/testsuite/expect/test17.33
index 8e9749f4940e6c480209829ee8287976e2ddbefb..3ca4ef26c29c1ded28ea33f2d9d3ecdbf3fa5cb0 100755
--- a/testsuite/expect/test17.33
+++ b/testsuite/expect/test17.33
@@ -1,7 +1,7 @@
 #!/usr/bin/expect
 ############################################################################
 # Purpose: Test of SLURM functionality
-#          Test of sbatcj --open-mode (truncate or append) option.
+#          Test of sbatch --open-mode (truncate or append) option.
 #
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 #          "FAILURE: ..." otherwise with an explanation of the failure, OR
@@ -37,7 +37,6 @@ set file_out    "test$test_id.output"
 set file_err    "test$test_id.error"
 set exit_code            0
 set login_grp_info       ""
-set job_grp_info         ""
 set got_job_grps         0
 set got_login_grps       0
 set got_sleep_err        0
@@ -61,7 +60,7 @@ exec echo "$bin_echo INITIAL_VALUE" >$file_out
 #
 spawn $bin_id
 expect {
-	-re "(uid=.*\n)" {
+	-re "(uid=$number)" {
 		set login_grp_info $expect_out(1,string)
 		set got_login_grps 1
 		exp_continue
@@ -103,8 +102,7 @@ if {[wait_for_file $file_out] == 0} {
 			send_user "\nFAILURE: stdout file not truncated\n"
 			set exit_code 1
 		}
-		-re "(uid=.*\n)" {
-			set job_grp_info $expect_out(1,string)
+		-re "$login_grp_info" {
 			incr got_job_grps
 			exp_continue
 		}
@@ -122,10 +120,6 @@ if {$got_job_grps != 1} {
 	send_user "\nFAILURE: User and group ID info missing from stdout\n"
 	set exit_code 1
 }
-if {[string compare $login_grp_info $job_grp_info] != 0} {
-	send_user "\nFAILURE: Login and slurm user info mismatch\n"
-	set exit_code 1
-}
 
 #
 # Check for sleep input specification error in stderr
@@ -190,8 +184,7 @@ set got_job_grps 0
 if {[wait_for_file $file_out] == 0} {
 	spawn $bin_cat $file_out
 	expect {
-		-re "(uid=.*\n)" {
-			set job_grp_info $expect_out(1,string)
+		-re "$login_grp_info" {
 			incr got_job_grps
 			exp_continue
 		}