Testsuite - Adapt test17.37 to new code style

Removed send_user and replaced by log_* and print_success functions and do not
break on long comment lines. Fixed some typos and added newlines.

No functional change.

Bug 7272
diff --git a/testsuite/expect/test17.37 b/testsuite/expect/test17.37
index 7b4c1ee..3ad5041 100755
--- a/testsuite/expect/test17.37
+++ b/testsuite/expect/test17.37
@@ -48,20 +48,21 @@
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: sbatch is not responding\n"
+		log_error "sbatch is not responding"
 		set exit_code 1
 	}
 	eof {
 		wait
 	}
 }
+
 if { $job_id1 == 0 } {
-	send_user "\nFAILURE: sbatch did not submit job\n"
+	log_error "sbatch did not submit job"
 	exit 1
 }
 
 if {[wait_for_job $job_id1 "RUNNING"] != 0} {
-	send_user "\nFAILURE: error waiting for job $job_id1 to start\n"
+	log_error "error waiting for job $job_id1 to start"
 	cancel_job $job_id1
 	set exit_code 1
 }
@@ -74,20 +75,21 @@
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: sbatch is not responding\n"
+		log_error "sbatch is not responding"
 		set exit_code 1
 	}
 	eof {
 		wait
 	}
 }
+
 if { $job_id2 == 0 } {
-	send_user "\nFAILURE: sbatch did not submit job\n"
+	log_error "sbatch did not submit job"
 	exit 1
 }
 
 if {[wait_for_job $job_id1 "DONE"] != 0} {
-	send_user "\nFAILURE: error waiting for job $job_id1 to complete\n"
+	log_error "error waiting for job $job_id1 to complete"
 	cancel_job $job_id1
 	set exit_code 1
 }
@@ -101,16 +103,16 @@
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: scontrol is not responding\n"
+		log_error "scontrol is not responding"
 		set exit_code 1
 	}
 	eof {
 		wait
 	}
 }
+
 if { $match != 1 } {
-	send_user "\nFAILURE: Job $job_id1 did not exit with exit code 0\n"
-	send_user "\nFAILURE: Could be due to small configured MinJobAge value\n"
+	log_error "Job $job_id1 did not exit with exit code 0, which could be due to a small configured MinJobAge value\n"
 	set exit_code 1
 }
 
@@ -124,14 +126,14 @@
 			incr match 1
 		}
 		timeout {
-			send_user "\nFAILURE: scontrol is not responding\n"
+			log_error "scontrol is not responding"
 			set exit_code 1
 		}
 		eof {
 			wait
 		}
 		if { $match != 1 } {
-			send_user "\nFAILURE: Job $job_id2 should be in cancelled state and should have Reason=DependencyNeverSatisfied"
+			log_error "Job $job_id2 should be in cancelled state and should have Reason=DependencyNeverSatisfied"
 			set exit_code 1
 		}
 	}
@@ -144,7 +146,7 @@
 			incr match 1
 		}
 		timeout {
-			send_user "\nFAILURE: squeue is not responding\n"
+			log_error "squeue is not responding"
 			set exit_code 1
 		}
 		eof {
@@ -152,17 +154,17 @@
 		}
 	}
 	if { $match != 1 } {
-		send_user "\nFAILURE: Job $job_id2 should be in pending state and "
-		send_user "should have Reason=DependencyNeverSatisfied"
-		send_user "\nFAILURE: Could be due to a small configured MinJobAge value\n"
+		log_error "Job $job_id2 should be in pending state and should have Reason=DependencyNeverSatisfied, which could be due to a small configured MinJobAge value"
 		set exit_code 1
 	}
 	if {[cancel_job $job_id2] != 0} {
 		set exit_code 1
 	}
 }
+
 if {$exit_code == 0} {
 	exec $bin_rm -f $script
-	send_user "\nSUCCESS\n"
+	print_success $test_id
 }
+
 exit $exit_code