3 m4_define([CFM_CHECK_EXTENDED], [
4 AT_CHECK([ovs-appctl cfm/show $1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'],[0],
17 # test cfm under demand mode.
18 AT_SETUP([cfm - demand mode])
19 #Create 2 bridges connected by patch ports and enable BFD
20 OVS_VSWITCHD_START([add-br br1 -- \
21 set bridge br1 datapath-type=dummy \
22 other-config:hwaddr=aa:55:aa:56:00:00 -- \
23 add-port br1 p1 -- set Interface p1 type=patch \
25 add-port br0 p0 -- set Interface p0 type=patch \
27 set Interface p0 cfm_mpid=1 other_config:cfm_interval=300 other_config:cfm_extended=true -- \
28 set Interface p1 cfm_mpid=2 other_config:cfm_interval=300 other_config:cfm_extended=true ])
31 # wait for a while to stablize cfm.
32 for i in `seq 0 100`; do ovs-appctl time/warp 100; done
33 CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [300ms], [2], [up])
34 CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [300ms], [1], [up])
36 # turn on demand mode on one end.
37 AT_CHECK([ovs-vsctl set interface p0 other_config:cfm_demand=true])
39 # cfm should never go down.
42 ovs-appctl time/warp 100
43 CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [300ms], [2], [up])
44 CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [300ms], [1], [up])
47 # turn on demand mode on the other end.
48 AT_CHECK([ovs-vsctl set interface p1 other_config:cfm_demand=true])
51 ovs-appctl time/warp 100
52 CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [300ms], [2], [up])
53 CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [300ms], [1], [up])