Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

cfg-100, cfg-105, cfg-110, cfg-115, cfg-120, cfg-125, cfg-130, cfg-135, cfg-140, cfg-160, cfg-165

Unit Testing

Common Functions

This section defines common functions which will be used in many test cases. They are defined in pseudo python

Code Block
def add_verify_net(net_configs)
	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)
	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
	



PolicyTest case
Network Rule
  • Wiki Markup
    net_cfg = [{'net' = 'tcp', 'intf' = 'eth0'}, {'net' = 'o2ib', 'intf' = 'ib0'}]
  • add_verify_net(
  • add_verify_policy(o2ib, 0)





Use Cases

Preferred Network

...