...
| Code Block |
|---|
def add_verify_net(net_configs, destination) # all command should be executed on destination redirect_to_dest(destination) for cfg in net_configs: lnetctl net add --net cfg['net'] --if cfg['intf'] show_output = lnetctl net show if (cfg['net'] not in show_output) or (show_output[cfg['net']].if_name != cfg['intf']) return FAILED return SUCCESS def add_verify_policy(network_type, priority, destination) # all command should be executed on destination redirect_to_dest(destination) lnetctl policy add --src *@network_type --priority priority show_output = lnetctl policy show if (network_type not in show_output) or (show_output[network_type].priority != priority) return FAILED show_output = lnetctl net show --net network_type if (not show_output) or (show_output[network_type].priority != priority) return FAILED return SUCCESS generate_traffic(peer1, peer2) run_lnet_selftest(peer1, peer2) get_traffic_stats(peer1) # get traffic statistics and return verify_traffic_on(stats1, stats2, net) # make sure that the bulk of the traffic is on net |
| Policy | Test case | ||
|---|---|---|---|
| Network Rule | Add and verify network policy.
| ||
Verify traffic
|
| Wiki Markup |
|---|
net_cfg = [{'net' = 'tcp', 'intf' = 'eth0'}, {'net' = 'o2ib', 'intf' = 'ib0'}] |
| |
Use Cases
Preferred Network
...