Skip to content

Commit

Permalink
cfm: Add test for fault_override
Browse files Browse the repository at this point in the history
This patch adds tests for the cfm fault_override feature which can be
set through "ovs-appctl cfm/set-fault <port> <value>". It brings up two
ports with CFM, sets a fault, then checks that the fault status has
propagated correctly to the CFM module and the database. Finally, it
sets the fault override behaviour to normal and checks that the fault
has gone away.

Signed-off-by: Joe Stringer <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
joestringer authored and blp committed Dec 17, 2013
1 parent 837a88d commit 45ebaaf
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/cfm.at
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,43 @@ AT_CHECK([ovs-vsctl set interface p1 cfm_mpid=2])
for i in `seq 0 10`; do ovs-appctl time/warp 100; done
CFM_VSCTL_LIST_IFACE([p0], [cfm_flap_count], [cfm_flap_count : 2])

OVS_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([cfm - fault_override])
OVS_VSWITCHD_START([add-br br1 -- \
set bridge br1 datapath-type=dummy \
other-config:hwaddr=aa:55:aa:56:00:00 -- \
add-port br1 p1 -- set Interface p1 type=patch \
options:peer=p0 -- \
add-port br0 p0 -- set Interface p0 type=patch \
options:peer=p1 -- \
set Interface p0 cfm_mpid=1 other_config:cfm_interval=100 other_config:cfm_extended=true -- \
set Interface p1 cfm_mpid=2 other_config:cfm_interval=100 other_config:cfm_extended=true])

ovs-appctl time/stop
# wait for a while to stablize cfm.
for i in `seq 0 100`; do ovs-appctl time/warp 100; done
CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [100ms], [2], [up])
CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [100ms], [1], [up])
AT_CHECK([ovs-appctl cfm/show p1 | grep 'fault_override'], [1], [ignore])
CFM_VSCTL_LIST_IFACE([p1], [cfm_fault_status], [cfm_fault_status : [[]]])

# set a fault and see that this is shown in the CFM module and the database
AT_CHECK([ovs-appctl cfm/set-fault p1 true], [0], [OK
])
AT_CHECK([ovs-appctl time/warp 100], [0], [ignore])
AT_CHECK([ovs-appctl cfm/show p1 | grep 'fault_override' | sed -e 's/MPID [[0-9]]*: extended //'], [0], [dnl
fault_override
])
CFM_VSCTL_LIST_IFACE([p1], [cfm_fault_status], [cfm_fault_status : [[override]]])

# reset and see that it returned to normal
AT_CHECK([ovs-appctl cfm/set-fault normal], [0], [OK
])
AT_CHECK([ovs-appctl time/warp 100], [0], [ignore])
AT_CHECK([ovs-appctl cfm/show p1 | grep 'fault_override'], [1], [ignore])
CFM_VSCTL_LIST_IFACE([p1], [cfm_fault_status], [cfm_fault_status : [[]]])

OVS_VSWITCHD_STOP
AT_CLEANUP

0 comments on commit 45ebaaf

Please sign in to comment.