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
diff --git a/manila_tempest_tests/tests/scenario/manager_share.py b/manila_tempest_tests/tests/scenario/manager_share.py
index fd02db0..4e0c1b7 100644
--- a/manila_tempest_tests/tests/scenario/manager_share.py
+++ b/manila_tempest_tests/tests/scenario/manager_share.py
@@ -132,7 +132,10 @@
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'],
diff --git a/releasenotes/notes/bug-1858024-fa76d4c5b27f099b.yaml b/releasenotes/notes/bug-1858024-fa76d4c5b27f099b.yaml
new file mode 100644
index 0000000..b94e1c9
--- /dev/null
+++ b/releasenotes/notes/bug-1858024-fa76d4c5b27f099b.yaml
@@ -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.