summaryrefslogtreecommitdiff
path: root/tests/system-interface.at
blob: 784bada12cbb38cfba47a465bc95c88fe9cc04e4 (plain)
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
AT_BANNER([system-inteface])

dnl add a veth interface to br0, then delete and re-create
dnl the veth interface with the same name in the system
AT_SETUP([interface - add delete add same interface])

OVS_TRAFFIC_VSWITCHD_START()

AT_CHECK([ip link add ovs-veth0 type veth peer name ovs-veth1])
on_exit 'ip link del ovs-veth0'

AT_CHECK([ovs-vsctl add-port br0 ovs-veth0])

AT_CHECK([ip link del ovs-veth0])
AT_CHECK([ip link add ovs-veth0 type veth peer name ovs-veth1])

AT_CHECK([ovs-vsctl del-port br0 ovs-veth0])

OVS_TRAFFIC_VSWITCHD_STOP(["dnl
/could not open network device ovs-veth0/d
/cannot get .*STP status on nonexistent port/d
/ethtool command .*on network device ovs-veth0 failed/d
/error receiving .*ovs-veth0/d
/ovs-veth0: removing policing failed/d"])

AT_CLEANUP

dnl add a p1-0 interface to br-p1, then add a route to br-p1 and stop the OvS
dnl instance. Confirm br-p1 interface has been deleted from the system.
AT_SETUP([interface - add route to br and verify clean-up])

OVS_TRAFFIC_VSWITCHD_START()

HWADDR_BRP1=aa:55:00:00:00:01

dnl Create tap port to later add to br-p1
AT_CHECK([ip tuntap add name p1-0 mode tap])
AT_CHECK([ip link set p1-0 up])
on_exit 'ip link del p1-0'

AT_CHECK([
    ovs-vsctl add-br br-p1 -- \
        set bridge br-p1 datapath_type=netdev fail-mode=standalone other-config:hwaddr=$HWADDR_BRP1

    ovs-vsctl add-port br-p1 p1-0

    ovs-ofctl del-flows br-p1
], [0])

AT_CHECK([
    ip addr add 10.0.0.1/24 dev br-p1
    ip link set br-p1 up
], [0], [stdout])

AT_CHECK([
    ovs-appctl ovs/route/add 10.0.0.0/24 br-p1
    ovs-appctl tnl/arp/set br-p1 10.0.0.1 $HWADDR_BRP1
], [0], [stdout])

OVS_TRAFFIC_VSWITCHD_STOP
AT_CHECK([
    ip link show br-p1], [1],
    [stdout], [Device "br-p1" does not exist.]
)
AT_CLEANUP