done
AT_CLEANUP
-# 2 hypervisors, 2 logical ports per HV
-# 2 locally attached networks, 1 port per HV on each network
+# 2 hypervisors, 4 logical ports per HV
+# 2 locally attached networks (one flat, one vlan tagged over same device)
+# 2 ports per HV on each network
AT_SETUP([ovn -- 2 HVs, 2 lports/HV, localnet ports])
AT_KEYWORDS([ovn-localnet])
AT_SKIP_IF([test $HAVE_PYTHON = no])
ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys
ovn_attach n1 br-phys 192.168.0.$i
- for j in 1 2; do
+ for j in 1 2 3 4; do
ovs-vsctl add-port br-int vif$i$j -- \
set Interface vif$i$j external-ids:iface-id=lp$i$j \
options:tx_pcap=hv$i/vif$i$j-tx.pcap \
ovn-nbctl lswitch-add $lswitch_name
- if test $j -eq 1; then
+ if test $j -le 2; then
ovn-nbctl lport-add $lswitch_name $ln_port_name
else
ovn-nbctl lport-add $lswitch_name $ln_port_name "" 101
sed 's/\(00\)\{1,\}$//'
}
for i in 1 2; do
- for j in 1 2; do
+ for j in 1 2 3 4; do
: > $i$j.expected
done
done
done
}
-# lp11 and lp21 are on the same network. (phys, untagged)
+# lp11 and lp21 are on the same network (phys, untagged)
+# and on different hypervisors
test_packet 11 f00000000021 f00000000011 1121 21
test_packet 21 f00000000011 f00000000021 2111 11
-# lp12 and lp22 are on the same network. (phys, VLAN 101)
-test_packet 12 f00000000022 f00000000012 1222 22
-test_packet 22 f00000000012 f00000000022 2212 12
+# lp11 and lp12 are on the same network (phys, untagged)
+# and on the same hypervisor
+# TODO this is broken.
+#test_packet 11 f00000000012 f00000000011 1112 12
+#test_packet 12 f00000000011 f00000000012 1211 11
+
+# lp13 and lp23 are on the same network (phys, VLAN 101)
+# and on different hypervisors
+test_packet 13 f00000000023 f00000000013 1323 23
+test_packet 23 f00000000013 f00000000023 2313 13
+
+# lp13 and lp14 are on the same network (phys, VLAN 101)
+# and on the same hypervisor
+# TODO this is broken.
+#test_packet 13 f00000000014 f00000000013 1314 14
+#test_packet 14 f00000000013 f00000000014 1413 13
# Ports that should not be able to communicate
-test_packet 11 f00000000012 f00000000011 1112
-test_packet 11 f00000000022 f00000000011 1122
-test_packet 21 f00000000012 f00000000021 2112
-test_packet 21 f00000000022 f00000000021 2122
-test_packet 12 f00000000011 f00000000012 1211
-test_packet 12 f00000000021 f00000000012 1221
-test_packet 22 f00000000011 f00000000022 2211
-test_packet 22 f00000000021 f00000000022 2221
+test_packet 11 f00000000013 f00000000011 1113
+test_packet 11 f00000000023 f00000000011 1123
+test_packet 21 f00000000013 f00000000021 2113
+test_packet 21 f00000000023 f00000000021 2123
+test_packet 13 f00000000011 f00000000013 1311
+test_packet 13 f00000000021 f00000000013 1321
+test_packet 23 f00000000011 f00000000023 2311
+test_packet 23 f00000000021 f00000000023 2321
# Allow some time for packet forwarding.
# XXX This can be improved.
# Now check the packets actually received against the ones expected.
for i in 1 2; do
- for j in 1 2; do
+ for j in 1 2 3 4; do
file=hv$i/vif$i$j-tx.pcap
echo $file
$PYTHON "$top_srcdir/utilities/ovs-pcap.in" $file | trim_zeros > $i$j.packets