Skip to content
Closed
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
4 changes: 2 additions & 2 deletions dockers/docker-orchagent/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

mkdir -p /etc/swss/config.d/

sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/ipinip.json.j2 > /etc/swss/config.d/ipinip.json
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/mirror.json.j2 > /etc/swss/config.d/mirror.json
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/ipinip.json.j2 > /etc/swss/config.d/ipinip.json
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/mirror.json.j2 > /etc/swss/config.d/mirror.json
2 changes: 1 addition & 1 deletion dockers/docker-orchagent/ipinip.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"tunnel_type":"IPINIP",
"src_ip":"{{ minigraph_lo_interfaces[0]['addr'] }}",
"dst_ip":"{{ minigraph_lo_interfaces[0]['addr'] }}",
{% if minigraph_hwsku in [ 'ACS-MSN2700', 'ACS-MSN2410', 'ACS-MSN2100' ] %}
{% if asic_type == 'mellanox' %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if tested on any other asic types, or if we want to specify broadcom/mellanox.

"dscp_mode":"uniform",
"ecn_mode":"standard",
{% else %}
Expand Down
8 changes: 4 additions & 4 deletions dockers/docker-orchagent/mirror.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"MIRROR_SESSION_TABLE:everflow": {
"src_ip": "{{ minigraph_lo_interfaces[0]['addr'] }}",
"dst_ip": "{{ erspan_dst[0] }}",
{% if minigraph_hwsku in [ 'ACS-MSN2700', 'ACS-MSN2410', 'ACS-MSN2100' ] %}
"gre_type": "0x6558",
"queue": "1",
{% else %}
{% if asic_type == 'broadcom' %}
"gre_type": "0x88be",
"queue": "0",
{% else %}
"gre_type": "0x6558",
"queue": "1",
{% endif %}
"dscp": "8",
"ttl": "255"
Expand Down
9 changes: 9 additions & 0 deletions src/sonic-config-engine/tests/sonic_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build_version: HEAD.760-2c4c6e9
debian_version: 8.7
kernel_version: 3.16.0-4-amd64
asic_type: broadcom
commit_id: 2c4c6e9
build_date: Fri Apr 21 01:45:18 UTC 2017
build_number: 760
built_by: build@jenkins-worker-internal-1

5 changes: 3 additions & 2 deletions src/sonic-config-engine/tests/test_j2files.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def setUp(self):
self.test_dir = os.path.dirname(os.path.realpath(__file__))
self.script_file = os.path.join(self.test_dir, '..', 'sonic-cfggen')
self.t0_minigraph = os.path.join(self.test_dir, 't0-sample-graph.xml')
self.version_yml = os.path.join(self.test_dir, 'sonic_version.yml')
self.t0_port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini')
self.output_file = os.path.join(self.test_dir, 'output')

Expand Down Expand Up @@ -48,7 +49,7 @@ def test_render_teamd(self, pc):

def test_ipinip(self):
ipinip_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ipinip.json.j2')
argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + ipinip_file + ' > ' + self.output_file
argument = '-m ' + self.t0_minigraph + ' -y ' + self.version_yml + ' -p ' + self.t0_port_config + ' -t ' + ipinip_file + ' > ' + self.output_file
self.run_script(argument)

sample_output_file = os.path.join(self.test_dir, 'sample_output', 'ipinip.json')
Expand All @@ -57,7 +58,7 @@ def test_ipinip(self):

def test_everflow(self):
everflow_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'mirror.json.j2')
argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + everflow_file + ' > ' + self.output_file
argument = '-m ' + self.t0_minigraph + ' -y ' + self.version_yml + ' -p ' + self.t0_port_config + ' -t ' + everflow_file + ' > ' + self.output_file
self.run_script(argument)

sample_output_file = os.path.join(self.test_dir, 'sample_output', 'mirror.json')
Expand Down