From 99cd33f11a028358934c001c952f5a9fcf06a5eb Mon Sep 17 00:00:00 2001
From: Veronique Legrand <veronique.legrand@pasteur.fr>
Date: Thu, 28 May 2015 08:34:29 -0700
Subject: [PATCH] Fix test for select/linear with one node

---
 testsuite/expect/globals  |  4 ++--
 testsuite/expect/test1.69 | 14 +++++++++++---
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/testsuite/expect/globals b/testsuite/expect/globals
index 841759e9c5d..28f59652645 100755
--- a/testsuite/expect/globals
+++ b/testsuite/expect/globals
@@ -2745,7 +2745,7 @@ proc get_node_cnt { } {
 proc get_node_cnt_in_part { partition } {
 	global scontrol number
 
-#	log_user 0
+	log_user 0
 	set node_cnt 0
 	set scon_pid [spawn -noecho $scontrol show partition $partition]
 	expect {
@@ -2762,7 +2762,7 @@ proc get_node_cnt_in_part { partition } {
 		eof {
 		}
 	}
-#	log_user 1
+	log_user 1
 
 	return $node_cnt
 }
diff --git a/testsuite/expect/test1.69 b/testsuite/expect/test1.69
index c4e1856c7c0..2fb04c3feff 100755
--- a/testsuite/expect/test1.69
+++ b/testsuite/expect/test1.69
@@ -40,12 +40,20 @@ set exit_code   0
 
 print_header $test_id
 
-if {[test_bluegene]} {
+set select_type [test_select_type]
+if {![string compare $select_type "bluegene"]} {
 	send_user "\nWARNING: This test is incompatible with Bluegene systems\n"
 	exit $exit_code
-} elseif {[test_alps]} {
-	send_user "\nWARNING: This test is incompatible with Cray systems\n"
+} elseif {![string compare $select_type "alps"]} {
+	send_user "\nWARNING: This test is incompatible with Cray/ALPS systems\n"
 	exit $exit_code
+} elseif {![string compare $select_type "linear"]} {
+	set def_part_name [default_partition]
+	set nb_nodes [get_node_cnt_in_part $def_part_name]
+	if {$nb_nodes < 2} {
+		send_user "\nWARNING: This test is incompatible with select/linear and only one node\n"
+		exit $exit_code
+	}
 } elseif {[test_launch_poe]} {
 	send_user "\nWARNING: This test is incompatible with POE systems\n"
 	exit $exit_code
-- 
GitLab