Skip to content

Commit

Permalink
Merge commit '428d6da9f9' into switch-to-chrony
Browse files Browse the repository at this point in the history
  • Loading branch information
saiarcot895 committed Jan 2, 2025
2 parents 8a2705d + 428d6da commit a7f2b5d
Show file tree
Hide file tree
Showing 110 changed files with 8,787 additions and 709 deletions.
38 changes: 31 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ stages:
vmImage: ubuntu-20.04

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-bullseye:$(BUILD_BRANCH)
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-bookworm:$(BUILD_BRANCH)

steps:
- script: |
set -ex
sudo apt-get update
sudo apt-get install -y python3-pip
sudo pip3 install requests==2.31.0
sudo apt-get install -y python3-protobuf
displayName: "Install dependencies"
- script: |
Expand Down Expand Up @@ -84,15 +85,15 @@ stages:
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/bullseye/
workingDirectory: $(Pipeline.Workspace)/target/debs/bookworm/
displayName: 'Install Debian dependencies'
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 9
artifact: sonic-swss-common
artifact: sonic-swss-common-bookworm
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(sourceBranch)'
displayName: "Download sonic swss common deb packages"
Expand All @@ -104,6 +105,27 @@ stages:
workingDirectory: $(Pipeline.Workspace)/
displayName: 'Install swss-common dependencies'
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: sonic-net.sonic-dash-api
artifact: sonic-dash-api
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
patterns: |
libdashapi*.deb
displayName: "Download dash api"

- script: |
set -xe
sudo apt-get update
sudo dpkg -i $(Build.ArtifactStagingDirectory)/download/libdashapi_*.deb
workingDirectory: $(Pipeline.Workspace)/
displayName: 'Install libdashapi libraries'
- script: |
set -xe
sudo pip3 install swsssdk-2.0.1-py3-none-any.whl
Expand All @@ -112,20 +134,22 @@ stages:
sudo pip3 install sonic_yang_models-1.0-py3-none-any.whl
sudo pip3 install sonic_config_engine-1.0-py3-none-any.whl
sudo pip3 install sonic_platform_common-1.0-py3-none-any.whl
workingDirectory: $(Pipeline.Workspace)/target/python-wheels/bullseye/
workingDirectory: $(Pipeline.Workspace)/target/python-wheels/bookworm/
displayName: 'Install Python dependencies'
- script: |
set -ex
# Install .NET CORE
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/11/prod
sudo apt-add-repository https://packages.microsoft.com/debian/12/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0
displayName: "Install .NET CORE"
- script: |
python3 setup.py test
pip3 install ".[testing]"
pip3 uninstall --yes sonic-utilities
pytest
displayName: 'Test Python 3'
- task: PublishTestResults@2
Expand All @@ -145,7 +169,7 @@ stages:

- script: |
set -e
python3 setup.py bdist_wheel
python3 -m build -n
displayName: 'Build Python 3 wheel'
- publish: '$(System.DefaultWorkingDirectory)/dist/'
Expand Down
6 changes: 5 additions & 1 deletion clear/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from show.plugins.pbh import read_pbh_counters
from config.plugins.pbh import serialize_pbh_counters
from . import plugins

from . import stp
# This is from the aliases example:
# https://github.com/pallets/click/blob/57c6f09611fc47ca80db0bd010f05998b3c0aa95/examples/aliases/aliases.py
class Config(object):
Expand Down Expand Up @@ -145,6 +145,10 @@ def ipv6():
pass


# 'STP'
#
cli.add_command(stp.spanning_tree)

#
# Inserting BGP functionality into cli's clear parse-chain.
# BGP commands are determined by the routing-stack being elected.
Expand Down
46 changes: 46 additions & 0 deletions clear/stp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import click
import utilities_common.cli as clicommon

#
# This group houses Spanning_tree commands and subgroups
#


@click.group(cls=clicommon.AliasedGroup)
@click.pass_context
def spanning_tree(ctx):
'''Clear Spanning-tree counters'''
pass


@spanning_tree.group('statistics', cls=clicommon.AliasedGroup, invoke_without_command=True)
@click.pass_context
def stp_clr_stats(ctx):
if ctx.invoked_subcommand is None:
command = 'sudo stpctl clrstsall'
clicommon.run_command(command)


@stp_clr_stats.command('interface')
@click.argument('interface_name', metavar='<interface_name>', required=True)
@click.pass_context
def stp_clr_stats_intf(ctx, interface_name):
command = 'sudo stpctl clrstsintf ' + interface_name
clicommon.run_command(command)


@stp_clr_stats.command('vlan')
@click.argument('vlan_id', metavar='<vlan_id>', required=True)
@click.pass_context
def stp_clr_stats_vlan(ctx, vlan_id):
command = 'sudo stpctl clrstsvlan ' + vlan_id
clicommon.run_command(command)


@stp_clr_stats.command('vlan-interface')
@click.argument('vlan_id', metavar='<vlan_id>', required=True)
@click.argument('interface_name', metavar='<interface_name>', required=True)
@click.pass_context
def stp_clr_stats_vlan_intf(ctx, vlan_id, interface_name):
command = 'sudo stpctl clrstsvlanintf ' + vlan_id + ' ' + interface_name
clicommon.run_command(command)
Loading

0 comments on commit a7f2b5d

Please sign in to comment.