Fix offloading checker

Modify verification of applyed changes

Change-Id: Ia9188e4654bafc3189964707bc4d2516765ebc4f
Closes-Bug: 1594788
This commit is contained in:
zatserklyany 2016-06-30 16:32:32 +03:00
parent c46385801f
commit 60d575f25c
2 changed files with 28 additions and 33 deletions

View File

@ -1158,16 +1158,16 @@ def check_client_smoke(ip):
def check_offload(ip, interface, offload_type):
command = "ethtool --show-offload {0} |" \
" awk '/{1}/ {{print $2}}'".format(interface, offload_type)
command = ("ethtool --show-offload {0} | awk '/{1}/' "
"| cut -d ':' -f 2").format(interface, offload_type)
result = ssh_manager.execute_on_remote(
ip=ip,
cmd=command,
err_msg="Failed to get Offload {0} "
"on node {1}".format(offload_type, ip)
err_msg=("Failed to get Offload {0} "
"on node {1}").format(offload_type, ip)
)
return ''.join(result['stdout']).rstrip()
return result['stdout_str']
def check_get_network_data_over_cli(ip, cluster_id, path):

View File

@ -50,6 +50,15 @@ class TestOffloading(TestBasic):
'offloading_modes': [{'name': name, 'state': state,
'sub': []} for name in types]}]
@staticmethod
def check_offloading_modes(nodes, offloadings, iface, state):
for node in nodes:
for name in offloadings:
result = check_offload(node['ip'], iface, name)
assert_equal(result, state,
"Offload type {0} is {1} on {2}".format(
name, result, node['name']))
@test(depends_on=[SetupEnvironment.prepare_slaves_3],
groups=["offloading_neutron_vlan", "offloading"])
@log_snapshot_after_test
@ -63,8 +72,8 @@ class TestOffloading(TestBasic):
4. Setup offloading types
5. Run network verification
6. Deploy the cluster
7. Run network verification
8. Verify offloading modes on nodes
7. Verify offloading modes on nodes
8. Run network verification
9. Run OSTF
Duration 30m
@ -127,23 +136,16 @@ class TestOffloading(TestBasic):
self.show_step(5)
self.fuel_web.verify_network(cluster_id)
self.show_step(6)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.show_step(7)
self.fuel_web.verify_network(cluster_id)
self.check_offloading_modes(nodes, offloadings_1, iface1, 'off')
self.check_offloading_modes(nodes, offloadings_2, iface2, 'on')
self.show_step(8)
for node in nodes:
for name in offloadings_1:
result = check_offload(node['ip'], iface1, name)
assert_equal(result, "off",
"Offload type {0} is {1} on {2}".format(
name, result, node['name']))
for name in offloadings_2:
result = check_offload(node['ip'], iface2, name)
assert_equal(result, "on",
"Offload type {0} is {1} on {2}".format(
name, result, node['name']))
self.fuel_web.verify_network(cluster_id)
self.show_step(9)
self.fuel_web.run_ostf(cluster_id=cluster_id)
@ -163,8 +165,8 @@ class TestOffloading(TestBasic):
4. Setup offloading types
5. Run network verification
6. Deploy the cluster
7. Run network verification
8. Verify offloading modes on nodes
7. Verify offloading modes on nodes
8. Run network verification
9. Run OSTF
Duration 30m
@ -227,23 +229,16 @@ class TestOffloading(TestBasic):
self.show_step(5)
self.fuel_web.verify_network(cluster_id)
self.show_step(6)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.show_step(7)
self.fuel_web.verify_network(cluster_id)
self.check_offloading_modes(nodes, offloadings_1, iface1, 'off')
self.check_offloading_modes(nodes, offloadings_2, iface2, 'on')
self.show_step(8)
for node in nodes:
for name in offloadings_1:
result = check_offload(node['ip'], iface1, name)
assert_equal(result, "off",
"Offload type {0} is {1} on {2}".format(
name, result, node['name']))
for name in offloadings_2:
result = check_offload(node['ip'], iface2, name)
assert_equal(result, "on",
"Offload type {0} is {1} on {2}".format(
name, result, node['name']))
self.fuel_web.verify_network(cluster_id)
self.show_step(9)
self.fuel_web.run_ostf(cluster_id=cluster_id)