2020-10-02 00:19:13 +00:00
|
|
|
#!/usr/bin/env atf-sh
|
|
|
|
|
|
|
|
. $(atf_get_srcdir)/../test_env.sh
|
|
|
|
EXECUTOR="$(atf_get_srcdir)/../../executor-scripts/linux/vxlan"
|
|
|
|
|
|
|
|
tests_init \
|
|
|
|
create_simple \
|
2021-10-16 13:15:35 +00:00
|
|
|
create_ucast_ptp \
|
|
|
|
create_ucast_ptmp \
|
2020-10-02 00:19:13 +00:00
|
|
|
create_mcast \
|
|
|
|
create_physdev \
|
|
|
|
create_dstport \
|
|
|
|
create_nolearning \
|
|
|
|
destroy \
|
|
|
|
|
|
|
|
create_simple_body() {
|
|
|
|
export IFACE=vx_foo PHASE=create MOCK=echo IF_VXLAN_ID=2342
|
|
|
|
atf_check -s exit:0 -o match:'ip link add vx_foo type vxlan id 2342 dstport 4789' \
|
|
|
|
${EXECUTOR}
|
|
|
|
}
|
|
|
|
|
2021-10-16 13:15:35 +00:00
|
|
|
create_ucast_ptp_body() {
|
|
|
|
export IFACE=vx_foo PHASE=create MOCK=echo IF_VXLAN_ID=2342 IF_VXLAN_PEER_IPS=192.2.0.42
|
2020-10-02 00:19:13 +00:00
|
|
|
atf_check -s exit:0 -o match:'ip link add vx_foo type vxlan id 2342 remote 192.2.0.42' \
|
|
|
|
${EXECUTOR}
|
|
|
|
}
|
|
|
|
|
2021-10-16 13:15:35 +00:00
|
|
|
create_ucast_ptmp_body() {
|
|
|
|
export IFACE=vx_foo PHASE=create MOCK=echo IF_VXLAN_ID=2342 IF_VXLAN_PEER_IPS="10.0.0.1 10.0.0.2 10.0.0.3"
|
|
|
|
atf_check -s exit:0 \
|
|
|
|
-o match:'ip link add vx_foo type vxlan id 2342 dstport 4789' \
|
|
|
|
-o match:'bridge fdb append 00:00:00:00:00:00 dev vx_foo dst 10.0.0.1 self permanent' \
|
|
|
|
-o match:'bridge fdb append 00:00:00:00:00:00 dev vx_foo dst 10.0.0.2 self permanent' \
|
|
|
|
-o match:'bridge fdb append 00:00:00:00:00:00 dev vx_foo dst 10.0.0.3 self permanent' \
|
|
|
|
${EXECUTOR}
|
|
|
|
}
|
|
|
|
|
2020-10-02 00:19:13 +00:00
|
|
|
create_mcast_body() {
|
2021-10-16 13:15:35 +00:00
|
|
|
export IFACE=vx_foo PHASE=create MOCK=echo IF_VXLAN_ID=2342 IF_VXLAN_PEER_GROUP=225.0.8.15
|
2020-10-02 00:19:13 +00:00
|
|
|
atf_check -s exit:0 -o match:'ip link add vx_foo type vxlan id 2342 group 225.0.8.15' \
|
|
|
|
${EXECUTOR}
|
|
|
|
}
|
|
|
|
|
|
|
|
create_physdev_body() {
|
|
|
|
export IFACE=vx_foo PHASE=create MOCK=echo IF_VXLAN_ID=2342 IF_VXLAN_PHYSDEV=eth0
|
|
|
|
atf_check -s exit:0 -o match:'ip link add vx_foo type vxlan id 2342 dev eth0' \
|
|
|
|
${EXECUTOR}
|
|
|
|
}
|
|
|
|
|
|
|
|
create_dstport_body() {
|
|
|
|
export IFACE=vx_foo PHASE=create MOCK=echo IF_VXLAN_ID=2342 IF_VXLAN_DSTPORT=1234
|
|
|
|
atf_check -s exit:0 -o match:'ip link add vx_foo type vxlan id 2342 dstport 1234' \
|
|
|
|
${EXECUTOR}
|
|
|
|
}
|
|
|
|
|
|
|
|
create_nolearning_body() {
|
|
|
|
export IFACE=vx_foo PHASE=create MOCK=echo IF_VXLAN_ID=2342 IF_VXLAN_LEARNING=no
|
|
|
|
atf_check -s exit:0 -o match:'ip link add vx_foo type vxlan id 2342 dstport 4789 nolearning' \
|
|
|
|
${EXECUTOR}
|
|
|
|
}
|
|
|
|
|
|
|
|
destroy_body() {
|
|
|
|
export IFACE=vx_foo PHASE=destroy MOCK=echo IF_VXLAN_ID=2342
|
|
|
|
atf_check -s exit:0 -o match:'ip link del vx_foo' \
|
|
|
|
${EXECUTOR}
|
|
|
|
}
|