Update docker-sonic-vs infrastructure in order to run CoPP UT (#10230)

*Changes to run CoPP UT in docker-sonic-vs
This commit is contained in:
noaOrMlnx 2022-03-22 06:55:24 +02:00 committed by GitHub
parent 1851827d74
commit 4f021c44c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 2 deletions

View File

@ -82,7 +82,7 @@
"trap_group": "queue4_group3" "trap_group": "queue4_group3"
}, },
{% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] != "ToRRouter") %} {% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] != "ToRRouter") %}
"dhcp": { "dhcp_relay": {
"trap_ids": "dhcp,dhcpv6", "trap_ids": "dhcp,dhcpv6",
"trap_group": "queue4_group3" "trap_group": "queue4_group3"
}, },

View File

@ -154,6 +154,7 @@ COPY ["files/sonic_version.yml", "/etc/sonic/"]
COPY ["port_breakout_config_db.json", "/etc/sonic/"] COPY ["port_breakout_config_db.json", "/etc/sonic/"]
COPY ["database_config.json", "/etc/default/sonic-db/"] COPY ["database_config.json", "/etc/default/sonic-db/"]
COPY ["hostname.j2", "/usr/share/sonic/templates/"] COPY ["hostname.j2", "/usr/share/sonic/templates/"]
COPY ["init_cfg.json.j2", "/usr/share/sonic/templates/"]
COPY ["default_chassis_cfg.json", "/etc/default/sonic-db/"] COPY ["default_chassis_cfg.json", "/etc/default/sonic-db/"]
COPY ["asic_table.json", "/etc/sonic/"] COPY ["asic_table.json", "/etc/sonic/"]
COPY ["zero_profiles.json", "/etc/sonic"] COPY ["zero_profiles.json", "/etc/sonic"]

View File

@ -0,0 +1,16 @@
{
"DEVICE_METADATA": {
"localhost": {
"mac": "{{ system_mac }}",
"buffer_model": "traditional"
}
},
{% set features = ["swss", "bgp", "teamd", "nat", "database", "lldp", "dhcp_relay", "macsec"] %}
"FEATURE": {
{% for feature in features %}
"{{ feature }}": {
"state": "enabled"
}{% if not loop.last %},{% endif %}
{% endfor %}
}
}

View File

@ -37,7 +37,7 @@ mkdir -p /var/run/redis/sonic-db
cp /etc/default/sonic-db/database_config.json /var/run/redis/sonic-db/ cp /etc/default/sonic-db/database_config.json /var/run/redis/sonic-db/
SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}') SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'", "buffer_model": "traditional"}}}' $CHASS_CFG --print-data > /etc/sonic/init_cfg.json sonic-cfggen -t /usr/share/sonic/templates/init_cfg.json.j2 -a "{\"system_mac\": \"$SYSTEM_MAC_ADDRESS\"}" $CHASS_CFG > /etc/sonic/init_cfg.json
if [ -f /etc/sonic/config_db.json ]; then if [ -f /etc/sonic/config_db.json ]; then
sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --print-data > /tmp/config_db.json sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --print-data > /tmp/config_db.json