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
This commit is contained in:
John Dickinson 2013-04-11 22:55:49 -07:00
parent 4ae0feb60d
commit 08ce7e1ded
1 changed files with 3 additions and 1 deletions

View File

@ -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