Skip to content

Commit

Permalink
Merge commit '5976399' into port-auto-neg
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox committed Apr 16, 2021
2 parents 0399b08 + 5976399 commit edc5f51
Show file tree
Hide file tree
Showing 21 changed files with 744 additions and 67 deletions.
18 changes: 13 additions & 5 deletions .azure-pipelines/build-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,32 @@ jobs:
- task: DownloadPipelineArtifact@2
inputs:
artifact: wheels
displayName: "Download sonic swss artifact"
displayName: "Download sonic utilities artifact"

- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 1
artifact: sonic-buildimage.vs
pipeline: 15
artifact: ${{ parameters.artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic buildimage"
displayName: "Download docker-sonic-vs artifact"

- script: |
set -ex
echo $(Build.DefinitionName).$(Build.BuildNumber)
docker load < ../target/docker-sonic-vs.gz
docker load < ../docker-sonic-vs.gz
docker images "docker-sonic-vs"
image_id=$(docker images "docker-sonic-vs:Azure.sonic-swss*" -q)
docker tag ${image_id} docker-sonic-vs:latest
docker images "docker-sonic-vs"
mkdir -p .azure-pipelines/docker-sonic-vs/wheels
Expand Down
24 changes: 18 additions & 6 deletions .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,22 @@ jobs:
runBranch: 'refs/heads/master'
displayName: "Download sonic swss common deb packages"

- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 15
artifact: sonic-swss-pytests
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic swss pytests"

- checkout: self
displayName: "Checkout sonic-swss-common"
- checkout: sonic-swss
displayName: "Checkout sonic-swss"
displayName: "Checkout sonic-utilities"

- script: |
set -x
sudo sonic-utilities/.azure-pipelines/build_and_install_module.sh
sudo .azure-pipelines/build_and_install_module.sh
sudo apt-get install -y libhiredis0.14
sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb || apt-get install -f
Expand All @@ -54,7 +62,11 @@ jobs:
sudo docker load -i ../docker-sonic-vs.gz
docker ps
ip netns list
pushd sonic-swss/tests
cd ../
mkdir -p sonic-swss
pushd sonic-swss
tar xf ../pytest.tgz
pushd tests
sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
displayName: "Run vs tests"
Expand All @@ -65,7 +77,7 @@ jobs:
condition: always()

- script: |
cp -r sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
cp -r ../sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
displayName: "Collect logs"
condition: always()
Expand Down
22 changes: 22 additions & 0 deletions acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,22 @@ def is_table_mirror(self, tname):
"""
return self.tables_db_info[tname]['type'].upper().startswith(self.ACL_TABLE_TYPE_MIRROR)

def is_table_l3v6(self, tname):
"""
Check if ACL table type is L3V6
:param tname: ACL table name
:return: True if table type is L3V6 else False
"""
return self.tables_db_info[tname]["type"].upper() == "L3V6"

def is_table_l3(self, tname):
"""
Check if ACL table type is L3
:param tname: ACL table name
:return: True if table type is L3 else False
"""
return self.tables_db_info[tname]["type"].upper() == "L3"

def is_table_ipv6(self, tname):
"""
Check if ACL table type is IPv6 (L3V6 or MIRRORV6)
Expand Down Expand Up @@ -593,6 +609,12 @@ def convert_rule_to_db_schema(self, table_name, rule):

rule_props["PRIORITY"] = str(self.max_priority - rule_idx)

# setup default ip type match to dataplane acl (could be overriden by rule later)
if self.is_table_l3v6(table_name):
rule_props["IP_TYPE"] = "IPV6ANY" # ETHERTYPE is not supported for DATAACLV6
elif self.is_table_l3(table_name):
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV4"])

deep_update(rule_props, self.convert_action(table_name, rule_idx, rule))
deep_update(rule_props, self.convert_l2(table_name, rule_idx, rule))
deep_update(rule_props, self.convert_ip(table_name, rule_idx, rule))
Expand Down
19 changes: 17 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,29 @@ stages:
sudo dpkg -i libnl-route-3-200_*.deb
sudo dpkg -i libnl-nf-3-200_*.deb
sudo dpkg -i libhiredis0.14_*.deb
sudo dpkg -i libswsscommon_1.0.0_amd64.deb
sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb
sudo dpkg -i libyang_1.0.73_amd64.deb
sudo dpkg -i libyang-cpp_1.0.73_amd64.deb
sudo dpkg -i python3-yang_1.0.73_amd64.deb
workingDirectory: $(Pipeline.Workspace)/target/debs/buster/
displayName: 'Install Debian dependencies'
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 9
artifact: sonic-swss-common
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic swss common deb packages"

- script: |
set -xe
sudo dpkg -i libswsscommon_1.0.0_amd64.deb
sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb
workingDirectory: $(Pipeline.Workspace)/
displayName: 'Install swss-common dependencies'
- script: |
set -xe
sudo pip3 install swsssdk-2.0.1-py3-none-any.whl
Expand Down
8 changes: 4 additions & 4 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,17 @@ def _restart_services():
click.echo("Restarting SONiC target ...")
clicommon.run_command("sudo systemctl restart sonic.target")

# Reload Monit configuration to pick up new hostname in case it changed
click.echo("Reloading Monit configuration ...")
clicommon.run_command("sudo monit reload")

try:
subprocess.check_call("sudo monit status", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
click.echo("Enabling container monitoring ...")
clicommon.run_command("sudo monit monitor container_checker")
except subprocess.CalledProcessError as err:
pass

# Reload Monit configuration to pick up new hostname in case it changed
click.echo("Reloading Monit configuration ...")
clicommon.run_command("sudo monit reload")


def interface_is_in_vlan(vlan_member_table, interface_name):
""" Check if an interface is in a vlan """
Expand Down
Loading

0 comments on commit edc5f51

Please sign in to comment.