Remove get_ip_list()
get_ip_list() just calls exec_command("ip address"), there is not
so much merit to keep this in common place.
NOTE: This change affects congress and vmware-nsx.
Change-Id: Iadddf283dc7bed502285cb2fc9e87110787d87a0
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index 1aa09e6..e9ea92a 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -166,10 +166,6 @@
nic = self.exec_command(cmd)
return nic.strip().strip(":").lower()
- def get_ip_list(self):
- cmd = "ip address"
- return self.exec_command(cmd)
-
def assign_static_ip(self, nic, addr, network_mask_bits=28):
cmd = "sudo ip addr add {ip}/{mask} dev {nic}".format(
ip=addr, mask=network_mask_bits, nic=nic)
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 85d7e37..5bbc039 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -292,7 +292,7 @@
def _get_server_nics(self, ssh_client):
reg = re.compile(r'(?P<num>\d+): (?P<nic_name>\w+):')
- ipatxt = ssh_client.get_ip_list()
+ ipatxt = ssh_client.exec_command("ip address")
return reg.findall(ipatxt)
def _check_network_internal_connectivity(self, network,
diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py
index d8a1363..d9b93fe 100644
--- a/tempest/scenario/test_network_v6.py
+++ b/tempest/scenario/test_network_v6.py
@@ -164,7 +164,7 @@
sshv4_2, ips_from_api_2, sid2 = self.prepare_server(networks=net_list)
def guest_has_address(ssh, addr):
- return addr in ssh.get_ip_list()
+ return addr in ssh.exec_command("ip address")
# Turn on 2nd NIC for Cirros when dualnet
if dualnet:
@@ -172,8 +172,8 @@
self.turn_nic6_on(sshv4_2, sid2)
# get addresses assigned to vNIC as reported by 'ip address' utility
- ips_from_ip_1 = sshv4_1.get_ip_list()
- ips_from_ip_2 = sshv4_2.get_ip_list()
+ ips_from_ip_1 = sshv4_1.exec_command("ip address")
+ ips_from_ip_2 = sshv4_2.exec_command("ip address")
self.assertIn(ips_from_api_1['4'], ips_from_ip_1)
self.assertIn(ips_from_api_2['4'], ips_from_ip_2)
for i in range(n_subnets6):
diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py
index 1c5e89f..7199206 100644
--- a/tempest/tests/common/utils/linux/test_remote_client.py
+++ b/tempest/tests/common/utils/linux/test_remote_client.py
@@ -139,23 +139,6 @@
self._assert_exec_called_with(
"ip addr | awk '/ether/ {print $2}'")
- def test_get_ip_list(self):
- ips = """1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
- link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
- inet 127.0.0.1/8 scope host lo
- inet6 ::1/128 scope host
- valid_lft forever preferred_lft forever
-2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
- link/ether fa:16:3e:6e:26:3b brd ff:ff:ff:ff:ff:ff
- inet 10.0.0.4/24 brd 10.0.0.255 scope global eth0
- inet6 fd55:faaf:e1ab:3d9:f816:3eff:fe6e:263b/64 scope global dynamic
- valid_lft 2591936sec preferred_lft 604736sec
- inet6 fe80::f816:3eff:fe6e:263b/64 scope link
- valid_lft forever preferred_lft forever"""
- self.ssh_mock.mock.exec_command.return_value = ips
- self.assertEqual(self.conn.get_ip_list(), ips)
- self._assert_exec_called_with('ip address')
-
def test_assign_static_ip(self):
self.ssh_mock.mock.exec_command.return_value = ''
ip = '10.0.0.2'