[tests] use 127.0.0.2 as base address

personal/stbuehler/wip
Stefan Bühler 9 years ago
parent 21ded067eb
commit 1402e8987c
  1. 4
      tests/base.py
  2. 2
      tests/requests.py
  3. 2
      tests/runtests.py
  4. 6
      tests/service.py
  5. 2
      tests/t-mod-proxy.py

@ -338,7 +338,7 @@ setup {{
"mod_vhost"
);
listen "127.0.0.1:{Env.port}";
listen "127.0.0.2:{Env.port}";
log [ "*" => "stderr" ];
lua.plugin "{Env.luadir}/core.lua";
@ -395,7 +395,7 @@ instance {{
{valgrindconfig}
}}
allow-listen {{ ip "127.0.0.1:{Env.port}"; }}
allow-listen {{ ip "127.0.0.2:{Env.port}"; }}
""".format(Env = Env, valgrindconfig = valgrindconfig))
print >> Env.log, "[Done] Preparing tests"

@ -56,7 +56,7 @@ class CurlRequest(TestBase):
if None == self.URL:
raise BasicException("You have to set URL in your CurlRequest instance")
c = pycurl.Curl()
c.setopt(pycurl.URL, self.SCHEME + ("://127.0.0.1:%i" % (Env.port + self.PORT)) + self.URL)
c.setopt(pycurl.URL, self.SCHEME + ("://127.0.0.2:%i" % (Env.port + self.PORT)) + self.URL)
c.setopt(pycurl.HTTPHEADER, ["Host: " + self.vhost])
c.setopt(pycurl.NOSIGNAL, 1)
c.setopt(pycurl.TIMEOUT, 2)

@ -45,7 +45,7 @@ parser.add_option("--angel", help = "Path to angel binary (required)")
parser.add_option("--worker", help = "Path to worker binary (required)")
parser.add_option("--plugindir", help = "Path to plugin directory (required)")
parser.add_option("-k", "--no-cleanup", help = "Keep temporary files, no cleanup", action = "store_true", default = False)
parser.add_option("-p", "--port", help = "Use [port,port+7] as tcp ports on 127.0.0.1 (default: 8088; use 0 for random port)", default = 8088, type = "int")
parser.add_option("-p", "--port", help = "Use [port,port+7] as tcp ports on 127.0.0.2 (default: 8088; use 0 for random port)", default = 8088, type = "int")
parser.add_option("-t", "--test", help = "Run specific test", action = "append", dest = "tests", default = [])
parser.add_option("-c", "--force-cleanup", help = "Keep no temporary files (overwrites -k)", action = "store_true", default = False)
parser.add_option("--strace", help = "Strace services", action = "store_true", default = False)

@ -101,11 +101,11 @@ class Service(object):
def portfree(self, port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect(("127.0.0.1", port))
s.connect(("127.0.0.2", port))
except:
pass
else:
raise ServiceException("Cannot start service '%s', port 127.0.0.1:%i already in use" % (self.name, port))
raise ServiceException("Cannot start service '%s', port 127.0.0.2:%i already in use" % (self.name, port))
finally:
s.close()
@ -116,7 +116,7 @@ class Service(object):
raise ServiceException("Service %s died before we could establish a connection" % (self.name))
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect(("127.0.0.1", port))
s.connect(("127.0.0.2", port))
except:
pass
else:

@ -22,7 +22,7 @@ class TestSimple(CurlRequest):
self.vhostdir = None
self.config = """
set_host_header_basic_gets_lua;
proxy "127.0.0.1:%i";
proxy "127.0.0.2:%i";
""" % (Env.port + self.PORT)
class Test(GroupTest):

Loading…
Cancel
Save