Merge "Fix offloading checker"
This commit is contained in:
commit
38950186b1
@ -1158,16 +1158,16 @@ def check_client_smoke(ip):
|
|||||||
|
|
||||||
|
|
||||||
def check_offload(ip, interface, offload_type):
|
def check_offload(ip, interface, offload_type):
|
||||||
command = "ethtool --show-offload {0} |" \
|
command = ("ethtool --show-offload {0} | awk '/{1}/' "
|
||||||
" awk '/{1}/ {{print $2}}'".format(interface, offload_type)
|
"| cut -d ':' -f 2").format(interface, offload_type)
|
||||||
|
|
||||||
result = ssh_manager.execute_on_remote(
|
result = ssh_manager.execute_on_remote(
|
||||||
ip=ip,
|
ip=ip,
|
||||||
cmd=command,
|
cmd=command,
|
||||||
err_msg="Failed to get Offload {0} "
|
err_msg=("Failed to get Offload {0} "
|
||||||
"on node {1}".format(offload_type, ip)
|
"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):
|
def check_get_network_data_over_cli(ip, cluster_id, path):
|
||||||
|
@ -50,6 +50,15 @@ class TestOffloading(TestBasic):
|
|||||||
'offloading_modes': [{'name': name, 'state': state,
|
'offloading_modes': [{'name': name, 'state': state,
|
||||||
'sub': []} for name in types]}]
|
'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],
|
@test(depends_on=[SetupEnvironment.prepare_slaves_3],
|
||||||
groups=["offloading_neutron_vlan", "offloading"])
|
groups=["offloading_neutron_vlan", "offloading"])
|
||||||
@log_snapshot_after_test
|
@log_snapshot_after_test
|
||||||
@ -63,8 +72,8 @@ class TestOffloading(TestBasic):
|
|||||||
4. Setup offloading types
|
4. Setup offloading types
|
||||||
5. Run network verification
|
5. Run network verification
|
||||||
6. Deploy the cluster
|
6. Deploy the cluster
|
||||||
7. Run network verification
|
7. Verify offloading modes on nodes
|
||||||
8. Verify offloading modes on nodes
|
8. Run network verification
|
||||||
9. Run OSTF
|
9. Run OSTF
|
||||||
|
|
||||||
Duration 30m
|
Duration 30m
|
||||||
@ -127,23 +136,16 @@ class TestOffloading(TestBasic):
|
|||||||
|
|
||||||
self.show_step(5)
|
self.show_step(5)
|
||||||
self.fuel_web.verify_network(cluster_id)
|
self.fuel_web.verify_network(cluster_id)
|
||||||
|
|
||||||
self.show_step(6)
|
self.show_step(6)
|
||||||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||||
|
|
||||||
self.show_step(7)
|
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)
|
self.show_step(8)
|
||||||
for node in nodes:
|
self.fuel_web.verify_network(cluster_id)
|
||||||
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.show_step(9)
|
self.show_step(9)
|
||||||
self.fuel_web.run_ostf(cluster_id=cluster_id)
|
self.fuel_web.run_ostf(cluster_id=cluster_id)
|
||||||
@ -163,8 +165,8 @@ class TestOffloading(TestBasic):
|
|||||||
4. Setup offloading types
|
4. Setup offloading types
|
||||||
5. Run network verification
|
5. Run network verification
|
||||||
6. Deploy the cluster
|
6. Deploy the cluster
|
||||||
7. Run network verification
|
7. Verify offloading modes on nodes
|
||||||
8. Verify offloading modes on nodes
|
8. Run network verification
|
||||||
9. Run OSTF
|
9. Run OSTF
|
||||||
|
|
||||||
Duration 30m
|
Duration 30m
|
||||||
@ -227,23 +229,16 @@ class TestOffloading(TestBasic):
|
|||||||
|
|
||||||
self.show_step(5)
|
self.show_step(5)
|
||||||
self.fuel_web.verify_network(cluster_id)
|
self.fuel_web.verify_network(cluster_id)
|
||||||
|
|
||||||
self.show_step(6)
|
self.show_step(6)
|
||||||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||||
|
|
||||||
self.show_step(7)
|
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)
|
self.show_step(8)
|
||||||
for node in nodes:
|
self.fuel_web.verify_network(cluster_id)
|
||||||
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.show_step(9)
|
self.show_step(9)
|
||||||
self.fuel_web.run_ostf(cluster_id=cluster_id)
|
self.fuel_web.run_ostf(cluster_id=cluster_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user