Beispiel #1
0
def add_ironic_deployment_image(initrd_url=None, kernel_url=None):
    """Add Ironic deploy images to glance.

    :param initrd_url: URL where the ari image resides
    :type initrd_url: str
    :param kernel_url: URL where the aki image resides
    :type kernel_url: str
    """
    base_name = 'ironic-deploy'
    initrd_name = "{}-initrd".format(base_name)
    vmlinuz_name = "{}-vmlinuz".format(base_name)
    if not initrd_url:
        initrd_url = os.environ.get('TEST_IRONIC_DEPLOY_INITRD', None)
    if not kernel_url:
        kernel_url = os.environ.get('TEST_IRONIC_DEPLOY_VMLINUZ', None)
    if not all([initrd_url, kernel_url]):
        raise ValueError("Missing required deployment image URLs")
    glance_setup.add_image(initrd_url,
                           image_name=initrd_name,
                           backend="swift",
                           disk_format="ari",
                           container_format="ari")
    glance_setup.add_image(kernel_url,
                           image_name=vmlinuz_name,
                           backend="swift",
                           disk_format="aki",
                           container_format="aki")
Beispiel #2
0
def _add_image(url,
               image_name,
               backend="swift",
               disk_format="raw",
               container_format="bare"):
    for attempt in tenacity.Retrying(stop=tenacity.stop_after_attempt(3),
                                     reraise=True):
        with attempt:
            glance_setup.add_image(url,
                                   image_name=image_name,
                                   backend=backend,
                                   disk_format=disk_format,
                                   container_format=container_format)
Beispiel #3
0
def add_amphora_image(image_url=None):
    """Add Octavia ``amphora`` test image to glance.

    :param image_url: URL where image resides
    :type image_url: str
    """
    image_name = 'amphora-x64-haproxy'
    if not image_url:
        image_url = (os.environ.get('FUNCTEST_AMPHORA_LOCATION', None)
                     or 'http://tarballs.openstack.org/octavia/test-images/'
                     'test-only-amphora-x64-haproxy-ubuntu-xenial.qcow2')
    glance_setup.add_image(image_url,
                           image_name=image_name,
                           tags=['octavia-amphora'])
Beispiel #4
0
def add_ironic_os_image(image_url=None):
    """Upload the operating system images built for bare metal deployments.

    :param image_url: URL where the image resides
    :type image_url: str
    """
    image_url = image_url or os.environ.get('TEST_IRONIC_RAW_BM_IMAGE', None)
    image_name = "baremetal-ubuntu-image"
    if image_url is None:
        raise ValueError("Missing image_url")

    glance_setup.add_image(image_url,
                           image_name=image_name,
                           backend="swift",
                           disk_format="raw",
                           container_format="bare")