Versions Compared

Key

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

...

Performance needs to be taken into account with this feature. It is not feasible to traverse the policy lists on every send operation. This will add unnecessary overhead. When rules are applied they have to be "flattened" to the constructs they impact. For example, a Network Rule is added as follows: o2ib priority 0. This rule gives priority for using o2ib network for sending. A priority field in the network will be added. This will be set to 0 for the o2ib network. As we traverse the networks in the selection algorithm, which is part of the current code, the priority field will be compared. This is a more optimal approach than examining the policies on every send to see if it we get any matches.

Anchor
orderofoperations
orderofoperations
Order of Operations

It is important to define the order of rule operations, when there are multiple rules that apply to the same construct.

...

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

Unit Testing

This section will be updated as development continues. The goal is to update the unit test cases with as much detail as possible. It might be better to have pointers to the actual test scripts in the test case table below. For now an example of a pseudo coded test script is outlined below.

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, 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

Test Cases

PolicyTest case
Network Rule

Add and verify local network policy.

Code Block
peer1_address = argv[1]
peer2_address = argv[2]
net = argv[3]
intf = argv[4]
net2 = argv[5]
intf2 = argv[6]

peer1 = make_nid(peer1_address, net)

net_cfg = [{'net' = net, 'intf' = intf}, {'net' = net2, 'intf' = intf2}]
add_verify_net(net_cfg, peer1)
add_verify_policy(net, 0, peer1)

Verify traffic goes over the network with the highest priority

Code Block
# script should grab its input from user (can be automated)
peer1_address = argv[1]
peer2_address = argv[2]
net = argv[3]
intf = argv[4]
net2 = argv[5]
intf2 = argv[6]

net_cfg = [{'net' = net, 'intf' = intf}, {'net' = net2, 'intf' = intf2}]
add_verify_net(net_cfg, peer1)
add_verify_policy(net, 0, peer1)

peer1 = make_nid(peer1_address, net)
peer2 = make_nid(peer2_address, net)
add_verify_net(net_cfg, peer2)
add_verify_policy(net, 0, peer2)
stats1 = get_traffic_stats(peer1)
generate_traffic(peer1, peer2)
stats2 = get_traffic_stats(peer1)
verify_traffic_on(stats1, stats2, net)

Verify traffic goes over the network with the healthiest local NI even though it might not be set to highest priority

Delete local network policy and verify it has been deleted

Verify traffic returns to normal pattern when network policy is deleted

Error handling: Add policy for non-existent network

Add and verify a remote network policy. IE messages will need to be routed to that network

Verify traffic is routed to the remote network with the highest priority

Verify traffic is routed to another available network given the highest priority remote network is not reachable.

Delete remote network policy and verify it has been deleted

Verify traffic returns to normal pattern when remote network policy is deleted.

Error handling: Add policy for non-existent remote network
NID RulesAdd and verify local NID rule

Verify traffic goes over the local NID with the highest priority


Verify traffic goes over the healthiest NID even if it has lower priority

Delete NID policy and verify it has been deleted


Verify traffic goes back to regular pattern after NID policy is deleted.

Error handling: Add policy for non-existent NID


Repeat the above tests for remote NID
NID Pair Rules

Add and verify NID Pair Rule

TODO: how do you verify that a NID Pair rule has been applied correctly. We need to show the preferred NID list in the show command. This also applies to Router Rules.


Verify traffic goes over the preferred Local NIDs

Delete NID pair rule a and verify it has been deleted

Verify traffic goes back to regular pattern after NID Pair policy is deleted.

Error handling: Add a policy that don't match any local NIDs. This should be a no-op
Router RulesSame set of tests as above but for routers
Subsequent AdditionFor each of the policy types, add a policy which doesn't match any thing currently configured. Verify that policy is added irregardless

Add an LNet construct (Net, NI, Route) which matches an existing policy. Verify that policy has been applied on construct

TODO: Show commands like net show, peer show, etc should be modified to show the result of the policy application.


Verify traffic adheres to policy

Delete LNet construct. Verify that policy remains.
Dynamic Policy Addition

Run traffic.

For each of the policy types add a policy which should alter traffic

Verify traffic patterns change when policy is added.

Policy application order

Add all types of policies. They all should match and be applied. Verify.

Run traffic.

Verify that policies are applied on traffic in the order of operations defined here.

Dynamic policy Deletion

Add all types of policies.

Run traffic

Verify that polices are applied on traffic in the order of operations defined.

Delete the policy one at a time.

Verify traffic pattern change with each policy deleted.

Use Cases

Preferred Network

...