Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ansible/config_sonic_basedon_testbed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
- name: gather hwsku for LeafRouter that supports dualtor deployment
set_fact:
hwsku_list_dualtor_t1: "['ACS-MSN4600C', 'Arista-7260CX3-C64']"

- name: enable tunnel_qos_remap for T1 in dualtor deployment
set_fact:
enable_tunnel_qos_remap: true
Expand Down Expand Up @@ -527,6 +527,14 @@
timeout: 600
changed_when: false

- name: config static route for trex traffic passthrough
become: true
command: "{{ item }}"
with_items:
- config route add prefix 48.0.0.0/8 nexthop 10.0.0.59
- config route add prefix 16.0.0.0/8 nexthop 10.0.0.57
when: topo == "wan-3link-tg"

- name: execute cli "config bgp startup all" to bring up all bgp sessions for test
become: true
shell: config bgp startup all
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/eos/tasks/ceos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@
- 2
- 3
- 4

- name: enable ip_forwarding in ceos container
command: docker exec ceos_{{ vm_set_name }}_{{ inventory_hostname }} bash -c "sysctl net.ipv4.ip_forward=1"
when: topo == "wan-3link-tg"
delegate_to: localhost
134 changes: 134 additions & 0 deletions ansible/roles/eos/templates/wan-3link-tg-core.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{% set host = configuration[hostname] %}
{% set mgmt_ip = ansible_host %}
{% if vm_type is defined and vm_type == "ceos" %}
{% set mgmt_if_index = 0 %}
{% else %}
{% set mgmt_if_index = 1 %}
{% endif %}
no schedule tech-support
!
{% if vm_type is defined and vm_type == "ceos" %}
agent LicenseManager shutdown
agent PowerFuse shutdown
agent PowerManager shutdown
agent Thermostat shutdown
agent LedPolicy shutdown
agent StandbyCpld shutdown
agent Bfd shutdown
{% endif %}
!
hostname {{ hostname }}
!
vrf definition MGMT
rd 1:1
!
spanning-tree mode mstp
!
aaa root secret 0 123456
!
username admin privilege 15 role network-admin secret 0 123456
!
clock timezone UTC
!
lldp run
lldp management-address Management{{ mgmt_if_index }}
lldp management-address vrf MGMT
!
snmp-server community {{ snmp_rocommunity }} ro
snmp-server vrf MGMT
!
ip routing
ip routing vrf MGMT
ipv6 unicast-routing
!
{% if vm_mgmt_gw is defined %}
ip route vrf MGMT 0.0.0.0/0 {{ vm_mgmt_gw }}
{% else %}
ip route vrf MGMT 0.0.0.0/0 {{ mgmt_gw }}
{% endif %}
!
interface Management {{ mgmt_if_index }}
description TO LAB MGMT SWITCH
{% if vm_type is defined and vm_type == "ceos" %}
vrf MGMT
{% else %}
vrf forwarding MGMT
{% endif %}
ip address {{ mgmt_ip }}/{{ mgmt_prefixlen }}
no shutdown
!
{% for name, iface in host['interfaces'].items() %}
interface {{ name }}
{% if name.startswith('Loopback') %}
description LOOPBACK
{% else %}
mtu 9214
no switchport
no shutdown
{% endif %}
{% if name.startswith('Port-Channel') %}
port-channel min-links 1
{% endif %}
{% if iface['lacp'] is defined %}
channel-group {{ iface['lacp'] }} mode active
lacp rate normal
{% endif %}
{% if iface['ipv4'] is defined %}
ip address {{ iface['ipv4'] }}
{% endif %}
{% if iface['ipv6'] is defined %}
ipv6 enable
ipv6 address {{ iface['ipv6'] }}
ipv6 nd ra suppress
{% endif %}
no shutdown
!
{% endfor %}
!
{% if hostname == "ARISTA01T1" %}
interface Ethernet4
mtu 9214
no switchport
ip address 202.1.1.3/24
!
ip route 48.0.0.0/8 10.0.0.56
ip route 16.0.0.0/8 202.1.1.2
{% else %}
interface Ethernet4
mtu 9214
no switchport
ip address 202.2.1.3/24
!
ip route 48.0.0.0/8 202.2.1.2
ip route 16.0.0.0/8 10.0.0.58
{% endif %}
!
interface {{ bp_ifname }}
description backplane
no switchport
no shutdown
{% if host['bp_interface']['ipv4'] is defined %}
ip address {{ host['bp_interface']['ipv4'] }}
{% endif %}
{% if host['bp_interface']['ipv6'] is defined %}
ipv6 enable
ipv6 address {{ host['bp_interface']['ipv6'] }}
ipv6 nd ra suppress
{% endif %}
no shutdown
!
{% for name, iface in host['interfaces'].items() if name.startswith('Loopback') %}
{% if iface['ipv4'] is defined %}
network {{ iface['ipv4'] }}
{% endif %}
{% if iface['ipv6'] is defined %}
network {{ iface['ipv6'] }}
{% endif %}
{% endfor %}
!
management api http-commands
no protocol https
protocol http
no shutdown
!
end
1 change: 1 addition & 0 deletions ansible/roles/vm_set/library/vm_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ def bind_ovs_ports(self, br_name, dut_iface, injected_iface, vm_iface, disconnec
VMTopology.cmd("ovs-ofctl add-flow %s table=0,priority=8,icmp,in_port=%s,action=output:%s,%s" % (br_name, dut_iface_id, vm_iface_id, injected_iface_id))
VMTopology.cmd("ovs-ofctl add-flow %s table=0,priority=8,icmp6,in_port=%s,action=output:%s,%s" % (br_name, dut_iface_id, vm_iface_id, injected_iface_id))
VMTopology.cmd("ovs-ofctl add-flow %s table=0,priority=8,udp,in_port=%s,udp_src=161,action=output:%s,%s" % (br_name, dut_iface_id, vm_iface_id, injected_iface_id))
VMTopology.cmd("ovs-ofctl add-flow %s table=0,priority=8,udp,in_port=%s,udp_src=53,action=output:%s" % (br_name, dut_iface_id, vm_iface_id))
VMTopology.cmd("ovs-ofctl add-flow %s table=0,priority=8,udp6,in_port=%s,udp_src=161,action=output:%s,%s" % (br_name, dut_iface_id, vm_iface_id, injected_iface_id))
VMTopology.cmd("ovs-ofctl add-flow %s table=0,priority=5,ip,in_port=%s,action=output:%s" % (br_name, dut_iface_id, injected_iface_id))
VMTopology.cmd("ovs-ofctl add-flow %s table=0,priority=5,ipv6,in_port=%s,action=output:%s" % (br_name, dut_iface_id, injected_iface_id))
Expand Down
7 changes: 7 additions & 0 deletions ansible/testbed_add_vm_topology.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,10 @@
- { role: eos, when: topology.VMs is defined and VM_targets is defined and inventory_hostname in VM_targets and (vm_type == "veos" or vm_type == "ceos" ) } # If the vm_type is eos based, role eos will be executed in any case, and when will evaluate with every task
- { role: sonic, when: topology.VMs is defined and VM_targets is defined and inventory_hostname in VM_targets and (vm_type == "vsonic" ) } # If the vm_type is sonic based, role sonic will be executed in any case, and when will evaluate with every task
- { role: cisco, when: topology.VMs is defined and VM_targets is defined and inventory_hostname in VM_targets and (vm_type == "vcisco" ) } # If the vm_type is cisco based, role cisco will be executed in any case, and when will evaluate with every task

- hosts: servers:&vm_host
gather_facts: no
tasks:
- name: Integrated traffic generator
include_tasks: testbed_integrate_traffic_generator.yml
when: topo == "wan-3link-tg"
83 changes: 83 additions & 0 deletions ansible/testbed_integrate_traffic_generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

- name: Start Trex traffic generator container
block:
- name: Pull trex image
command: docker pull trexcisco/trex
become: yes

- name: Stop existence trex container
command: "{{ item }}"
with_items:
- docker stop trex
- docker rm trex
become: yes
ignore_errors: true

- name: Start trex traffic generator container
command: docker run --name trex -it -d --privileged --cap-add=ALL trexcisco/trex
become: yes

- name: Untar trex client
command: docker exec trex bash -c "cd /var/trex/v2.41/ ; tar zxf trex_client_v2.41.tar.gz"
become: yes

- name: Prepare trex runtime files
command: "{{ item }}"
with_items:
- docker exec trex bash -c "cd /var/trex/v2.41/ ; tar zxf trex_client_v2.41.tar.gz"
- docker cp {{inventory_dir}}/../tests/wan/trex/imix.py trex:/var/trex/v2.41/trex_client/stl/profiles/
- docker cp {{inventory_dir}}/../tests/wan/trex/trex_cfg.yaml trex:/etc/
- docker cp {{inventory_dir}}/../tests/wan/trex/stl_path.py trex:/var/trex/v2.41/trex_client/stl/examples
- docker cp {{inventory_dir}}/../tests/wan/trex/stl_imix.py trex:/var/trex/v2.41/trex_client/stl/examples
delegate_to: localhost
become: yes

- name: Remove VM interface from ovs bridge
command: "{{ item }}"
with_items:
- ovs-vsctl del-port br-VM0100-3 VM0100-t3
- ovs-vsctl del-port br-VM0101-3 VM0101-t3
ignore_errors: yes
become: yes

- name: Remove trex bridge
command: "{{ item }}"
with_items:
- ifconfig trex-in down
- ifconfig trex-out down
- brctl delbr trex-in
- brctl delbr trex-out
ignore_errors: yes
become: yes

- name: Create trex network
command: "{{ item }}"
with_items:
- brctl addbr trex-in
- ifconfig trex-in up
- brctl addbr trex-out
- ifconfig trex-out up
- ip link add trex-intf-1 type veth peer trex-intf-br-1
- ip link add trex-intf-2 type veth peer trex-intf-br-2
- ifconfig trex-intf-br-1 up
- ifconfig trex-intf-br-2 up
- brctl addif trex-in trex-intf-br-1
- brctl addif trex-in VM0100-t3
- brctl addif trex-out trex-intf-br-2
- brctl addif trex-out VM0101-t3
ignore_errors: yes
become: yes

- name: Add interface to Trex container
shell: |
docker inspect trex|grep -w "Pid"| awk '{print $2}'|rev|cut -c2-|rev|xargs ip link set trex-intf-1 netns
docker inspect trex|grep -w "Pid"| awk '{print $2}'|rev|cut -c2-|rev|xargs ip link set trex-intf-2 netns
docker exec trex bash -c "ifconfig trex-intf-1 202.1.1.2/24 up"
docker exec trex bash -c "ifconfig trex-intf-2 202.2.1.2/24 up"
ignore_errors: yes
become: yes


- name: Start Trex traffic generator server
command: docker exec trex bash -c "cd /var/trex/v2.41/ ; ./t-rex-64 -i >/dev/null &"
become: yes
89 changes: 89 additions & 0 deletions ansible/vars/topo_wan-3link-tg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
topology:
topo_type: wan
VMs:
ARISTA01T1:
vlans:
- 0
- 1
- 2
vm_offset: 0
ARISTA02T1:
vlans:
- 10
- 11
- 12
vm_offset: 1
DUT:
loopback:
ipv4:
- 10.1.0.32/32
ipv6:
- FC00:1::32/128
wan_dut_configuration:
WANDUT01:
interfaces:
PortChannel101:
intfs: [0, 1, 2]
ipv4: 10.0.0.56/31
ipv6: FC00::71/126
PortChannel102:
intfs: [10, 11, 12]
ipv4: 10.0.0.58/31
ipv6: FC00::75/126
dut_offset: 0
configuration_properties:
common:
dut_asn: 65100
dut_type: Router
swrole: core
configuration:
ARISTA01T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.56
- FC00::71
interfaces:
Loopback0:
ipv4: 100.1.0.29/32
ipv6: 2064:100::1d/128
Ethernet1:
lacp: 1
Ethernet2:
lacp: 1
Ethernet3:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.57/31
ipv6: fc00::72/126
bp_interface:
ipv4: 10.10.246.29/24
ipv6: fc0a::1d/64
ARISTA02T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.58
- FC00::75
interfaces:
Loopback0:
ipv4: 100.1.0.30/32
ipv6: 2064:100::1e/128
Ethernet1:
lacp: 1
Ethernet2:
lacp: 1
Ethernet3:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.59/31
ipv6: fc00::76/126
bp_interface:
ipv4: 10.10.246.30/24
ipv6: fc0a::1e/64
1 change: 1 addition & 0 deletions ansible/veos_vtb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ all:
- wan-4link
- wan-pub-cisco
- wan-2dut
- wan-3link-tg
children:
server_1:
lab:
Expand Down
15 changes: 15 additions & 0 deletions ansible/vtestbed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,18 @@
inv_name: veos_vtb
auto_recover: 'False'
comment: Tests virtual switch vm

- conf-name: vms-kvm-wan-3link-tg
group-name: vms6-1
topo: wan-3link-tg
ptf_image_name: docker-ptf
ptf: ptf-01
ptf_ip: 10.250.0.102/24
ptf_ipv6: fec0::ffff:afa:2/64
server: server_1
vm_base: VM0100
dut:
- vlab-01
inv_name: veos_vtb
auto_recover: 'False'
comment: Tests virtual switch vm
Loading