Merge #36 Adding a test for issue RHEL-13756
This commit is contained in:
commit
cfbd69719c
10 changed files with 610 additions and 0 deletions
121
Regression/set-src-ipv6/daemons-vnc
Normal file
121
Regression/set-src-ipv6/daemons-vnc
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
# This file tells the frr package which daemons to start.
|
||||
#
|
||||
# Sample configurations for these daemons can be found in
|
||||
# /usr/share/doc/frr/examples/.
|
||||
#
|
||||
# ATTENTION:
|
||||
#
|
||||
# When activating a daemon for the first time, a config file, even if it is
|
||||
# empty, has to be present *and* be owned by the user and group "frr", else
|
||||
# the daemon will not be started by /etc/init.d/frr. The permissions should
|
||||
# be u=rw,g=r,o=.
|
||||
# When using "vtysh" such a config file is also needed. It should be owned by
|
||||
# group "frrvty" and set to ug=rw,o= though. Check /etc/pam.d/frr, too.
|
||||
#
|
||||
# The watchfrr, zebra and staticd daemons are always started.
|
||||
#
|
||||
bgpd=yes
|
||||
ospfd=no
|
||||
ospf6d=no
|
||||
ripd=no
|
||||
ripngd=no
|
||||
isisd=no
|
||||
pimd=no
|
||||
pim6d=no
|
||||
nhrpd=no
|
||||
eigrpd=no
|
||||
sharpd=no
|
||||
pbrd=no
|
||||
bfdd=no
|
||||
fabricd=no
|
||||
vrrpd=no
|
||||
pathd=no
|
||||
|
||||
#
|
||||
# If this option is set the /etc/init.d/frr script automatically loads
|
||||
# the config via "vtysh -b" when the servers are started.
|
||||
# Check /etc/pam.d/frr if you intend to use "vtysh"!
|
||||
#
|
||||
vtysh_enable=yes
|
||||
zebra_options=" -A 127.0.0.1 -s 90000000"
|
||||
bgpd_options=" -A 127.0.0.1"
|
||||
ospfd_options=" -A 127.0.0.1"
|
||||
ospf6d_options=" -A ::1"
|
||||
ripd_options=" -A 127.0.0.1"
|
||||
ripngd_options=" -A ::1"
|
||||
isisd_options=" -A 127.0.0.1"
|
||||
pimd_options=" -A 127.0.0.1"
|
||||
pim6d_options=" -A ::1"
|
||||
nhrpd_options=" -A 127.0.0.1"
|
||||
eigrpd_options=" -A 127.0.0.1"
|
||||
sharpd_options=" -A 127.0.0.1"
|
||||
pbrd_options=" -A 127.0.0.1"
|
||||
staticd_options="-A 127.0.0.1"
|
||||
bfdd_options=" -A 127.0.0.1"
|
||||
fabricd_options="-A 127.0.0.1"
|
||||
vrrpd_options=" -A 127.0.0.1"
|
||||
pathd_options=" -A 127.0.0.1"
|
||||
|
||||
|
||||
# If you want to pass a common option to all daemons, you can use the
|
||||
# "frr_global_options" variable.
|
||||
#
|
||||
#frr_global_options=""
|
||||
|
||||
|
||||
# The list of daemons to watch is automatically generated by the init script.
|
||||
# This variable can be used to pass options to watchfrr that will be passed
|
||||
# prior to the daemon list.
|
||||
#
|
||||
# To make watchfrr create/join the specified netns, add the the "--netns"
|
||||
# option here. It will only have an effect in /etc/frr/<somename>/daemons, and
|
||||
# you need to start FRR with "/usr/lib/frr/frrinit.sh start <somename>".
|
||||
#
|
||||
watchfrr_options="--netns=vnc"
|
||||
|
||||
|
||||
# configuration profile
|
||||
#
|
||||
#frr_profile="traditional"
|
||||
#frr_profile="datacenter"
|
||||
|
||||
|
||||
# This is the maximum number of FD's that will be available. Upon startup this
|
||||
# is read by the control files and ulimit is called. Uncomment and use a
|
||||
# reasonable value for your setup if you are expecting a large number of peers
|
||||
# in say BGP.
|
||||
#
|
||||
#MAX_FDS=1024
|
||||
|
||||
# Uncomment this option if you want to run FRR as a non-root user. Note that
|
||||
# you should know what you are doing since most of the daemons need root
|
||||
# to work. This could be useful if you want to run FRR in a container
|
||||
# for instance.
|
||||
# FRR_NO_ROOT="yes"
|
||||
|
||||
# For any daemon, you can specify a "wrap" command to start instead of starting
|
||||
# the daemon directly. This will simply be prepended to the daemon invocation.
|
||||
# These variables have the form daemon_wrap, where 'daemon' is the name of the
|
||||
# daemon (the same pattern as the daemon_options variables).
|
||||
#
|
||||
# Note that when daemons are started, they are told to daemonize with the `-d`
|
||||
# option. This has several implications. For one, the init script expects that
|
||||
# when it invokes a daemon, the invocation returns immediately. If you add a
|
||||
# wrap command here, it must comply with this expectation and daemonize as
|
||||
# well, or the init script will never return. Furthermore, because daemons are
|
||||
# themselves daemonized with -d, you must ensure that your wrapper command is
|
||||
# capable of following child processes after a fork() if you need it to do so.
|
||||
#
|
||||
# If your desired wrapper does not support daemonization, you can wrap it with
|
||||
# a utility program that daemonizes programs, such as 'daemonize'. An example
|
||||
# of this might look like:
|
||||
#
|
||||
# bgpd_wrap="/usr/bin/daemonize /usr/bin/mywrapper"
|
||||
#
|
||||
# This is particularly useful for programs which record processes but lack
|
||||
# daemonization options, such as perf and rr.
|
||||
#
|
||||
# If you wish to wrap all daemons in the same way, you may set the "all_wrap"
|
||||
# variable.
|
||||
#
|
||||
#all_wrap=""
|
||||
121
Regression/set-src-ipv6/daemons-vns
Normal file
121
Regression/set-src-ipv6/daemons-vns
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
# This file tells the frr package which daemons to start.
|
||||
#
|
||||
# Sample configurations for these daemons can be found in
|
||||
# /usr/share/doc/frr/examples/.
|
||||
#
|
||||
# ATTENTION:
|
||||
#
|
||||
# When activating a daemon for the first time, a config file, even if it is
|
||||
# empty, has to be present *and* be owned by the user and group "frr", else
|
||||
# the daemon will not be started by /etc/init.d/frr. The permissions should
|
||||
# be u=rw,g=r,o=.
|
||||
# When using "vtysh" such a config file is also needed. It should be owned by
|
||||
# group "frrvty" and set to ug=rw,o= though. Check /etc/pam.d/frr, too.
|
||||
#
|
||||
# The watchfrr, zebra and staticd daemons are always started.
|
||||
#
|
||||
bgpd=yes
|
||||
ospfd=no
|
||||
ospf6d=no
|
||||
ripd=no
|
||||
ripngd=no
|
||||
isisd=no
|
||||
pimd=no
|
||||
pim6d=no
|
||||
nhrpd=no
|
||||
eigrpd=no
|
||||
sharpd=no
|
||||
pbrd=no
|
||||
bfdd=no
|
||||
fabricd=no
|
||||
vrrpd=no
|
||||
pathd=no
|
||||
|
||||
#
|
||||
# If this option is set the /etc/init.d/frr script automatically loads
|
||||
# the config via "vtysh -b" when the servers are started.
|
||||
# Check /etc/pam.d/frr if you intend to use "vtysh"!
|
||||
#
|
||||
vtysh_enable=yes
|
||||
zebra_options=" -A 127.0.0.1 -s 90000000"
|
||||
bgpd_options=" -A 127.0.0.1"
|
||||
ospfd_options=" -A 127.0.0.1"
|
||||
ospf6d_options=" -A ::1"
|
||||
ripd_options=" -A 127.0.0.1"
|
||||
ripngd_options=" -A ::1"
|
||||
isisd_options=" -A 127.0.0.1"
|
||||
pimd_options=" -A 127.0.0.1"
|
||||
pim6d_options=" -A ::1"
|
||||
nhrpd_options=" -A 127.0.0.1"
|
||||
eigrpd_options=" -A 127.0.0.1"
|
||||
sharpd_options=" -A 127.0.0.1"
|
||||
pbrd_options=" -A 127.0.0.1"
|
||||
staticd_options="-A 127.0.0.1"
|
||||
bfdd_options=" -A 127.0.0.1"
|
||||
fabricd_options="-A 127.0.0.1"
|
||||
vrrpd_options=" -A 127.0.0.1"
|
||||
pathd_options=" -A 127.0.0.1"
|
||||
|
||||
|
||||
# If you want to pass a common option to all daemons, you can use the
|
||||
# "frr_global_options" variable.
|
||||
#
|
||||
#frr_global_options=""
|
||||
|
||||
|
||||
# The list of daemons to watch is automatically generated by the init script.
|
||||
# This variable can be used to pass options to watchfrr that will be passed
|
||||
# prior to the daemon list.
|
||||
#
|
||||
# To make watchfrr create/join the specified netns, add the the "--netns"
|
||||
# option here. It will only have an effect in /etc/frr/<somename>/daemons, and
|
||||
# you need to start FRR with "/usr/lib/frr/frrinit.sh start <somename>".
|
||||
#
|
||||
watchfrr_options="--netns=vns"
|
||||
|
||||
|
||||
# configuration profile
|
||||
#
|
||||
#frr_profile="traditional"
|
||||
#frr_profile="datacenter"
|
||||
|
||||
|
||||
# This is the maximum number of FD's that will be available. Upon startup this
|
||||
# is read by the control files and ulimit is called. Uncomment and use a
|
||||
# reasonable value for your setup if you are expecting a large number of peers
|
||||
# in say BGP.
|
||||
#
|
||||
#MAX_FDS=1024
|
||||
|
||||
# Uncomment this option if you want to run FRR as a non-root user. Note that
|
||||
# you should know what you are doing since most of the daemons need root
|
||||
# to work. This could be useful if you want to run FRR in a container
|
||||
# for instance.
|
||||
# FRR_NO_ROOT="yes"
|
||||
|
||||
# For any daemon, you can specify a "wrap" command to start instead of starting
|
||||
# the daemon directly. This will simply be prepended to the daemon invocation.
|
||||
# These variables have the form daemon_wrap, where 'daemon' is the name of the
|
||||
# daemon (the same pattern as the daemon_options variables).
|
||||
#
|
||||
# Note that when daemons are started, they are told to daemonize with the `-d`
|
||||
# option. This has several implications. For one, the init script expects that
|
||||
# when it invokes a daemon, the invocation returns immediately. If you add a
|
||||
# wrap command here, it must comply with this expectation and daemonize as
|
||||
# well, or the init script will never return. Furthermore, because daemons are
|
||||
# themselves daemonized with -d, you must ensure that your wrapper command is
|
||||
# capable of following child processes after a fork() if you need it to do so.
|
||||
#
|
||||
# If your desired wrapper does not support daemonization, you can wrap it with
|
||||
# a utility program that daemonizes programs, such as 'daemonize'. An example
|
||||
# of this might look like:
|
||||
#
|
||||
# bgpd_wrap="/usr/bin/daemonize /usr/bin/mywrapper"
|
||||
#
|
||||
# This is particularly useful for programs which record processes but lack
|
||||
# daemonization options, such as perf and rr.
|
||||
#
|
||||
# If you wish to wrap all daemons in the same way, you may set the "all_wrap"
|
||||
# variable.
|
||||
#
|
||||
#all_wrap=""
|
||||
20
Regression/set-src-ipv6/frr-vnc.conf
Normal file
20
Regression/set-src-ipv6/frr-vnc.conf
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
hostname RouterVNC
|
||||
|
||||
log file <CLIENT_FRR_LOG> debugging
|
||||
! -*- bgp -*-
|
||||
!
|
||||
router bgp 65001
|
||||
no bgp ebgp-requires-policy
|
||||
neighbor <SERVER_IF_ADDR> remote-as external
|
||||
neighbor <SERVER_IF_ADDR> ebgp-multihop
|
||||
!
|
||||
address-family ipv6 unicast
|
||||
neighbor <SERVER_IF_ADDR> activate
|
||||
network <CLIENT_IF_IPV6_ADDR_1>/128
|
||||
network <CLIENT_IF_IPV6_ADDR_2>/128
|
||||
exit-address-family
|
||||
exit
|
||||
!
|
||||
!
|
||||
line vty
|
||||
!
|
||||
25
Regression/set-src-ipv6/frr-vnc.service
Normal file
25
Regression/set-src-ipv6/frr-vnc.service
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=FRRouting
|
||||
Documentation=https://frrouting.readthedocs.io/en/latest/setup.html
|
||||
Wants=network.target
|
||||
After=network-pre.target systemd-sysctl.service
|
||||
Before=network.target
|
||||
OnFailure=heartbeat-failed@%n.service
|
||||
|
||||
[Service]
|
||||
Nice=-5
|
||||
Type=forking
|
||||
NotifyAccess=all
|
||||
StartLimitInterval=3m
|
||||
StartLimitBurst=3
|
||||
TimeoutSec=2m
|
||||
WatchdogSec=60s
|
||||
RestartSec=5
|
||||
Restart=on-abnormal
|
||||
LimitNOFILE=1024
|
||||
ExecStart=/sbin/ip netns exec vnc /usr/libexec/frr/frrinit.sh start vnc
|
||||
ExecStop=/sbin/ip netns exec vnc /usr/libexec/frr/frrinit.sh stop vnc
|
||||
ExecReload=/sbin/ip netns exec vnc /usr/libexec/frr/frrinit.sh reload vnc
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
49
Regression/set-src-ipv6/frr-vns.conf
Normal file
49
Regression/set-src-ipv6/frr-vns.conf
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
frr defaults traditional
|
||||
hostname RouterVNS
|
||||
!
|
||||
log file <SERVER_FRR_LOG> debugging
|
||||
no ip forwarding
|
||||
no ipv6 forwarding
|
||||
!
|
||||
debug bgp neighbor-events
|
||||
debug bgp updates in
|
||||
debug bgp updates out
|
||||
debug bgp zebra
|
||||
!
|
||||
debug route-map
|
||||
!
|
||||
!
|
||||
!
|
||||
!
|
||||
router bgp 65000
|
||||
no bgp ebgp-requires-policy
|
||||
neighbor <CLIENT_IF_ADDR> remote-as external
|
||||
neighbor <CLIENT_IF_ADDR> ebgp-multihop
|
||||
!
|
||||
address-family ipv6 unicast
|
||||
neighbor <CLIENT_IF_ADDR> activate
|
||||
exit-address-family
|
||||
exit
|
||||
!
|
||||
ipv6 prefix-list prefix-list-for-datasync seq 5 permit fd00:268:70fd:1001::/64 le 128
|
||||
ipv6 prefix-list prefix-list-for-internal seq 15 permit fd00:268:70fd:1000::/64 le 128
|
||||
ipv6 prefix-list prefix-list-for-internal seq 20 permit ::/0
|
||||
!
|
||||
route-map set_src_lo permit 5
|
||||
match ipv6 address prefix-list prefix-list-for-datasync
|
||||
set src <SERVER_IF_IPV6_ADDR_2>
|
||||
exit
|
||||
!
|
||||
route-map set_src_lo permit 10
|
||||
match ipv6 address prefix-list prefix-list-for-internal
|
||||
set src <SERVER_IF_IPV6_ADDR_1>
|
||||
exit
|
||||
!
|
||||
route-map set_src_lo permit 20
|
||||
exit
|
||||
!
|
||||
ipv6 protocol bgp route-map set_src_lo
|
||||
!
|
||||
line vty
|
||||
!
|
||||
!
|
||||
25
Regression/set-src-ipv6/frr-vns.service
Normal file
25
Regression/set-src-ipv6/frr-vns.service
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=FRRouting
|
||||
Documentation=https://frrouting.readthedocs.io/en/latest/setup.html
|
||||
Wants=network.target
|
||||
After=network-pre.target systemd-sysctl.service
|
||||
Before=network.target
|
||||
OnFailure=heartbeat-failed@%n.service
|
||||
|
||||
[Service]
|
||||
Nice=-5
|
||||
Type=forking
|
||||
NotifyAccess=all
|
||||
StartLimitInterval=3m
|
||||
StartLimitBurst=3
|
||||
TimeoutSec=2m
|
||||
WatchdogSec=60s
|
||||
RestartSec=5
|
||||
Restart=on-abnormal
|
||||
LimitNOFILE=1024
|
||||
ExecStart=/sbin/ip netns exec vns /usr/libexec/frr/frrinit.sh start vns
|
||||
ExecStop=/sbin/ip netns exec vns /usr/libexec/frr/frrinit.sh stop vns
|
||||
ExecReload=/sbin/ip netns exec vns /usr/libexec/frr/frrinit.sh reload vns
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
22
Regression/set-src-ipv6/main.fmf
Normal file
22
Regression/set-src-ipv6/main.fmf
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
summary: Testing the set src clause capability for IPv6 route-map
|
||||
description: 'Tests whether different set src clauses in one IPv6 route-map command work correctly'
|
||||
contact: František Hrdina <fhrdina@redhat.com>
|
||||
component:
|
||||
- frr
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- frr
|
||||
- tcpdump
|
||||
duration: 5m
|
||||
enabled: true
|
||||
tag:
|
||||
- Acceptance
|
||||
link:
|
||||
- verifies: https://issues.redhat.com/browse/RHEL-13756
|
||||
environment:
|
||||
AVC_ERROR: +no_avc_check
|
||||
adjust:
|
||||
- enabled: false
|
||||
when: distro < rhel-8.10
|
||||
continue: false
|
||||
225
Regression/set-src-ipv6/runtest.sh
Executable file
225
Regression/set-src-ipv6/runtest.sh
Executable file
|
|
@ -0,0 +1,225 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of
|
||||
# Description: Test that frr correctly changes inbound route filter after a config reload
|
||||
# Author: Michal Ruprich <mruprich@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="frr"
|
||||
|
||||
vnSIDE='server'
|
||||
vnSERVER_IFACE='VNS'
|
||||
vnCLIENT_IFACE='VNC'
|
||||
vnSERVER_NAMESPACE='vns'
|
||||
vnCLIENT_NAMESPACE='vnc'
|
||||
|
||||
SERVER_IF_ADDR="192.168.222.240"
|
||||
SERVER_IF_PREFIX="31"
|
||||
SERVER_IF_BCAST="255.255.255.255"
|
||||
|
||||
SERVER_IF_IPV6_ADDR_1="fd00:268:70fd:1000::3:e003"
|
||||
SERVER_IF_IPV6_ADDR_2="fd00:268:70fd:1001::3:e003"
|
||||
|
||||
SERVER_FRR_LOG="/var/log/frr/frr-r1.log"
|
||||
SERVER_CONF_DIR="/etc/frr/vns/"
|
||||
|
||||
CLIENT_IF_ADDR="192.168.222.241"
|
||||
CLIENT_IF_PREFIX="31"
|
||||
CLIENT_IF_BCAST="255.255.255.255"
|
||||
|
||||
CLIENT_IF_IPV6_ADDR_1="fd00:268:70fd:1000::3:e001"
|
||||
CLIENT_IF_IPV6_ADDR_2="fd00:268:70fd:1001::3:e001"
|
||||
|
||||
CLIENT_FRR_LOG="/var/log/frr/frr-r2.log"
|
||||
CLIENT_CONF_DIR="/etc/frr/vnc/"
|
||||
|
||||
MAIN_LOG="/tmp/log_routes"
|
||||
|
||||
#These functions help with setting up the network namespaces
|
||||
vnCreateServerClientNetwork()
|
||||
{
|
||||
rlRun "ip link add ${vnSERVER_IFACE} type veth peer name ${vnCLIENT_IFACE}" 0 "Creating network ifaces for SERVER: '${vnSERVER_IFACE}' and CLIENT: '${vnCLIENT_IFACE}'."
|
||||
|
||||
rlRun "ip netns add ${vnSERVER_NAMESPACE}" 0 "Creating SERVER namespace: '${vnSERVER_NAMESPACE}'."
|
||||
rlRun "ip netns add ${vnCLIENT_NAMESPACE}" 0 "Creating CLIENT namespace: '${vnCLIENT_NAMESPACE}'."
|
||||
|
||||
rlRun "ip link set ${vnSERVER_IFACE} netns ${vnSERVER_NAMESPACE}" 0 "Adding iface: '${vnSERVER_IFACE}' into the namespace: '${vnSERVER_NAMESPACE}'."
|
||||
rlRun "ip link set ${vnCLIENT_IFACE} netns ${vnCLIENT_NAMESPACE}" 0 "Adding iface: '${vnCLIENT_IFACE}' into the namespace: '${vnCLIENT_NAMESPACE}'."
|
||||
}
|
||||
|
||||
vnRemoveServerClientNetwork()
|
||||
{
|
||||
rlRun "ip netns exec ${vnSERVER_NAMESPACE} ip link del ${vnSERVER_IFACE}" 0 "Removing network for SERVER and CLIENT."
|
||||
|
||||
rlRun "ip netns del ${vnSERVER_NAMESPACE}" 0 "Removing SERVER namespace: '${vnSERVER_NAMESPACE}'."
|
||||
rlRun "ip netns del ${vnCLIENT_NAMESPACE}" 0 "Removing CLIENT namespace: '${vnCLIENT_NAMESPACE}'."
|
||||
}
|
||||
|
||||
vnRunServer()
|
||||
{
|
||||
local command="$1"
|
||||
local ret_val="${2:-0}"
|
||||
local message="${3:-Running command on the SERVER: '${command}'}"
|
||||
|
||||
rlRun "ip netns exec ${vnSERVER_NAMESPACE} ${command}" "$ret_val" "$message"
|
||||
}
|
||||
|
||||
vnRunClient()
|
||||
{
|
||||
local command="$1"
|
||||
local ret_val="${2:-0}"
|
||||
local message="${3:-Running command on the CLIENT: '${command}'}"
|
||||
|
||||
rlRun "ip netns exec ${vnCLIENT_NAMESPACE} ${command}" "$ret_val" "$message"
|
||||
}
|
||||
|
||||
vnRun()
|
||||
{
|
||||
if [ "$vnSIDE" = 'server' ]; then
|
||||
vnRunServer "$1" "$2" "$3"
|
||||
elif [ "$vnSIDE" = 'client' ]; then
|
||||
vnRunClient "$1" "$2" "$3"
|
||||
else
|
||||
rlLogError "'vnSIDE' variable is not set properly."
|
||||
fi
|
||||
}
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
|
||||
# Need to disable SeLinux, because it does not allow to start service via unit file
|
||||
# in a network namespace using "ip netns exec". And there are other issues with pid files, log files, etc.
|
||||
rlRun "setenforce 0" 0 "Disabling SELinux"
|
||||
rlRun "ORIG_AVC_ERROR=${AVC_ERROR}"
|
||||
rlRun "AVC_ERROR=+no_avc_check"
|
||||
|
||||
# set up the network, we want a specific IPv4 address for neighbor communication and two IPv6 addresses
|
||||
# for the set src part of the configuration
|
||||
vnCreateServerClientNetwork
|
||||
vnRunServer "ip link set ${vnSERVER_IFACE} up" 0 "Setting the SERVER side of veth UP"
|
||||
vnRunServer "ip link set lo up" 0 "Setting the SERVER side loopback UP"
|
||||
vnRunClient "ip link set ${vnCLIENT_IFACE} up" 0 "Setting the CLIENT side of veth UP"
|
||||
vnRunClient "ip link set lo up" 0 "Setting the CLIENT side loopback UP"
|
||||
|
||||
vnRunServer "ip addr add ${SERVER_IF_ADDR}/${SERVER_IF_PREFIX} broadcast ${SERVER_IF_BCAST} dev ${vnSERVER_IFACE}" 0 "Configuring IPv4 address on SERVER side of veth"
|
||||
vnRunServer "ip addr add ${SERVER_IF_IPV6_ADDR_1}/128 dev ${vnSERVER_IFACE}" 0 "Configuring IPv6 address on SERVER side of veth"
|
||||
vnRunServer "ip addr add ${SERVER_IF_IPV6_ADDR_2}/128 dev ${vnSERVER_IFACE}" 0 "Configuring IPv6 address on SERVER side of veth"
|
||||
|
||||
vnRunClient "ip addr add ${CLIENT_IF_ADDR}/${CLIENT_IF_PREFIX} broadcast ${CLIENT_IF_BCAST} dev ${vnCLIENT_IFACE}" 0 "Configuring IPv4 address on CLIENT side of veth"
|
||||
vnRunClient "ip addr add ${CLIENT_IF_IPV6_ADDR_1}/128 dev ${vnCLIENT_IFACE}" 0 "Configuring IPv4 address on CLIENT side of veth"
|
||||
vnRunClient "ip addr add ${CLIENT_IF_IPV6_ADDR_2}/128 dev ${vnCLIENT_IFACE}" 0 "Configuring IPv4 address on CLIENT side of veth"
|
||||
rlRun "ip a"
|
||||
vnRunClient "ip a"
|
||||
vnRunServer "ip a"
|
||||
|
||||
rlFileBackup --clean "/etc/frr/"
|
||||
rlFileBackup --clean "/etc/systemd/system/"
|
||||
rlFileBackup --clean "/var/log/frr/"
|
||||
rlFileBackup --clean "/var/log/audit/audit.log"
|
||||
rlRun "mkdir /etc/frr/{vns,vnc}"
|
||||
#vtysh.conf and frr.conf are in /etc/frr/vns for the server namespace
|
||||
rlRun "cp -f vtysh-vns.conf ${SERVER_CONF_DIR}vtysh.conf" 0 "Copying vtysh configuration for the SERVER"
|
||||
rlRun "cp -f frr-vns.conf ${SERVER_CONF_DIR}frr.conf" 0 "Copying frr configuration for the SERVER"
|
||||
|
||||
#vtysh.conf and frr.conf are in /etc/frr/vnc for the client namespace
|
||||
rlRun "cp -f vtysh-vnc.conf ${CLIENT_CONF_DIR}vtysh.conf" 0 "Copying vtysh configuration for the CLIENT"
|
||||
rlRun "cp -f frr-vnc.conf ${CLIENT_CONF_DIR}frr.conf" 0 "Copying frr configuration for the CLIENT"
|
||||
|
||||
#I need separate daemons files as well for watchfrr options
|
||||
rlRun "cp -f daemons-vns ${SERVER_CONF_DIR}daemons" 0 "Copying daemons file for the SERVER"
|
||||
rlRun "cp -f daemons-vnc ${CLIENT_CONF_DIR}daemons" 0 "Copying daemons file for the CLIENT"
|
||||
|
||||
rlRun "ls -lR /etc/frr/*"
|
||||
rlRun "cp -f frr-vn{s,c}.service /etc/systemd/system/" 0 "Copying custom unit files to run frr in network namespaces"
|
||||
|
||||
# /etc/frr/vns/frr.conf
|
||||
rlRun "sed -i 's|<SERVER_FRR_LOG>|${SERVER_FRR_LOG}|g' ${SERVER_CONF_DIR}frr.conf"
|
||||
rlRun "sed -i 's|<SERVER_IF_ADDR>|${SERVER_IF_ADDR}|g' ${SERVER_CONF_DIR}frr.conf"
|
||||
rlRun "sed -i 's|<CLIENT_IF_ADDR>|${CLIENT_IF_ADDR}|g' ${SERVER_CONF_DIR}frr.conf"
|
||||
rlRun "sed -i 's|<SERVER_IF_IPV6_ADDR_1>|${SERVER_IF_IPV6_ADDR_1}|g' ${SERVER_CONF_DIR}frr.conf"
|
||||
rlRun "sed -i 's|<SERVER_IF_IPV6_ADDR_2>|${SERVER_IF_IPV6_ADDR_2}|g' ${SERVER_CONF_DIR}frr.conf"
|
||||
rlRun "cat ${SERVER_CONF_DIR}frr.conf"
|
||||
|
||||
# /etc/frr/vnc/frr.conf
|
||||
rlRun "sed -i 's|<CLIENT_FRR_LOG>|${CLIENT_FRR_LOG}|g' ${CLIENT_CONF_DIR}frr.conf"
|
||||
rlRun "sed -i 's|<SERVER_IF_ADDR>|${SERVER_IF_ADDR}|g' ${CLIENT_CONF_DIR}frr.conf"
|
||||
rlRun "sed -i 's|<CLIENT_IF_ADDR>|${CLIENT_IF_ADDR}|g' ${CLIENT_CONF_DIR}frr.conf"
|
||||
rlRun "sed -i 's|<CLIENT_IF_IPV6_ADDR_1>|${CLIENT_IF_IPV6_ADDR_1}|g' ${CLIENT_CONF_DIR}frr.conf"
|
||||
rlRun "sed -i 's|<CLIENT_IF_IPV6_ADDR_2>|${CLIENT_IF_IPV6_ADDR_2}|g' ${CLIENT_CONF_DIR}frr.conf"
|
||||
rlRun "cat ${CLIENT_CONF_DIR}frr.conf"
|
||||
|
||||
rlRun "systemctl daemon-reload"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "systemctl start frr-vns.service" 0 "Starting FRR on SERVER side"
|
||||
rlRun "systemctl start frr-vnc.service" 0 "Starting FRR on CLIENT side"
|
||||
|
||||
#vtysh also needs to run for a specific namespace
|
||||
rlRun "vtysh -N vns -c 'sh run'"
|
||||
rlRun "vtysh -N vnc -c 'sh run'"
|
||||
|
||||
vnRunServer "ping -c 1 ${CLIENT_IF_ADDR}" 0 "Testing that server can ping client IP"
|
||||
vnRunClient "ping -c 1 ${SERVER_IF_ADDR}" 0 "Testing that client can ping server IP"
|
||||
|
||||
rlRun "sleep 30" 0 "Waiting for BGP peers to exchange routes and converge"
|
||||
|
||||
#First let's see that the neighborship is established
|
||||
rlRun "vtysh -N vns -c 'show ip bgp nei' | grep \"BGP neighbor is ${CLIENT_IF_ADDR}\"" 0 "Show BGP neighborship on SERVER"
|
||||
rlRun "vtysh -N vns -c 'show ip bgp nei' | grep \"BGP state = Established\"" 0 "BGP neighborship on SERVER is Established"
|
||||
rlRun "vtysh -N vnc -c 'show ip bgp nei' | grep \"BGP neighbor is ${SERVER_IF_ADDR}\"" 0 "Show BGP neighborship on CLIENT"
|
||||
rlRun "vtysh -N vnc -c 'show ip bgp nei' | grep \"BGP state = Established\"" 0 "GP neighborship on CLIENT is Established"
|
||||
|
||||
#Both CLIENT IPv6 addresses should have been propagated to the SERVER
|
||||
rlRun -s "vtysh -N vns -c 'show ipv6 route'"
|
||||
rlRun -s "vtysh -N vns -c 'show ipv6 route' | grep \"B>\* ${CLIENT_IF_IPV6_ADDR_1}\"" 0 "Show routes on SERVER"
|
||||
rlRun -s "vtysh -N vns -c 'show ipv6 route' | grep \"B>\* ${CLIENT_IF_IPV6_ADDR_2}\"" 0 "Show routes on SERVER"
|
||||
|
||||
# route to client should have a proper src set
|
||||
vnRunServer "ip -6 route" &> ${MAIN_LOG}
|
||||
|
||||
rlRun "grep \"${CLIENT_IF_IPV6_ADDR_1}.*bgp src ${SERVER_IF_IPV6_ADDR_1}\" ${MAIN_LOG}"
|
||||
rlRun "grep \"${CLIENT_IF_IPV6_ADDR_2}.*bgp src ${SERVER_IF_IPV6_ADDR_2}\" ${MAIN_LOG}"
|
||||
cat ${MAIN_LOG}
|
||||
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "systemctl stop frr-vns.service frr-vnc.service" 0 "Stopping FRR"
|
||||
|
||||
vnRemoveServerClientNetwork
|
||||
|
||||
rlFileRestore
|
||||
rlRun "systemctl daemon-reload"
|
||||
|
||||
# restoring SELinux
|
||||
rlRun "setenforce 1" 0 "re-Enabling SELinux"
|
||||
rlRun "AVC_ERROR=${ORIG_AVC_ERROR}"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
1
Regression/set-src-ipv6/vtysh-vnc.conf
Normal file
1
Regression/set-src-ipv6/vtysh-vnc.conf
Normal file
|
|
@ -0,0 +1 @@
|
|||
service integrated-vtysh-config
|
||||
1
Regression/set-src-ipv6/vtysh-vns.conf
Normal file
1
Regression/set-src-ipv6/vtysh-vns.conf
Normal file
|
|
@ -0,0 +1 @@
|
|||
service integrated-vtysh-config
|
||||
Loading…
Add table
Add a link
Reference in a new issue