aboutsummaryrefslogtreecommitdiffstats
path: root/tests/2-nodes-vpp-bridge.yml
blob: e9d0cf80948a5a453d3b2002357b7c25ef231814 (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
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
113
114
version: "3"
services:
  client:
    container_name: ${TEST_VPP_BRIDGE}-client
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
      - /dev/vhost-net:/dev/vhost-net
    command:
      - |
        if [ -d /workspace/build-dev ]; then
          sudo ninja -C /workspace/build-dev install
        fi

        sudo ip link add br0 type bridge
        sudo ip link set br0 up
        sudo ip link set eth0 master br0
        sudo ip addr del ${TOPOLOGY_2_NODES_IP_ADDRESS_CLIENT}/24 dev eth0

        sudo tee /etc/vpp/startup.conf <<EOF
        cpu { main-core 1 }
        plugins {
            path /usr/lib/$$(arch)-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
            plugin default { disable }
            plugin acl_plugin.so { enable }
            plugin nat_plugin.so { enable }
            plugin dhcp_plugin.so { enable }
            plugin dpdk_plugin.so { enable }
            plugin dns_plugin.so { enable }
            plugin ping_plugin.so { enable }
            plugin memif_plugin.so { enable }
            plugin nsim_plugin.so { enable }
            plugin hicn_plugin.so { enable }
        }
        unix {
            startup-config /etc/vpp/client-up.txt
            cli-listen /run/vpp/cli.sock
            log ${FORWARDER_LOG_PATH}
        }

        EOF

        sudo tee /etc/vpp/client-up.txt <<EOF
        create tap id 0 host-bridge br0
        set int state tap0 up
        set int ip addr tap0 ${TOPOLOGY_2_NODES_IP_ADDRESS_CLIENT}/24
        set int ip addr tap0 ${TOPOLOGY_2_NODES_IP6_ADDRESS_CLIENT}/64
        ip route add b002::1/64 via ${TOPOLOGY_2_NODES_IP6_ADDRESS_SERVER} tap0
        EOF

        sudo vpp -c /etc/vpp/startup.conf
        sleep 5
        sudo vppctl hicn enable b002::1/64

        tail -f /dev/null

  server:
    container_name: ${TEST_VPP_BRIDGE}-server
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
      - /dev/vhost-net:/dev/vhost-net
    command:
      - |
        if [ -d /workspace/build-dev ]; then
          sudo ninja -C /workspace/build-dev install
        fi

        sudo ip link add br0 type bridge
        sudo ip link set br0 up
        sudo ip link set eth0 master br0
        sudo ip addr del ${TOPOLOGY_2_NODES_IP_ADDRESS_SERVER}/24 dev eth0

        sudo tee /etc/vpp/startup.conf <<EOF
        cpu { main-core 2 }
        plugins {
            path /usr/lib/$$(arch)-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
            plugin default { disable }
            plugin acl_plugin.so { enable }
            plugin nat_plugin.so { enable }
            plugin dhcp_plugin.so { enable }
            plugin dpdk_plugin.so { enable }
            plugin dns_plugin.so { enable }
            plugin ping_plugin.so { enable }
            plugin memif_plugin.so { enable }
            plugin nsim_plugin.so { enable }
            plugin hicn_plugin.so { enable }
        }
        unix {
            startup-config /etc/vpp/server-up.txt
            cli-listen /run/vpp/cli.sock
            log ${FORWARDER_LOG_PATH}
        }
        EOF

        sudo tee /etc/vpp/server-up.txt <<EOF
        create tap id 0 host-bridge br0
        set int state tap0 up
        set int ip addr tap0 ${TOPOLOGY_2_NODES_IP_ADDRESS_SERVER}/24
        set int ip addr tap0 ${TOPOLOGY_2_NODES_IP6_ADDRESS_SERVER}/64
        EOF

        sudo vpp -c /etc/vpp/startup.conf
        sleep 5

        sudo hiperf -q -S -R -B 4000kbps -z memif_module ${RTC_PRODUCER} -P 2 -k ${HMAC_KEY} &
        sleep 1
        sudo hiperf -q -S -z memif_module ${RAAQM_PRODUCER}/128 &
        sleep 1
        sudo hicn-ping-server -s 0 -n ${PING_PRODUCER}/128 -z memif_module &

        tail -f /dev/null