]> git.proxmox.com Git - mirror_frr.git/blob - tests/topotests/docker/inner/openvswitch.sh
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / tests / topotests / docker / inner / openvswitch.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: MIT
3 #
4 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
5
6 # Load shared functions
7 CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8 . $CDIR/funcs.sh
9
10 #
11 # Script begin
12 #
13
14 log_info "Configuring OpenvSwitch...."
15
16 # Configure OpenvSwitch so we are able to run mininet
17 mkdir -p /var/run/openvswitch
18 ovsdb-tool create /etc/openvswitch/conf.db \
19 /usr/share/openvswitch/vswitch.ovsschema
20 ovsdb-server /etc/openvswitch/conf.db \
21 --remote=punix:/var/run/openvswitch/db.sock \
22 --remote=ptcp:6640 --pidfile=ovsdb-server.pid >/dev/null 2>/dev/null & \
23 disown
24 ovs-vswitchd >/dev/null 2>/dev/null & disown
25
26 sleep 2
27
28 ovs-vsctl --no-wait -- init
29 ovs_version=$(ovs-vsctl -V | grep ovs-vsctl | awk '{print $4}')
30 ovs_db_version=$(\
31 ovsdb-tool schema-version /usr/share/openvswitch/vswitch.ovsschema)
32 ovs-vsctl --no-wait -- set Open_vSwitch . db-version="${ovs_db_version}"
33 ovs-vsctl --no-wait -- set Open_vSwitch . ovs-version="${ovs_version}"
34 ovs-vsctl --no-wait -- set Open_vSwitch . system-type="docker-ovs"
35 ovs-vsctl --no-wait -- set Open_vSwitch . system-version="0.1"
36 ovs-vsctl --no-wait -- \
37 set Open_vSwitch . external-ids:system-id=`cat /proc/sys/kernel/random/uuid`
38 ovs-vsctl --no-wait -- set-manager ptcp:6640
39 ovs-appctl -t ovsdb-server \
40 ovsdb-server/add-remote db:Open_vSwitch,Open_vSwitch,manager_options