aboutsummaryrefslogtreecommitdiffstats
path: root/extras/vagrant/build.sh
blob: 34873f96eaead9eb02df4f2facceac168571b040 (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
#!/bin/bash

# Get Command Line arguements if present
VPP_DIR=$1
if [ "x$1" != "x" ]; then
    VPP_DIR=$1
else
    VPP_DIR=`dirname $0`/../../
fi

if [ "x$2" != "x" ]; then
    SUDOCMD="sudo -H -u $2"
fi
echo 0:$0
echo 1:$1
echo 2:$2
echo VPP_DIR: $VPP_DIR
echo SUDOCMD: $SUDOCMD

# Figure out what system we are running on
if [ -f /etc/lsb-release ];then
    . /etc/lsb-release
elif [ -f /etc/redhat-release ];then
    sudo yum install -y redhat-lsb
    DISTRIB_ID=`lsb_release -si`
    DISTRIB_RELEASE=`lsb_release -sr`
    DISTRIB_CODENAME=`lsb_release -sc`
    DISTRIB_DESCRIPTION=`lsb_release -sd`
elif [ -f /etc/os-release ];then
   . /etc/os-release
   DISTRIB_ID=$ID
   DISTRIB_RELEASE=$VERSION_ID
   DISTRIB_CODENAME=$VERSION
   DISTRIB_DESCRIPTION=$PRETTY_NAME
fi
KERNEL_OS=`uname -o`
KERNEL_MACHINE=`uname -m`
KERNEL_RELEASE=`uname -r`
KERNEL_VERSION=`uname -v`

echo KERNEL_OS: $KERNEL_OS
echo KERNEL_MACHINE: $KERNEL_MACHINE
echo KERNEL_RELEASE: $KERNEL_RELEASE
echo KERNEL_VERSION: $KERNEL_VERSION
echo DISTRIB_ID: $DISTRIB_ID
echo DISTRIB_RELEASE: $DISTRIB_RELEASE
echo DISTRIB_CODENAME: $DISTRIB_CODENAME
echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION

# Install dependencies
cd $VPP_DIR
make UNATTENDED=yes install-dep

# Really really clean things up so we can be sure
# that the build works even when switching distros
$SUDOCMD make wipe
(cd build-root/;$SUDOCMD make distclean)
rm -f build-root/.bootstrap.ok

if [ $DISTRIB_ID == "CentOS" ]; then
    echo rpm -V apr-devel
    rpm -V apr-devel
    if [ $? != 0 ]; then sudo yum reinstall -y apr-devel;fi
    echo rpm -V ganglia-devel
    rpm -V ganglia-devel
    if [ $? != 0 ]; then sudo yum reinstall -y ganglia-devel;fi
    echo rpm -V libconfuse-devel
    rpm -V libconfuse-devel
    if [ $? != 0 ]; then sudo yum reinstall -y libconfuse-devel;fi
fi

# Build and install packaging
$SUDOCMD make bootstrap

if [ $DISTRIB_ID == "Ubuntu" ]; then
    $SUDOCMD make pkg-deb
elif [ $DISTRIB_ID == "debian" ]; then
    $SUDOCMD make pkg-deb
elif [ $DISTRIB_ID == "CentOS" ]; then
    (cd $VPP_DIR/vnet ;$SUDOCMD aclocal;$SUDOCMD automake -a)
    $SUDOCMD make pkg-rpm
fi
/ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2020 Intel and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

*** Settings ***
| Library | Collections
| Library | String

| Library | resources.libraries.python.InterfaceUtil
| Library | resources.libraries.python.IPUtil
| Library | resources.libraries.python.topology.Topology
| Library | resources.libraries.python.LoadBalancerUtil
| Library | resources.libraries.python.NodePath
|
| Resource | resources/libraries/robot/shared/interfaces.robot
|
| Documentation | LoadBalancer suite keywords - configuration

*** Keywords ***
| Initialize loadbalancer maglev
| | [Documentation]
| | ... | Set UP state on VPP interfaces in path on nodes in 2-node
| | ... | circular topology. Get the interface MAC addresses and setup ARP on
| | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
| | ... | links.
| |
| | Set interfaces in path up
| |
| | ${fib_table}= | Set Variable | ${0}
| | Add Fib Table | ${dut1} | ${fib_table}
| | Assign Interface To Fib Table
| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${fib_table}
| | Assign Interface To Fib Table
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${fib_table}
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}1}[0] | 192.168.50.72 | 24
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}2}[0] | 192.168.60.73 | 24
| | Add Ip Neighbors
| | ... | ${dut1} | ${DUT1_${int}2}[0] | 192.168.60 | ${TG_pf2_mac}[0]
| | Vpp Route Add
| | ... | ${dut1} | 192.168.60.0 | 24 | interface=${DUT1_${int}2}[0]
| | Vpp Lb Conf
| | ... | ${dut1} | ip4_src_addr=192.168.60.73 | buckets_per_core=${128}
| | Vpp Lb Add Del Vip
| | ... | ${dut1} | vip_addr=90.1.2.1 | encap=${0} | new_len=${1024}
| | Add Lb As Addresses
| | ... | ${dut1} | 90.1.2.1 | 192.168.60

| Initialize loadbalancer l3dsr
| | [Documentation]
| | ... | Set UP state on VPP interfaces in path on nodes in 2-node
| | ... | circular topology. Get the interface MAC addresses and setup ARP on
| | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
| | ... | links.
| |
| | Set interfaces in path up
| |
| | ${fib_table}= | Set Variable | ${0}
| | Add Fib Table | ${dut1} | ${fib_table}
| | Assign Interface To Fib Table
| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${fib_table}
| | Assign Interface To Fib Table
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${fib_table}
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}1}[0] | 192.168.50.72 | 24
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}2}[0] | 192.168.60.73 | 24
| | Add Ip Neighbors
| | ... | ${dut1} | ${DUT1_${int}2}[0] | 192.168.60 | ${TG_pf2_mac}[0]
| | Vpp Route Add
| | ... | ${dut1} | 192.168.60.0 | 24 | interface=${DUT1_${int}2}[0]
| | Vpp Lb Conf
| | ... | ${dut1} | ip4_src_addr=192.168.60.73 | buckets_per_core=${128}
| | Vpp Lb Add Del Vip
| | ... | ${dut1} | vip_addr=90.1.2.1 | encap=${2} | dscp=${7} | new_len=${1024}
| | Add Lb As Addresses
| | ... | ${dut1} | 90.1.2.1 | 192.168.60

| Initialize loadbalancer nat4
| | [Documentation]
| | ... | Set UP state on VPP interfaces in path on nodes in 2-node
| | ... | circular topology. Get the interface MAC addresses and setup ARP on
| | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
| | ... | links.
| |
| | Set interfaces in path up
| |
| | ${fib_table}= | Set Variable | ${0}
| | Add Fib Table | ${dut1} | ${fib_table}
| | Assign Interface To Fib Table
| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${fib_table}
| | Assign Interface To Fib Table
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${fib_table}
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}1}[0] | 192.168.50.72 | 24
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}2}[0] | 192.168.60.73 | 24
| | Add Ip Neighbors
| | ... | ${dut1} | ${DUT1_${int}1}[0] | 192.168.50 | ${TG_pf1_mac}[0]
| | Add Ip Neighbors
| | ... | ${dut1} | ${DUT1_${int}2}[0] | 192.168.60 | ${TG_pf2_mac}[0]
| | Vpp Route Add
| | ... | ${dut1} | 192.168.50.0 | 24 | interface=${DUT1_${int}1}[0]
| | Vpp Route Add
| | ... | ${dut1} | 192.168.60.0 | 24 | interface=${DUT1_${int}2}[0]
| | Vpp Lb Conf
| | ... | ${dut1} | ip4_src_addr=192.168.60.73 | buckets_per_core=${128}
| | Vpp Lb Add Del Vip
| | ... | ${dut1} | vip_addr=90.1.2.1 | encap=${3}
| | ... | protocol=${17} | port=${20000} | target_port=${3307} | new_len=${1024}
| | Add Lb As Addresses
| | ... | ${dut1} | 90.1.2.1 | 192.168.60 | protocol=${17} | port=${20000}
| | Vpp Lb Add Del Intf Nat4
| | ... | ${dut1} | interface=${DUT1_${int}2}[0]

| Add Ip Neighbors
| | [Documentation] | Add IP neighbors to physical interface on DUT.
| |
| | ... | *Arguments:*
| | ... | - node - VPP node. Type: dictionary
| | ... | - interface - Interface key. Type: string
| | ... | - ip_addr - IP address of the interface. Type: string
| | ... | - mac_addr - MAC address of the interface. Type: string
| |
| | ... | *Example:*
| | ... | \| Add Ip Neighbors \| ${dut1} \| ${dut1_if1} \| 192.168.50 \
| | ... | \| ${tg_if1_mac}
| |
| | [Arguments] | ${node} | ${interface} | ${ip_addr} | ${mac_addr}
| |
| | FOR | ${number} | IN RANGE | 74 | 80
| | | VPP Add IP Neighbor
| | | ... | ${node} | ${interface} | ${ip_addr}.${number} | ${mac_addr}
| | END

| Add Lb As Addresses
| | [Documentation] | Add Lb As Addresses on Vpp node.
| |
| | ... | *Arguments:*
| | ... | - node - VPP node. Type: dictionary
| | ... | - vip_addr - IPv4 address to be used as source for IPv4 traffic.
| | ... | Type: string
| | ... | - as_addr - The application server address. Type: string
| | ... | - protocol - tcp or udp. Type: integer
| | ... | - port - destination port. Type: integer
| | ... | - is_del - 1 if the VIP should be removed otherwise 0. Type: integer
| | ... | - is_flush - 1 if the sessions related to this AS should be flushed
| | ... | otherwise 0. Type: integer
| |
| | ... | *Example:*
| | ... | \| Add Lb As Addresses \| ${dut1} \| 90.1.2.1 \| 192.168.60 \
| | ... | \| protocol=${17} \| port=${20000} \|
| |
| | [Arguments] | ${node} | ${vip_addr} | ${as_addr} | ${protocol}=${255}
| | ... | ${port}=${0} | ${is_del}=${0} | ${is_flush}=${0}
| |
| | FOR | ${number} | IN RANGE | 74 | 80
| | | VPP Lb Add Del As
| | | ... | ${node} | vip_addr=${vip_addr} | protocol=${protocol}
| | | ... | port=${port} | as_addr=${as_addr}.${number}
| | END