From 107dc35b8bbfce349972126ab7ea2339987c6a08 Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Mon, 21 Feb 2022 20:49:12 -0700 Subject: [PATCH] tests: create a IPv4/IPv6 VPC in Ec2 integration tests Integration tests should create their own VPC in EC2 because an account's default VPC, subnets, security groups and ACLs cloud be configured for for limited or unexpected connectivity. --- tests/integration_tests/clouds.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/integration_tests/clouds.py b/tests/integration_tests/clouds.py index 83bc6af6a41..14eaf9c3ac5 100644 --- a/tests/integration_tests/clouds.py +++ b/tests/integration_tests/clouds.py @@ -204,6 +204,14 @@ class Ec2Cloud(IntegrationCloud): def _get_cloud_instance(self): return EC2(tag="ec2-integration-test") + def _perform_launch(self, launch_kwargs, **kwargs): + """Use a dual-stack VPC for cloud-init integration testing.""" + launch_kwargs["vpc"] = self.cloud_instance.get_or_create_vpc( + name="ec2-cloud-init-integration" + ) + pycloudlib_instance = self.cloud_instance.launch(**launch_kwargs) + return pycloudlib_instance + class GceCloud(IntegrationCloud): datasource = "gce"