From 08ce7e1dede5ff9255addbdbad8c88f606a0dad6 Mon Sep 17 00:00:00 2001
From: John Dickinson <me@not.mn>
Date: Thu, 11 Apr 2013 22:55:49 -0700
Subject: [PATCH] fix probe tests to work in a VM using mount_check

If mount_check is true (ie an SAIO with "real "devices, not loopback),
then the servers will correctly return 507 when given a nonsense path.
The first element is treated as a drive path, and that path isn't
mounted. This patch adds 507 as a valid status response to the server
check.

Change-Id: I1d1bb0ab78fd9ea17323635da7e686182fbdbf13
---
 test/probe/common.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/probe/common.py b/test/probe/common.py
index 92b8fb7732..2605ca6fa8 100644
--- a/test/probe/common.py
+++ b/test/probe/common.py
@@ -56,7 +56,9 @@ def check_server(port, port2server, pids, timeout=CHECK_SERVER_TIMEOUT):
                 conn = HTTPConnection('127.0.0.1', port)
                 conn.request('GET', path)
                 resp = conn.getresponse()
-                if resp.status != 404:
+                # 404 because it's a nonsense path (and mount_check is false)
+                # 507 in case the test target is a VM using mount_check
+                if resp.status not in (404, 507):
                     raise Exception(
                         'Unexpected status %s' % resp.status)
                 break