Remove UbuntuMinimalServerStackFixture and UbuntuMinimalImageFixture
Those fixtures were only used in functional tests and they can use UbuntuServerStackFixture and UbuntuImageFixture to simplify the number of supported resources. Related: #TOBIKO-126 Change-Id: I4d8bd9a49120b9b6d51e01fb15d65da0bce06e4e
This commit is contained in:
parent
b23979f413
commit
a9431e5237
@ -94,9 +94,7 @@ QosServerStackFixture = _qos.QosServerStackFixture
|
||||
|
||||
UbuntuFlavorStackFixture = _ubuntu.UbuntuFlavorStackFixture
|
||||
UbuntuImageFixture = _ubuntu.UbuntuImageFixture
|
||||
UbuntuMinimalImageFixture = _ubuntu.UbuntuMinimalImageFixture
|
||||
UbuntuServerStackFixture = _ubuntu.UbuntuServerStackFixture
|
||||
UbuntuMinimalServerStackFixture = _ubuntu.UbuntuMinimalServerStackFixture
|
||||
UbuntuExternalServerStackFixture = _ubuntu.UbuntuExternalServerStackFixture
|
||||
|
||||
VlanNetworkStackFixture = _vlan.VlanNetworkStackFixture
|
||||
|
@ -25,20 +25,6 @@ from tobiko.shell import sh
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class UbuntuMinimalImageFixture(glance.FileGlanceImageFixture):
|
||||
image_name = CONF.tobiko.ubuntu.image_name
|
||||
image_file = CONF.tobiko.ubuntu.image_file
|
||||
disk_format = CONF.tobiko.ubuntu.disk_format or "qcow2"
|
||||
container_format = CONF.tobiko.ubuntu.container_format or "bare"
|
||||
username = CONF.tobiko.ubuntu.username or 'ubuntu'
|
||||
password = CONF.tobiko.ubuntu.password or 'ubuntu'
|
||||
connection_timeout = CONF.tobiko.nova.ubuntu_connection_timeout
|
||||
disabled_algorithms = CONF.tobiko.ubuntu.disabled_algorithms
|
||||
is_reachable_timeout = CONF.tobiko.nova.ubuntu_is_reachable_timeout
|
||||
|
||||
|
||||
IPERF3_SERVICE_FILE = """
|
||||
[Unit]
|
||||
Description=iperf3 server on port %i
|
||||
@ -55,8 +41,7 @@ DefaultInstance=5201
|
||||
"""
|
||||
|
||||
|
||||
class UbuntuImageFixture(UbuntuMinimalImageFixture,
|
||||
glance.CustomizedGlanceImageFixture):
|
||||
class UbuntuImageFixture(glance.CustomizedGlanceImageFixture):
|
||||
"""Ubuntu server image running an HTTP server
|
||||
|
||||
The server has additional installed packages compared to
|
||||
@ -73,6 +58,15 @@ class UbuntuImageFixture(UbuntuMinimalImageFixture,
|
||||
- nginx HTTP server listening on TCP port 80
|
||||
- iperf3 server listening on TCP port 5201
|
||||
"""
|
||||
image_name = CONF.tobiko.ubuntu.image_name
|
||||
image_file = CONF.tobiko.ubuntu.image_file
|
||||
disk_format = CONF.tobiko.ubuntu.disk_format or "qcow2"
|
||||
container_format = CONF.tobiko.ubuntu.container_format or "bare"
|
||||
username = CONF.tobiko.ubuntu.username or 'ubuntu'
|
||||
password = CONF.tobiko.ubuntu.password or 'ubuntu'
|
||||
connection_timeout = CONF.tobiko.nova.ubuntu_connection_timeout
|
||||
disabled_algorithms = CONF.tobiko.ubuntu.disabled_algorithms
|
||||
is_reachable_timeout = CONF.tobiko.nova.ubuntu_is_reachable_timeout
|
||||
|
||||
def __init__(self,
|
||||
ethernet_devide: str = None,
|
||||
@ -182,16 +176,7 @@ class UbuntuFlavorStackFixture(_nova.FlavorStackFixture):
|
||||
swap = 512
|
||||
|
||||
|
||||
class UbuntuMinimalServerStackFixture(_nova.CloudInitServerStackFixture):
|
||||
|
||||
#: Glance image used to create a Nova server instance
|
||||
image_fixture = tobiko.required_fixture(UbuntuMinimalImageFixture)
|
||||
|
||||
#: Flavor used to create a Nova server instance
|
||||
flavor_stack = tobiko.required_fixture(UbuntuFlavorStackFixture)
|
||||
|
||||
|
||||
class UbuntuServerStackFixture(UbuntuMinimalServerStackFixture,
|
||||
class UbuntuServerStackFixture(_nova.CloudInitServerStackFixture,
|
||||
_vlan.VlanServerStackFixture):
|
||||
"""Ubuntu server running an HTTP server
|
||||
|
||||
@ -203,6 +188,8 @@ class UbuntuServerStackFixture(UbuntuMinimalServerStackFixture,
|
||||
|
||||
#: Glance image used to create a Nova server instance
|
||||
image_fixture = tobiko.required_fixture(UbuntuImageFixture)
|
||||
#: Flavor used to create a Nova server instance
|
||||
flavor_stack = tobiko.required_fixture(UbuntuFlavorStackFixture)
|
||||
|
||||
@property
|
||||
def is_reachable_timeout(self) -> tobiko.Seconds:
|
||||
|
@ -139,7 +139,7 @@ class GetL3AgentModeTest(testtools.TestCase):
|
||||
class SSHGetL3AgentModeTest(GetL3AgentModeTest):
|
||||
|
||||
server_stack = tobiko.required_fixture(
|
||||
stacks.UbuntuMinimalServerStackFixture)
|
||||
stacks.UbuntuServerStackFixture)
|
||||
|
||||
@property
|
||||
def connection(self) -> sh.SSHShellConnection:
|
||||
|
@ -40,19 +40,3 @@ class UbuntuServerStackTest(test_cirros.CirrosServerStackTest):
|
||||
ssh_client=self.stack.ssh_client).stderr.strip()
|
||||
self.assertIn('Ncat: Version', output)
|
||||
self.assertIn('https://nmap.org/ncat', output)
|
||||
|
||||
|
||||
class UbuntuMinimalServerStackTest(UbuntuServerStackTest):
|
||||
|
||||
#: Stack of resources with a server attached to a floating IP
|
||||
stack = tobiko.required_fixture(
|
||||
stacks.UbuntuMinimalServerStackFixture)
|
||||
|
||||
def test_ping_fixed_ipv4(self):
|
||||
tobiko.skip_test("ping not installed on image")
|
||||
|
||||
def test_ping_fixed_ipv6(self):
|
||||
tobiko.skip_test("ping not installed on image")
|
||||
|
||||
def test_ncat_command(self):
|
||||
tobiko.skip_test("ncat not installed on image")
|
||||
|
@ -209,7 +209,7 @@ class LocalShellConnectionTest(testtools.TestCase):
|
||||
|
||||
class SSHShellConnectionTest(LocalShellConnectionTest):
|
||||
connection_class = sh.SSHShellConnection
|
||||
server = tobiko.required_fixture(stacks.UbuntuMinimalServerStackFixture)
|
||||
server = tobiko.required_fixture(stacks.UbuntuServerStackFixture)
|
||||
|
||||
@property
|
||||
def ssh_client(self) -> ssh.SSHClientFixture:
|
||||
|
@ -210,7 +210,7 @@ class SSHExecuteTest(ExecuteTest):
|
||||
expected_shell = SSH_EXPECTED_SHELL
|
||||
|
||||
server_stack = tobiko.required_fixture(
|
||||
stacks.UbuntuMinimalServerStackFixture)
|
||||
stacks.UbuntuServerStackFixture)
|
||||
|
||||
@property
|
||||
def ssh_client(self):
|
||||
|
@ -67,7 +67,7 @@ class LocalProcessTest(ProcessTest):
|
||||
class SSHProcessFixture(ProcessFixture):
|
||||
|
||||
stack = tobiko.required_fixture(
|
||||
stacks.UbuntuMinimalServerStackFixture)
|
||||
stacks.UbuntuServerStackFixture)
|
||||
|
||||
def setup_fixture(self):
|
||||
self.ssh_client = self.stack.ssh_client
|
||||
|
@ -87,7 +87,7 @@ class ProxyJumpWhichTest(WhichTest):
|
||||
class SSHWhichTest(WhichTest):
|
||||
|
||||
server_stack = tobiko.required_fixture(
|
||||
stacks.UbuntuMinimalServerStackFixture)
|
||||
stacks.UbuntuServerStackFixture)
|
||||
|
||||
@property
|
||||
def ssh_client(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user