Browse Source

Add Ubuntu Minimal cloud image

Change-Id: Ife0dd7c9a5b0a86a8bc350e4cca6ccee849f423a
changes/81/778181/2
Federico Ressi 5 months ago
parent
commit
7eda3c69e3
  1. 2
      tobiko/openstack/stacks/__init__.py
  2. 28
      tobiko/openstack/stacks/_ubuntu.py
  3. 20
      tobiko/tests/functional/openstack/stacks/test_ubuntu.py

2
tobiko/openstack/stacks/__init__.py

@ -76,7 +76,9 @@ AntiAffinityServerGroupStackFixture = _nova.AntiAffinityServerGroupStackFixture
UbuntuFlavorStackFixture = _ubuntu.UbuntuFlavorStackFixture
UbuntuImageFixture = _ubuntu.UbuntuImageFixture
UbuntuMinimalImageFixture = _ubuntu.UbuntuMinimalImageFixture
UbuntuServerStackFixture = _ubuntu.UbuntuServerStackFixture
UbuntuMinimalServerStackFixture = _ubuntu.UbuntuMinimalServerStackFixture
OctaviaLoadbalancerStackFixture = _octavia.OctaviaLoadbalancerStackFixture
OctaviaListenerStackFixture = _octavia.OctaviaListenerStackFixture

28
tobiko/openstack/stacks/_ubuntu.py

@ -26,6 +26,13 @@ UBUNTU_IMAGE_URL = (
f'http://cloud-images.ubuntu.com/{UBUNTU_IMAGE_VERSION}/current/'
f'{UBUNTU_IMAGE_VERSION}-server-cloudimg-amd64.img')
UBUNTU_IMAGE_VERSION_NUMBER = '20.04'
UBUNTU_MINIMAL_IMAGE_URL = (
'https://cloud-images.ubuntu.com/minimal/releases/'
f'{UBUNTU_IMAGE_VERSION}/release/'
f'ubuntu-{UBUNTU_IMAGE_VERSION_NUMBER}-minimal-cloudimg-amd64.img')
class UbuntuImageFixture(glance.URLGlanceImageFixture):
image_url = CONF.tobiko.ubuntu.image_url or UBUNTU_IMAGE_URL
@ -38,10 +45,18 @@ class UbuntuImageFixture(glance.URLGlanceImageFixture):
connection_timeout = CONF.tobiko.ubuntu.connection_timeout or 600.
class UbuntuMinimalImageFixture(UbuntuImageFixture):
image_url = UBUNTU_MINIMAL_IMAGE_URL
class UbuntuFlavorStackFixture(_nova.FlavorStackFixture):
ram = 256
class UbuntuMinimalFlavorStackFixture(_nova.FlavorStackFixture):
ram = 128
class UbuntuServerStackFixture(_nova.ServerStackFixture):
#: Glance image used to create a Nova server instance
@ -52,3 +67,16 @@ class UbuntuServerStackFixture(_nova.ServerStackFixture):
#: Setup SWAP file in bytes
swap_maxsize = 1 * 1024 * 1024 * 1024 # 1 GB
class UbuntuMinimalServerStackFixture(UbuntuServerStackFixture):
#: Glance image used to create a Nova server instance
image_fixture = tobiko.required_setup_fixture(UbuntuMinimalImageFixture)
#: Flavor used to create a Nova server instance
flavor_stack = tobiko.required_setup_fixture(
UbuntuMinimalFlavorStackFixture)
#: Setup SWAP file in bytes
swap_maxsize = 512 * 1024 * 1024 # 500 MB

20
tobiko/tests/functional/openstack/stacks/test_ubuntu.py

@ -15,6 +15,8 @@
# under the License.
from __future__ import absolute_import
import pytest
import tobiko
from tobiko.shell import sh
from tobiko.openstack import stacks
@ -34,3 +36,21 @@ class UbuntuServerStackTest(test_cirros.CirrosServerStackTest):
ssh_client=self.stack.ssh_client).stdout
self.assertTrue(python_version.startswith('Python 3.'),
python_version)
class UbuntuMinimalServerStackTest(UbuntuServerStackTest):
#: Stack of resources with a server attached to a floating IP
stack = tobiko.required_setup_fixture(
stacks.UbuntuMinimalServerStackFixture)
@pytest.mark.skip(reason="ping not installed on image")
def test_ping_fixed_ipv4(self):
pass
@pytest.mark.skip(reason="ping not installed on image")
def test_ping_fixed_ipv6(self):
pass
def _test_ping_nameservers(self, ip_version: int):
self.skipTest("ping not installed on Ubuntu minimal image")
Loading…
Cancel
Save