From 65c891107b5bb27da21b02961c9215fa6151720e Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Fri, 3 May 2019 18:46:17 +0000 Subject: [PATCH] Improve ipv6 configuration The change replaces restarting the network by reloading network profiles. Restart of the network terminates ssh connection, so if possible, better to avoid it. This approach is also compatible with RHEL 8 as there's no network service anymore and therefore can't be restarted. The patch also brings the configured interface up by nmcli, which works better if there already was a network profile connected to the configured interface. nmcli makes it drop the existing profile and use the one which was created in the test. Change-Id: I4ea06f28c525f2631a69f759fc96b262d9100f45 --- tempest/scenario/test_network_v6.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py index 438ee01d7c..8de6614acf 100644 --- a/tempest/scenario/test_network_v6.py +++ b/tempest/scenario/test_network_v6.py @@ -166,9 +166,10 @@ class TestGettingAddress(manager.NetworkScenarioTest): if self._sysconfig_network_scripts_dir_exists(ssh): try: ssh.exec_command( - 'echo -e "DEVICE=%(nic)s\\nIPV6INIT=yes" | ' + 'echo -e "DEVICE=%(nic)s\\nNAME=%(nic)s\\nIPV6INIT=yes" | ' 'sudo tee /etc/sysconfig/network-scripts/ifcfg-%(nic)s; ' - 'sudo /sbin/service network restart' % {'nic': nic}) + 'sudo nmcli connection reload' % {'nic': nic}) + ssh.exec_command('sudo nmcli connection up %s' % nic) except exceptions.SSHExecCommandFailed as e: # NOTE(slaweq): Sometimes it can happen that this SSH command # will fail because of some error from network manager in