Skip to content
Merged
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
9 changes: 9 additions & 0 deletions tests/integration_tests/clouds.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ class IntegrationCloud(ABC):
def __init__(self, settings=integration_settings):
self.settings = settings
self.cloud_instance = self._get_cloud_instance()
if settings.PUBLIC_SSH_KEY is not None:
# If we have a non-default key, use it.
self.cloud_instance.use_key(
settings.PUBLIC_SSH_KEY, name=settings.KEYPAIR_NAME
)
elif settings.KEYPAIR_NAME is not None:
# Even if we're using the default key, it may still have a
# different name in the clouds, so we need to set it separately.
self.cloud_instance.key_pair.name = settings.KEYPAIR_NAME
self._released_image_id = self._get_initial_image()
self.snapshot_id = None

Expand Down
12 changes: 12 additions & 0 deletions tests/integration_tests/integration_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@
COLLECT_LOGS = 'ON_ERROR'
LOCAL_LOG_PATH = '/tmp/cloud_init_test_logs'

##################################################################
# SSH KEY SETTINGS
##################################################################

# A path to the public SSH key to use for test runs. (Defaults to pycloudlib's
# default behaviour, using ~/.ssh/id_rsa.pub.)
PUBLIC_SSH_KEY = None

# For clouds which use named keypairs for SSH connection, the name that is used
# for the keypair. (Defaults to pycloudlib's default behaviour.)
KEYPAIR_NAME = None

##################################################################
# GCE SPECIFIC SETTINGS
##################################################################
Expand Down