Skip to content

Commit a7f2b5d

Browse files
committed
Merge commit '428d6da9f9' into switch-to-chrony
2 parents 8a2705d + 428d6da commit a7f2b5d

File tree

110 files changed

+8787
-709
lines changed

Some content is hidden

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

110 files changed

+8787
-709
lines changed

azure-pipelines.yml

+31-7
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ stages:
4343
vmImage: ubuntu-20.04
4444

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

4848
steps:
4949
- script: |
5050
set -ex
5151
sudo apt-get update
5252
sudo apt-get install -y python3-pip
5353
sudo pip3 install requests==2.31.0
54+
sudo apt-get install -y python3-protobuf
5455
displayName: "Install dependencies"
5556
5657
- script: |
@@ -84,15 +85,15 @@ stages:
8485
sudo dpkg -i libyang_1.0.73_amd64.deb
8586
sudo dpkg -i libyang-cpp_1.0.73_amd64.deb
8687
sudo dpkg -i python3-yang_1.0.73_amd64.deb
87-
workingDirectory: $(Pipeline.Workspace)/target/debs/bullseye/
88+
workingDirectory: $(Pipeline.Workspace)/target/debs/bookworm/
8889
displayName: 'Install Debian dependencies'
8990
9091
- task: DownloadPipelineArtifact@2
9192
inputs:
9293
source: specific
9394
project: build
9495
pipeline: 9
95-
artifact: sonic-swss-common
96+
artifact: sonic-swss-common-bookworm
9697
runVersion: 'latestFromBranch'
9798
runBranch: 'refs/heads/$(sourceBranch)'
9899
displayName: "Download sonic swss common deb packages"
@@ -104,6 +105,27 @@ stages:
104105
workingDirectory: $(Pipeline.Workspace)/
105106
displayName: 'Install swss-common dependencies'
106107
108+
109+
- task: DownloadPipelineArtifact@2
110+
inputs:
111+
source: specific
112+
project: build
113+
pipeline: sonic-net.sonic-dash-api
114+
artifact: sonic-dash-api
115+
runVersion: 'latestFromBranch'
116+
runBranch: 'refs/heads/$(BUILD_BRANCH)'
117+
path: $(Build.ArtifactStagingDirectory)/download
118+
patterns: |
119+
libdashapi*.deb
120+
displayName: "Download dash api"
121+
122+
- script: |
123+
set -xe
124+
sudo apt-get update
125+
sudo dpkg -i $(Build.ArtifactStagingDirectory)/download/libdashapi_*.deb
126+
workingDirectory: $(Pipeline.Workspace)/
127+
displayName: 'Install libdashapi libraries'
128+
107129
- script: |
108130
set -xe
109131
sudo pip3 install swsssdk-2.0.1-py3-none-any.whl
@@ -112,20 +134,22 @@ stages:
112134
sudo pip3 install sonic_yang_models-1.0-py3-none-any.whl
113135
sudo pip3 install sonic_config_engine-1.0-py3-none-any.whl
114136
sudo pip3 install sonic_platform_common-1.0-py3-none-any.whl
115-
workingDirectory: $(Pipeline.Workspace)/target/python-wheels/bullseye/
137+
workingDirectory: $(Pipeline.Workspace)/target/python-wheels/bookworm/
116138
displayName: 'Install Python dependencies'
117139
118140
- script: |
119141
set -ex
120142
# Install .NET CORE
121143
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
122-
sudo apt-add-repository https://packages.microsoft.com/debian/11/prod
144+
sudo apt-add-repository https://packages.microsoft.com/debian/12/prod
123145
sudo apt-get update
124146
sudo apt-get install -y dotnet-sdk-8.0
125147
displayName: "Install .NET CORE"
126148
127149
- script: |
128-
python3 setup.py test
150+
pip3 install ".[testing]"
151+
pip3 uninstall --yes sonic-utilities
152+
pytest
129153
displayName: 'Test Python 3'
130154
131155
- task: PublishTestResults@2
@@ -145,7 +169,7 @@ stages:
145169

146170
- script: |
147171
set -e
148-
python3 setup.py bdist_wheel
172+
python3 -m build -n
149173
displayName: 'Build Python 3 wheel'
150174
151175
- publish: '$(System.DefaultWorkingDirectory)/dist/'

clear/main.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from show.plugins.pbh import read_pbh_counters
1313
from config.plugins.pbh import serialize_pbh_counters
1414
from . import plugins
15-
15+
from . import stp
1616
# This is from the aliases example:
1717
# https://github.com/pallets/click/blob/57c6f09611fc47ca80db0bd010f05998b3c0aa95/examples/aliases/aliases.py
1818
class Config(object):
@@ -145,6 +145,10 @@ def ipv6():
145145
pass
146146

147147

148+
# 'STP'
149+
#
150+
cli.add_command(stp.spanning_tree)
151+
148152
#
149153
# Inserting BGP functionality into cli's clear parse-chain.
150154
# BGP commands are determined by the routing-stack being elected.

clear/stp.py

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import click
2+
import utilities_common.cli as clicommon
3+
4+
#
5+
# This group houses Spanning_tree commands and subgroups
6+
#
7+
8+
9+
@click.group(cls=clicommon.AliasedGroup)
10+
@click.pass_context
11+
def spanning_tree(ctx):
12+
'''Clear Spanning-tree counters'''
13+
pass
14+
15+
16+
@spanning_tree.group('statistics', cls=clicommon.AliasedGroup, invoke_without_command=True)
17+
@click.pass_context
18+
def stp_clr_stats(ctx):
19+
if ctx.invoked_subcommand is None:
20+
command = 'sudo stpctl clrstsall'
21+
clicommon.run_command(command)
22+
23+
24+
@stp_clr_stats.command('interface')
25+
@click.argument('interface_name', metavar='<interface_name>', required=True)
26+
@click.pass_context
27+
def stp_clr_stats_intf(ctx, interface_name):
28+
command = 'sudo stpctl clrstsintf ' + interface_name
29+
clicommon.run_command(command)
30+
31+
32+
@stp_clr_stats.command('vlan')
33+
@click.argument('vlan_id', metavar='<vlan_id>', required=True)
34+
@click.pass_context
35+
def stp_clr_stats_vlan(ctx, vlan_id):
36+
command = 'sudo stpctl clrstsvlan ' + vlan_id
37+
clicommon.run_command(command)
38+
39+
40+
@stp_clr_stats.command('vlan-interface')
41+
@click.argument('vlan_id', metavar='<vlan_id>', required=True)
42+
@click.argument('interface_name', metavar='<interface_name>', required=True)
43+
@click.pass_context
44+
def stp_clr_stats_vlan_intf(ctx, vlan_id, interface_name):
45+
command = 'sudo stpctl clrstsvlanintf ' + vlan_id + ' ' + interface_name
46+
clicommon.run_command(command)

0 commit comments

Comments
 (0)