Skip to content

Commit 664aef8

Browse files
authored
Merge pull request #2 from Azure/master
Get latest changes
2 parents b6c1ea4 + b0bebd5 commit 664aef8

269 files changed

Lines changed: 21230 additions & 4150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azure-pipelines/run-test-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ steps:
2323
source: specific
2424
project: build
2525
pipeline: 1
26-
artifact: sonic-buildimage.kvm
26+
artifact: sonic-buildimage.vs
2727
runVersion: 'latestFromBranch'
2828
runBranch: 'refs/heads/master'
2929
displayName: "Download sonic kvm image"

ansible/config_sonic_basedon_testbed.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
- fail: msg="The DUT you are trying to run test does not belongs to this testbed"
4949
when: inventory_hostname not in testbed_facts['duts']
5050

51+
- name: Set default num_asic
52+
set_fact:
53+
num_asics: 1
54+
when: num_asics is not defined
55+
5156
- name: Set default dut index
5257
set_fact:
5358
dut_index: "{{ testbed_facts['duts_map'][inventory_hostname]|int }}"
@@ -62,15 +67,15 @@
6267
when: "testbed_facts['vm_base'] != ''"
6368
when: testbed_name is defined
6469

65-
- topo_facts: topo={{ topo }}
70+
- topo_facts: topo={{ topo }} hwsku={{ hwsku }}
6671
delegate_to: localhost
6772

6873
- name: find interface name mapping and individual interface speed if defined from dut
69-
port_alias: hwsku="{{ hwsku }}"
74+
port_alias: hwsku="{{ hwsku }}" num_asic="{{ num_asics }}"
7075
when: deploy is defined and deploy|bool == true
7176

7277
- name: find interface name mapping and individual interface speed if defined with local data
73-
port_alias: hwsku="{{ hwsku }}"
78+
port_alias: hwsku="{{ hwsku }}" num_asic="{{ num_asics }}"
7479
delegate_to: localhost
7580
when: deploy is not defined or deploy|bool == false
7681

@@ -100,10 +105,6 @@
100105
delegate_to: localhost
101106
when: "'dualtor' in topo"
102107

103-
- name: generate y_cable simulator driver
104-
include_tasks: dualtor/config_y_cable_simulator.yml
105-
when: "'dualtor' in topo"
106-
107108
- name: set default vm file path
108109
set_fact:
109110
vm_file: veos
@@ -126,6 +127,12 @@
126127
delegate_to: localhost
127128
when: "('host_interfaces_by_dut' in vm_topo_config) and ('tor' in vm_topo_config['dut_type'] | lower)"
128129

130+
- name: find downlink portchannel configuration for T0 topology
131+
set_fact:
132+
portchannel_config: "{{ vm_topo_config['DUT']['portchannel_config'] | default({})}}"
133+
delegate_to: localhost
134+
when: "('host_interfaces_by_dut' in vm_topo_config) and ('tor' in vm_topo_config['dut_type'] | lower)"
135+
129136
- name: find any tunnel configurations
130137
tunnel_config:
131138
vm_topo_config: "{{ vm_topo_config }}"
@@ -149,6 +156,15 @@
149156
- "{{ interface_to_vms }}"
150157
- "ports"
151158

159+
# create map of VM to asic interface names
160+
- name: find all interface asic names
161+
set_fact:
162+
vm_asic_ifnames: "{{ vm_asic_ifnames | default({}) | combine({item.0.name: vm_asic_ifnames[item.0.name]|default([]) + [ front_panel_asic_ifnames[item.1]] }) }}"
163+
with_subelements:
164+
- "{{ interface_to_vms }}"
165+
- "ports"
166+
when: front_panel_asic_ifnames != []
167+
152168
- name: create minigraph file in ansible minigraph folder
153169
template: src=templates/minigraph_template.j2
154170
dest=minigraph/{{ inventory_hostname}}.{{ topo }}.xml
@@ -352,6 +368,11 @@
352368

353369
- debug: msg={{ docker_status.stdout_lines }}
354370

371+
- name: start topology service for multi-asic platform
372+
become: true
373+
shell: systemctl start topology.service
374+
when: start_topo_service is defined and start_topo_service|bool == true
375+
355376
- name: execute cli "config load_minigraph -y" to apply new minigraph
356377
become: true
357378
shell: config load_minigraph -y
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import os
2+
import inspect
3+
import sys
4+
import imp
5+
6+
CONN_GRAPH_LOG = "/tmp/conn_graph_debug.txt"
7+
8+
def get_conn_graph_facts(hostnames):
9+
"""
10+
@summary: Load conn_graph_facts from conn_graph_facts.xml
11+
@param hostnames: A list of hostname
12+
@return: A dict, conn_graph_facts
13+
"""
14+
filename = inspect.getframeinfo(inspect.currentframe()).filename
15+
ansible_path = os.path.join(os.path.dirname(os.path.abspath(filename)), '../')
16+
if ansible_path not in sys.path:
17+
sys.path.append(ansible_path)
18+
19+
utils = imp.load_source('conn_graph_utils', os.path.join(ansible_path, 'library/conn_graph_facts.py'))
20+
utils.LAB_GRAPHFILE_PATH = os.path.join(ansible_path, utils.LAB_GRAPHFILE_PATH)
21+
utils.debug_fname = CONN_GRAPH_LOG
22+
23+
lab_graph = utils.find_graph(hostnames=hostnames, part=True)
24+
succeed, results = utils.build_results(lab_graph=lab_graph, hostnames=hostnames, ignore_error=True)
25+
if not succeed:
26+
print("Parse conn graph failes msg = {}".format(results))
27+
return {'device_pdu_info': {}, 'device_pdu_links': {}}
28+
return results

0 commit comments

Comments
 (0)