forked from ovn-org/ovn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathovn-ic-sbctl.at
112 lines (102 loc) · 3.59 KB
/
ovn-ic-sbctl.at
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
AT_BANNER([ovn-ic-sbctl])
# OVN_IC_SBCTL_TEST_START
m4_define([OVN_IC_SBCTL_TEST_START],
[dnl Create database (ovn-ic-sb).
AT_KEYWORDS([ic_sbctl])
AT_CHECK([ovsdb-tool create ovn-ic-sb.db $abs_top_srcdir/ovn-ic-sb.ovsschema])
dnl Start ovsdb-servers.
AT_CHECK([ovsdb-server --detach --no-chdir --pidfile=ovn_ic_sb_db.pid --unixctl=$OVS_RUNDIR/ovn_ic_sb_db.ctl --log-file=ovsdb_ic_nb.log --remote=punix:$OVS_RUNDIR/ovn_ic_sb_db.sock ovn-ic-sb.db ], [0], [], [stderr])
on_exit "kill `cat ovn_ic_sb_db.pid`"
AT_CHECK([[sed < stderr '
/vlog|INFO|opened log file/d
/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d']])
AT_CAPTURE_FILE([ovsdb-server.log])
])
# OVN_IC_SBCTL_TEST_STOP
m4_define([OVN_IC_SBCTL_TEST_STOP],
[AT_CHECK([check_logs "$1"])
OVS_APP_EXIT_AND_WAIT_BY_TARGET([$OVS_RUNDIR/ovn_ic_sb_db.ctl], [$OVS_RUNDIR/ovn_ic_sb_db.pid])])
dnl ---------------------------------------------------------------------
AT_SETUP([ovn-ic-sbctl])
OVN_IC_SBCTL_TEST_START
for az in 1 2; do
az_uuid=$(ovn-ic-sbctl create availability_zone name=az$az)
for gw in 1 2; do
ovn-ic-sbctl --id=@encap create encap type=geneve ip=192.168.0.$az$gw options="csum=true" \
-- create gateway availability_zone=$az_uuid name=gw$az$gw encap=@encap hostname=host.gw$az$gw
for pb in 1 2; do
ovn-ic-sbctl create port_binding logical_port=lp$az$gw$pb transit_switch="ts$pb" \
address="\"aa:aa:aa:aa:0$az:$gw$pb 169.254.$pb.$az$gw/24\"" tunnel_key=$az$gw \
availability_zone=$az_uuid gateway=gw$az$gw
done
done
done
AT_CHECK([ovn-ic-sbctl show], [0], [dnl
availability-zone az1
gateway gw11
hostname: host.gw11
type: geneve
ip: 192.168.0.11
port lp111
transit switch: ts1
address: [["aa:aa:aa:aa:01:11 169.254.1.11/24"]]
port lp112
transit switch: ts2
address: [["aa:aa:aa:aa:01:12 169.254.2.11/24"]]
gateway gw12
hostname: host.gw12
type: geneve
ip: 192.168.0.12
port lp121
transit switch: ts1
address: [["aa:aa:aa:aa:01:21 169.254.1.12/24"]]
port lp122
transit switch: ts2
address: [["aa:aa:aa:aa:01:22 169.254.2.12/24"]]
availability-zone az2
gateway gw21
hostname: host.gw21
type: geneve
ip: 192.168.0.21
port lp211
transit switch: ts1
address: [["aa:aa:aa:aa:02:11 169.254.1.21/24"]]
port lp212
transit switch: ts2
address: [["aa:aa:aa:aa:02:12 169.254.2.21/24"]]
gateway gw22
hostname: host.gw22
type: geneve
ip: 192.168.0.22
port lp221
transit switch: ts1
address: [["aa:aa:aa:aa:02:21 169.254.1.22/24"]]
port lp222
transit switch: ts2
address: [["aa:aa:aa:aa:02:22 169.254.2.22/24"]]
])
AT_CHECK([ovn-ic-sbctl show az2], [0], [dnl
availability-zone az2
gateway gw21
hostname: host.gw21
type: geneve
ip: 192.168.0.21
port lp211
transit switch: ts1
address: [["aa:aa:aa:aa:02:11 169.254.1.21/24"]]
port lp212
transit switch: ts2
address: [["aa:aa:aa:aa:02:12 169.254.2.21/24"]]
gateway gw22
hostname: host.gw22
type: geneve
ip: 192.168.0.22
port lp221
transit switch: ts1
address: [["aa:aa:aa:aa:02:21 169.254.1.22/24"]]
port lp222
transit switch: ts2
address: [["aa:aa:aa:aa:02:22 169.254.2.22/24"]]
])
OVN_IC_SBCTL_TEST_STOP
AT_CLEANUP