Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion coriolis/tests/integration/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def setUpClass(cls):
cls._imp_conn_info = cls._harness.imp_conn_info
cls._imp_env_options = cls._harness.imp_env_options
cls._storage_mappings = cls._harness.imp_storage_mappings
cls._pool_env = cls._harness.imp_minion_pool_environment

cls._client = cls.get_client()

Expand Down Expand Up @@ -167,7 +168,7 @@ def _create_pool(
endpoint=endpoint_id,
platform=constants.PROVIDER_PLATFORM_DESTINATION,
os_type=constants.OS_TYPE_LINUX,
environment_options={},
environment_options=cls._pool_env,
minimum_minions=1,
maximum_minions=1,
minion_max_idle_time=3600,
Expand Down
5 changes: 5 additions & 0 deletions coriolis/tests/integration/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def _load_providers_config():
"connection_info": dest_config.get("connection_info"),
"environment": dest_config.get("environment") or {},
"storage_mappings": dest_config.get("storage_mappings") or {},
"minion_pool_environment": (
dest_config.get("minion_pool_environment") or {}),
},
}

Expand Down Expand Up @@ -380,6 +382,9 @@ def __init__(self):
self.imp_storage_mappings = (
providers_config["destination"]["storage_mappings"]
)
self.imp_minion_pool_environment = (
providers_config["destination"]["minion_pool_environment"]
)

self._wsgi_server = None
self._wsgi_server_thread = None
Expand Down
3 changes: 3 additions & 0 deletions coriolis/tests/integration/providers.yaml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ destination:

# Storage backend mapping (source identifier -> destination pool / datastore).
storage_mappings: {}

# environment options forwarded to destination minion pools.
minion_pool_environment: {}
13 changes: 11 additions & 2 deletions coriolis/tests/integration/test_provider/exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
CONF = cfg.CONF
LOG = logging.getLogger(__name__)

# Real VMs always have at least one NIC; destination providers may reject an
# instance with no NIC. "network_map" in the destination's environment options
# must map "test-network" to an existing network on the destination.
_TEST_NIC = {
"id": "fa:16:3e:12:34:56",
"network_name": "test-network",
"mac_address": "fa:16:3e:12:34:56",
}


class TestExportProvider(
BaseEndpointInstancesProvider,
Expand Down Expand Up @@ -125,7 +134,7 @@ def _instance_info(self, source_environment):
"nested_virtualization": False,
"devices": {
"disks": [],
"nics": [],
"nics": [_TEST_NIC],
"cdroms": [],
"serial_ports": [],
"floppies": [],
Expand Down Expand Up @@ -180,7 +189,7 @@ def get_replica_instance_info(
"size_bytes": size_bytes,
}
],
"nics": [],
"nics": [_TEST_NIC],
"cdroms": [],
"serial_ports": [],
"floppies": [],
Expand Down
Loading