Browse code

integration-cli: add check for TestPsListContainersSize when no containers are returned * when no containers are returned, go test would then aborts with: panic: runtime error: index out of range

Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>

Todd Whiteman authored on 2015/04/03 06:44:53
Showing 1 changed files
... ...
@@ -286,6 +286,9 @@ func TestPsListContainersSize(t *testing.T) {
286 286
 		t.Fatal(out, err)
287 287
 	}
288 288
 	lines := strings.Split(strings.Trim(out, "\n "), "\n")
289
+	if len(lines) != 2 {
290
+		t.Fatalf("Expected 2 lines for 'ps -s -n=1' output, got %d", len(lines))
291
+	}
289 292
 	sizeIndex := strings.Index(lines[0], "SIZE")
290 293
 	idIndex := strings.Index(lines[0], "CONTAINER ID")
291 294
 	foundID := lines[1][idIndex : idIndex+12]