Use a single keypair for multiple instances

When I ran manila scenario tests, some tests failed due to
ssh key authentication. I noticed that tests with single
instance pass, however, tests with more than one instance
(e.g. "test_read_write_two_vms" test) fail.
I figured out that every instance initialization creates a
unique keypair.
An unnecessary resource duplication, when a single user boots
more than one instance. Depending on test flow this may also
cause keypair mismatch.

Change-Id: Ic685d1b9574daf7e6c9b90d5636f1b614a70b0da
Related-bug: #1858024
This commit is contained in:
lkuchlan 2020-01-01 15:56:52 +02:00
parent 4d7b494990
commit 0cd6c999d4
2 changed files with 12 additions and 1 deletions

View File

@ -132,7 +132,10 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
return share_network
def boot_instance(self, wait_until="ACTIVE"):
self.keypair = self.create_keypair()
# In case of multiple instances, use a single keypair to prevent a keys
# mismatch.
if not hasattr(self, 'keypair'):
self.keypair = self.create_keypair()
security_groups = [{'name': self.security_group['name']}]
create_kwargs = {
'key_name': self.keypair['name'],

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixed bug #1858024. Define a signle key for multiple instances.
Currently every instance initialization creates a unique keypair.
An unnecessary resource duplication, when a single user boots more
than one instance.
Depending on test flow this may also cause keypair mismatch.