diff --git a/octavia_tempest_plugin/tests/act_stdby_scenario/v2/test_active_standby_iptables.py b/octavia_tempest_plugin/tests/act_stdby_scenario/v2/test_active_standby_iptables.py index 397b98b8..e7dccb6e 100644 --- a/octavia_tempest_plugin/tests/act_stdby_scenario/v2/test_active_standby_iptables.py +++ b/octavia_tempest_plugin/tests/act_stdby_scenario/v2/test_active_standby_iptables.py @@ -186,7 +186,7 @@ class ActiveStandbyIptablesScenarioTest( linux_client = remote_client.RemoteClient( amp['lb_network_ip'], CONF.load_balancer.amphora_ssh_user, pkey=ssh_key, - ssh_key_type=CONF.validation.ssh_key_type) + **cls.remote_client_args()) linux_client.validate_authentication() # Allow logging from non-init namespaces @@ -204,7 +204,7 @@ class ActiveStandbyIptablesScenarioTest( ssh_key = cls._get_amphora_ssh_key() linux_client = remote_client.RemoteClient( ip_address, CONF.load_balancer.amphora_ssh_user, pkey=ssh_key, - ssh_key_type=CONF.validation.ssh_key_type) + **cls.remote_client_args()) linux_client.validate_authentication() try: diff --git a/octavia_tempest_plugin/tests/test_base.py b/octavia_tempest_plugin/tests/test_base.py index d9562c68..1c25d257 100644 --- a/octavia_tempest_plugin/tests/test_base.py +++ b/octavia_tempest_plugin/tests/test_base.py @@ -21,6 +21,7 @@ import subprocess import tempfile from cryptography.hazmat.primitives import serialization +from oslo_config import cfg from oslo_log import log as logging from oslo_utils import uuidutils from tempest import config @@ -581,6 +582,18 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin, class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest): + @classmethod + def remote_client_args(cls): + # In case we're using octavia-tempest-plugin with old tempest releases + # (for instance on stable/train) that don't support ssh_key_type, catch + # the exception and don't pass any argument + args = {} + try: + args['ssh_key_type'] = CONF.validation.ssh_key_type + except cfg.NoSuchOptError: + pass + return args + @classmethod def resource_setup(cls): super(LoadBalancerBaseTestWithCompute, cls).resource_setup() @@ -982,7 +995,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest): linux_client = remote_client.RemoteClient( ip_address, CONF.validation.image_ssh_user, pkey=ssh_key, - ssh_key_type=CONF.validation.ssh_key_type) + **cls.remote_client_args()) linux_client.validate_authentication() with tempfile.NamedTemporaryFile() as key: @@ -1038,7 +1051,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest): ipv6_address, ipv6_prefix): linux_client = remote_client.RemoteClient( ip_address, CONF.validation.image_ssh_user, pkey=ssh_key, - ssh_key_type=CONF.validation.ssh_key_type) + **cls.remote_client_args()) linux_client.validate_authentication() linux_client.exec_command('sudo ip address add {0}/{1} dev '