From 82ffc53273927bfc8d71e7f0c858753552d85cf1 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Thu, 1 Oct 2020 15:32:35 -0500 Subject: Initial implementation of integration testing infrastructure (#581) --- tests/integration_tests/integration_settings.py | 95 +++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 tests/integration_tests/integration_settings.py (limited to 'tests/integration_tests/integration_settings.py') diff --git a/tests/integration_tests/integration_settings.py b/tests/integration_tests/integration_settings.py new file mode 100644 index 00000000..ddd587db --- /dev/null +++ b/tests/integration_tests/integration_settings.py @@ -0,0 +1,95 @@ +# This file is part of cloud-init. See LICENSE file for license information. +import os + +################################################################## +# LAUNCH SETTINGS +################################################################## + +# Keep instance (mostly for debugging) when test is finished +KEEP_INSTANCE = False + +# One of: +# lxd_container +# ec2 +# gce +# oci +PLATFORM = 'lxd_container' + +# The cloud-specific instance type to run. E.g., a1.medium on AWS +# If the pycloudlib instance provides a default, this can be left None +INSTANCE_TYPE = None + +# Determines the base image to use or generate new images from. +# Can be the name of the OS if running a stock image, +# otherwise the id of the image being used if using a custom image +OS_IMAGE = 'focal' + +# Populate if you want to use a pre-launched instance instead of +# creating a new one. The exact contents will be platform dependent +EXISTING_INSTANCE_ID = None + +################################################################## +# IMAGE GENERATION SETTINGS +################################################################## + +# Depending on where we are in the development / test / SRU cycle, we'll want +# different methods of getting the source code to our SUT. Because of +# this there are a number of different ways to initialize +# the target environment. + +# Can be any of the following: +# NONE +# Don't modify the target environment at all. This will run +# cloud-init with whatever code was baked into the image +# IN_PLACE +# LXD CONTAINER only. Mount the source code as-is directly into +# the container to override the pre-existing cloudinit module. This +# won't work for non-local LXD remotes and won't run any installation +# code. +# PROPOSED +# Install from the Ubuntu proposed repo +# , e.g., ppa:cloud-init-dev/proposed +# Install from a PPA. It MUST start with 'ppa:' +# +# A path to a valid package to be uploaded and installed +CLOUD_INIT_SOURCE = 'NONE' + +################################################################## +# GCE SPECIFIC SETTINGS +################################################################## +# Required for GCE +GCE_PROJECT = None + +# You probably want to override these +GCE_REGION = 'us-central1' +GCE_ZONE = 'a' + +################################################################## +# OCI SPECIFIC SETTINGS +################################################################## +# Compartment-id found at +# https://console.us-phoenix-1.oraclecloud.com/a/identity/compartments +# Required for Oracle +OCI_COMPARTMENT_ID = None + +################################################################## +# USER SETTINGS OVERRIDES +################################################################## +# Bring in any user-file defined settings +try: + from tests.integration_tests.user_settings import * # noqa +except ImportError: + pass + +################################################################## +# ENVIRONMENT SETTINGS OVERRIDES +################################################################## +# Any of the settings in this file can be overridden with an +# environment variable of the same name prepended with CLOUD_INIT_ +# E.g., CLOUD_INIT_PLATFORM +# Perhaps a bit too hacky, but it works :) +current_settings = [var for var in locals() if var.isupper()] +for setting in current_settings: + globals()[setting] = os.getenv( + 'CLOUD_INIT_{}'.format(setting), globals()[setting] + ) -- cgit v1.2.3 From 6bd2cda1d3812750027590fe02a5b9415c8f8c9e Mon Sep 17 00:00:00 2001 From: James Falcon Date: Thu, 15 Oct 2020 15:48:38 -0500 Subject: Add Azure support to integration test framework (#604) --- tests/integration_tests/integration_settings.py | 1 + tests/integration_tests/platforms.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/integration_tests/integration_settings.py') diff --git a/tests/integration_tests/integration_settings.py b/tests/integration_tests/integration_settings.py index ddd587db..a0609f7e 100644 --- a/tests/integration_tests/integration_settings.py +++ b/tests/integration_tests/integration_settings.py @@ -10,6 +10,7 @@ KEEP_INSTANCE = False # One of: # lxd_container +# azure # ec2 # gce # oci diff --git a/tests/integration_tests/platforms.py b/tests/integration_tests/platforms.py index ba1d4e9f..3755eb1e 100644 --- a/tests/integration_tests/platforms.py +++ b/tests/integration_tests/platforms.py @@ -217,7 +217,7 @@ class LxdContainerClient(IntegrationClient): client_name_to_class = { 'ec2': Ec2Client, 'gce': GceClient, - # 'azure': AzureClient, # Not supported yet + 'azure': AzureClient, 'oci': OciClient, 'lxd_container': LxdContainerClient } -- cgit v1.2.3