diff options
| author | Ethan Jackson <ethan@nicira.com> | 2011-07-20 15:07:46 -0700 |
|---|---|---|
| committer | Ethan Jackson <ethan@nicira.com> | 2011-07-22 17:46:48 -0700 |
| commit | a368bb53d9769ae42042e122775672ac9546e3f9 (patch) | |
| tree | 4cbb05275c16ffd4ab6d5121eeb78accf0c08b63 /tests | |
| parent | 04a85497b994b0cb1c702d4ff8b0d2149767ae0e (diff) | |
| download | openvswitch-a368bb53d9769ae42042e122775672ac9546e3f9.tar.gz | |
bundle: New action "bundle_load".
The bundle_load action behaves the same as the bundle action,
except instead of outputting, it writes its result to a register.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bundle.at | 8 | ||||
| -rw-r--r-- | tests/ovs-ofctl.at | 8 | ||||
| -rw-r--r-- | tests/test-bundle.c | 13 |
3 files changed, 21 insertions, 8 deletions
diff --git a/tests/bundle.at b/tests/bundle.at index 8a8cb4f2f..8a3c29193 100644 --- a/tests/bundle.at +++ b/tests/bundle.at @@ -8,7 +8,7 @@ AT_BANNER([bundle link selection]) # if the test does fail. AT_SETUP([hrw bundle link selection]) -AT_CHECK([[test-bundle 'symmetric_l4,60,hrw,ofport,slaves:1,2,3,4,5,6']], +AT_CHECK([[test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:1,2,3,4,5']], [0], [ignore]) # 100000: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 # 110000: disruption=0.50 (perfect=0.50) 0.50 0.50 0.00 0.00 0.00 0.00 @@ -78,7 +78,7 @@ AT_CHECK([[test-bundle 'symmetric_l4,60,hrw,ofport,slaves:1,2,3,4,5,6']], AT_CLEANUP AT_SETUP([active_backup bundle link selection]) -AT_CHECK([[test-bundle 'symmetric_l4,60,active_backup,ofport,slaves:1,2,3,4,5,6']], +AT_CHECK([[test-bundle 'symmetric_l4,60,active_backup,ofport,NXM_NX_REG0[],slaves:1,2,3,4,5,6']], [0], [100000: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 110000: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 @@ -149,7 +149,7 @@ AT_CHECK([[test-bundle 'symmetric_l4,60,active_backup,ofport,slaves:1,2,3,4,5,6' AT_CLEANUP AT_SETUP([hrw bundle single link selection]) -AT_CHECK([[test-bundle 'symmetric_l4,60,hrw,ofport,slaves:1']], +AT_CHECK([[test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:1']], [0], [ignore]) # 1: disruption=1.00 (perfect=1.00) 1.00 # 0: disruption=1.00 (perfect=1.00) 0.00 @@ -157,7 +157,7 @@ AT_CHECK([[test-bundle 'symmetric_l4,60,hrw,ofport,slaves:1']], AT_CLEANUP AT_SETUP([hrw bundle no link selection]) -AT_CHECK([[test-bundle 'symmetric_l4,60,hrw,ofport,slaves:']], +AT_CHECK([[test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:']], [0], [ignore]) AT_CLEANUP #: disruption=0.00 (perfect=0.00) diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 63292dbb4..1b4cfd90e 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -19,6 +19,10 @@ actions=bundle(eth_src,50,active_backup,ofport,slaves:1) actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3) actions=bundle(symmetric_l4,60,hrw,ofport,slaves:) actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2 +actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1) +actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) +actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:) +actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2 ]]) AT_CHECK([ovs-ofctl parse-flows flows.txt ], [0], [stdout]) @@ -41,6 +45,10 @@ NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slave NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3) NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:) NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2 +NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1) +NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) +NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:) +NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2 ]]) AT_CLEANUP diff --git a/tests/test-bundle.c b/tests/test-bundle.c index fb15faf98..16e264d2b 100644 --- a/tests/test-bundle.c +++ b/tests/test-bundle.c @@ -71,7 +71,7 @@ parse_bundle_actions(char *actions) struct ofpbuf b; ofpbuf_init(&b, 0); - bundle_parse(&b, actions); + bundle_parse_load(&b, actions); nab = ofpbuf_steal_data(&b); ofpbuf_uninit(&b); @@ -136,7 +136,7 @@ main(int argc, char *argv[]) flows[i].regs[0] = OFPP_NONE; } - if (bundle_check(nab, 1024)) { + if (bundle_check(nab, 1024, flows)) { ovs_fatal(0, "Bundle action fails to check."); } @@ -185,10 +185,15 @@ main(int argc, char *argv[]) changed = 0; for (j = 0; j < N_FLOWS; j++) { struct flow *flow = &flows[j]; - uint16_t old_slave_id; + uint16_t old_slave_id, ofp_port; old_slave_id = flow->regs[0]; - flow->regs[0] = bundle_execute(nab, flow, slave_enabled_cb, &sg); + ofp_port = bundle_execute(nab, flow, slave_enabled_cb, &sg); + bundle_execute_load(nab, flow, slave_enabled_cb, &sg); + if (flow->regs[0] != ofp_port) { + ovs_fatal(0, "bundle_execute_load() and bundle_execute() " + "disagree"); + } if (flow->regs[0] != OFPP_NONE) { slave_lookup(&sg, flow->regs[0])->flow_count++; |
