Add Ubuntu Minimal cloud image

Change-Id: Ife0dd7c9a5b0a86a8bc350e4cca6ccee849f423a
This commit is contained in:
Federico Ressi 2021-03-02 13:21:25 +01:00
parent 0415455255
commit 7eda3c69e3
3 changed files with 50 additions and 0 deletions

View File

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

View File

@ -26,6 +26,13 @@ UBUNTU_IMAGE_URL = (
f'http://cloud-images.ubuntu.com/{UBUNTU_IMAGE_VERSION}/current/' f'http://cloud-images.ubuntu.com/{UBUNTU_IMAGE_VERSION}/current/'
f'{UBUNTU_IMAGE_VERSION}-server-cloudimg-amd64.img') 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): class UbuntuImageFixture(glance.URLGlanceImageFixture):
image_url = CONF.tobiko.ubuntu.image_url or UBUNTU_IMAGE_URL 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. connection_timeout = CONF.tobiko.ubuntu.connection_timeout or 600.
class UbuntuMinimalImageFixture(UbuntuImageFixture):
image_url = UBUNTU_MINIMAL_IMAGE_URL
class UbuntuFlavorStackFixture(_nova.FlavorStackFixture): class UbuntuFlavorStackFixture(_nova.FlavorStackFixture):
ram = 256 ram = 256
class UbuntuMinimalFlavorStackFixture(_nova.FlavorStackFixture):
ram = 128
class UbuntuServerStackFixture(_nova.ServerStackFixture): class UbuntuServerStackFixture(_nova.ServerStackFixture):
#: Glance image used to create a Nova server instance #: Glance image used to create a Nova server instance
@ -52,3 +67,16 @@ class UbuntuServerStackFixture(_nova.ServerStackFixture):
#: Setup SWAP file in bytes #: Setup SWAP file in bytes
swap_maxsize = 1 * 1024 * 1024 * 1024 # 1 GB 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

View File

@ -15,6 +15,8 @@
# under the License. # under the License.
from __future__ import absolute_import from __future__ import absolute_import
import pytest
import tobiko import tobiko
from tobiko.shell import sh from tobiko.shell import sh
from tobiko.openstack import stacks from tobiko.openstack import stacks
@ -34,3 +36,21 @@ class UbuntuServerStackTest(test_cirros.CirrosServerStackTest):
ssh_client=self.stack.ssh_client).stdout ssh_client=self.stack.ssh_client).stdout
self.assertTrue(python_version.startswith('Python 3.'), self.assertTrue(python_version.startswith('Python 3.'),
python_version) 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")