Merge "Revert "Use Ubuntu server instance as octavia members""
This commit is contained in:
commit
d95374c4ed
@ -92,4 +92,8 @@ OctaviaLoadbalancerStackFixture = _octavia.OctaviaLoadbalancerStackFixture
|
|||||||
OctaviaListenerStackFixture = _octavia.OctaviaListenerStackFixture
|
OctaviaListenerStackFixture = _octavia.OctaviaListenerStackFixture
|
||||||
OctaviaPoolStackFixture = _octavia.OctaviaPoolStackFixture
|
OctaviaPoolStackFixture = _octavia.OctaviaPoolStackFixture
|
||||||
OctaviaMemberServerStackFixture = _octavia.OctaviaMemberServerStackFixture
|
OctaviaMemberServerStackFixture = _octavia.OctaviaMemberServerStackFixture
|
||||||
|
OctaviaServerStackFixture = _octavia.OctaviaServerStackFixture
|
||||||
OctaviaClientServerStackFixture = _octavia.OctaviaClientServerStackFixture
|
OctaviaClientServerStackFixture = _octavia.OctaviaClientServerStackFixture
|
||||||
|
OctaviaOtherServerStackFixture = _octavia.OctaviaOtherServerStackFixture
|
||||||
|
OctaviaOtherMemberServerStackFixture = (
|
||||||
|
_octavia.OctaviaOtherMemberServerStackFixture)
|
||||||
|
@ -20,10 +20,10 @@ from oslo_log import log
|
|||||||
import tobiko
|
import tobiko
|
||||||
from tobiko import config
|
from tobiko import config
|
||||||
from tobiko.openstack import heat
|
from tobiko.openstack import heat
|
||||||
|
from tobiko.openstack.stacks import _centos
|
||||||
from tobiko.openstack.stacks import _cirros
|
from tobiko.openstack.stacks import _cirros
|
||||||
from tobiko.openstack.stacks import _hot
|
from tobiko.openstack.stacks import _hot
|
||||||
from tobiko.openstack.stacks import _neutron
|
from tobiko.openstack.stacks import _neutron
|
||||||
from tobiko.openstack.stacks import _ubuntu
|
|
||||||
|
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@ -36,6 +36,53 @@ class OctaviaVipNetworkStackFixture(_neutron.NetworkStackFixture):
|
|||||||
port_security_enabled = True
|
port_security_enabled = True
|
||||||
|
|
||||||
|
|
||||||
|
class OctaviaMemberNetworkStackFixture(_neutron.NetworkStackFixture):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class OctaviaCentosServerStackFixture(_centos.CentosServerStackFixture):
|
||||||
|
network_stack = tobiko.required_setup_fixture(
|
||||||
|
OctaviaMemberNetworkStackFixture)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def user_data(self):
|
||||||
|
# Launch a webserver on port 80 that replies the server name to the
|
||||||
|
# client
|
||||||
|
return ("#cloud-config\n"
|
||||||
|
"packages:\n"
|
||||||
|
"- httpd\n"
|
||||||
|
"runcmd:\n"
|
||||||
|
"- [ sh, -c, \"hostname > /var/www/html/id\" ]\n"
|
||||||
|
"- [ systemctl, enable, --now, httpd ]\n")
|
||||||
|
|
||||||
|
|
||||||
|
class OctaviaCirrosServerStackFixture(_cirros.CirrosServerStackFixture):
|
||||||
|
network_stack = tobiko.required_setup_fixture(
|
||||||
|
OctaviaMemberNetworkStackFixture)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def user_data(self):
|
||||||
|
# Launch a webserver on port 80 that replies the server name to the
|
||||||
|
# client
|
||||||
|
# This webserver relies on the nc command which may fail if multiple
|
||||||
|
# clients connect at the same time. For concurrency testing,
|
||||||
|
# OctaviaCentosServerStackFixture is more suited to handle multiple
|
||||||
|
# requests.
|
||||||
|
|
||||||
|
return (
|
||||||
|
"#!/bin/sh\n"
|
||||||
|
"sudo nc -k -p 80 -e echo -e \"HTTP/1.1 200 OK\r\n"
|
||||||
|
"Content-Length: $(hostname | head -c-1 | wc -c )\r\n"
|
||||||
|
"Server: $(hostname)\r\n"
|
||||||
|
"Content-type: text/html; charset=utf-8\r\n"
|
||||||
|
"Connection: close\r\n\r\n"
|
||||||
|
"$(hostname)\"\n")
|
||||||
|
|
||||||
|
|
||||||
|
class OctaviaServerStackFixture(OctaviaCirrosServerStackFixture):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class OctaviaLoadbalancerStackFixture(heat.HeatStackFixture):
|
class OctaviaLoadbalancerStackFixture(heat.HeatStackFixture):
|
||||||
template = _hot.heat_template_file('octavia/load_balancer.yaml')
|
template = _hot.heat_template_file('octavia/load_balancer.yaml')
|
||||||
|
|
||||||
@ -97,10 +144,7 @@ class OctaviaMemberServerStackFixture(heat.HeatStackFixture):
|
|||||||
|
|
||||||
pool = tobiko.required_setup_fixture(OctaviaPoolStackFixture)
|
pool = tobiko.required_setup_fixture(OctaviaPoolStackFixture)
|
||||||
|
|
||||||
@property
|
server_stack = tobiko.required_setup_fixture(OctaviaServerStackFixture)
|
||||||
def server_stack(self):
|
|
||||||
return tobiko.setup_fixture(_ubuntu.UbuntuServerStackFixture,
|
|
||||||
fixture_id=self.fixture_id)
|
|
||||||
|
|
||||||
application_port = 80
|
application_port = 80
|
||||||
|
|
||||||
@ -132,3 +176,14 @@ class OctaviaMemberServerStackFixture(heat.HeatStackFixture):
|
|||||||
class OctaviaClientServerStackFixture(_cirros.CirrosServerStackFixture):
|
class OctaviaClientServerStackFixture(_cirros.CirrosServerStackFixture):
|
||||||
network_stack = tobiko.required_setup_fixture(
|
network_stack = tobiko.required_setup_fixture(
|
||||||
OctaviaVipNetworkStackFixture)
|
OctaviaVipNetworkStackFixture)
|
||||||
|
|
||||||
|
|
||||||
|
class OctaviaOtherServerStackFixture(
|
||||||
|
OctaviaServerStackFixture):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class OctaviaOtherMemberServerStackFixture(
|
||||||
|
OctaviaMemberServerStackFixture):
|
||||||
|
server_stack = tobiko.required_setup_fixture(
|
||||||
|
OctaviaOtherServerStackFixture)
|
||||||
|
@ -43,8 +43,7 @@ class OctaviaBasicTrafficScenarioTest(testtools.TestCase):
|
|||||||
stacks.OctaviaMemberServerStackFixture)
|
stacks.OctaviaMemberServerStackFixture)
|
||||||
|
|
||||||
member2_stack = tobiko.required_setup_fixture(
|
member2_stack = tobiko.required_setup_fixture(
|
||||||
stacks.OctaviaMemberServerStackFixture,
|
stacks.OctaviaOtherMemberServerStackFixture)
|
||||||
fixture_id=1)
|
|
||||||
|
|
||||||
client_stack = tobiko.required_setup_fixture(
|
client_stack = tobiko.required_setup_fixture(
|
||||||
stacks.OctaviaClientServerStackFixture)
|
stacks.OctaviaClientServerStackFixture)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user