]>
Commit | Line | Data |
---|---|---|
03f209ba AW |
1 | AT_BANNER([cfm]) |
2 | ||
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], | |
5 | [dnl | |
6 | ---- $1 ---- | |
7 | MPID $2: extended | |
8 | average health: $3 | |
9 | opstate: $4 | |
10 | remote_opstate: $5 | |
11 | interval: $6 | |
12 | Remote MPID $7 | |
13 | opstate: $8 | |
14 | ]) | |
15 | ]) | |
16 | ||
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 \ | |
24 | options:peer=p0 -- \ | |
25 | add-port br0 p0 -- set Interface p0 type=patch \ | |
26 | options:peer=p1 -- \ | |
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 ]) | |
29 | ||
30 | ovs-appctl time/stop | |
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]) | |
35 | ||
36 | # turn on demand mode on one end. | |
37 | AT_CHECK([ovs-vsctl set interface p0 other_config:cfm_demand=true]) | |
38 | ||
39 | # cfm should never go down. | |
40 | for i in `seq 0 100` | |
41 | do | |
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]) | |
45 | done | |
46 | ||
47 | # turn on demand mode on the other end. | |
48 | AT_CHECK([ovs-vsctl set interface p1 other_config:cfm_demand=true]) | |
49 | for i in `seq 0 100` | |
50 | do | |
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]) | |
54 | done | |
55 | ||
56 | OVS_VSWITCHD_STOP | |
57 | AT_CLEANUP |