Skip to content

Commit 52d7013

Browse files
authored
Merge branch 'master' into for_cacl
2 parents 759002e + 08337aa commit 52d7013

File tree

490 files changed

+230192
-4267
lines changed

Some content is hidden

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

490 files changed

+230192
-4267
lines changed

.artifactignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/*
2+
!dist/*.whl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
parameters:
2+
- name: timeout
3+
type: number
4+
default: 60
5+
6+
- name: artifact_name
7+
type: string
8+
9+
jobs:
10+
- job:
11+
displayName: "docker-sonic-vs"
12+
timeoutInMinutes: ${{ parameters.timeout }}
13+
14+
pool:
15+
vmImage: 'ubuntu-20.04'
16+
17+
steps:
18+
- task: DownloadPipelineArtifact@2
19+
inputs:
20+
artifact: wheels
21+
displayName: "Download sonic utilities artifact"
22+
23+
- task: DownloadPipelineArtifact@2
24+
inputs:
25+
source: specific
26+
project: build
27+
pipeline: 15
28+
artifact: ${{ parameters.artifact_name }}
29+
runVersion: 'latestFromBranch'
30+
runBranch: 'refs/heads/master'
31+
displayName: "Download docker-sonic-vs artifact"
32+
33+
- script: |
34+
set -ex
35+
36+
echo $(Build.DefinitionName).$(Build.BuildNumber)
37+
38+
docker load < ../docker-sonic-vs.gz
39+
40+
docker images "docker-sonic-vs"
41+
42+
image_id=$(docker images "docker-sonic-vs:Azure.sonic-swss*" -q)
43+
44+
docker tag ${image_id} docker-sonic-vs:latest
45+
46+
docker images "docker-sonic-vs"
47+
48+
mkdir -p .azure-pipelines/docker-sonic-vs/wheels
49+
50+
cp -v ../*.whl .azure-pipelines/docker-sonic-vs/wheels
51+
52+
pushd .azure-pipelines
53+
54+
docker build --no-cache -t docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) docker-sonic-vs
55+
56+
popd
57+
58+
docker save docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) | gzip -c > $(Build.ArtifactStagingDirectory)/docker-sonic-vs.gz
59+
displayName: "Build docker-sonic-vs image"
60+
61+
- publish: $(Build.ArtifactStagingDirectory)/
62+
artifact: ${{ parameters.artifact_name }}
63+
displayName: "Archive sonic docker vs image"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/bin/bash
2+
#
3+
# build and install team/vrf driver
4+
#
5+
6+
set -e
7+
8+
source /etc/os-release
9+
10+
function build_and_install_kmodule()
11+
{
12+
if sudo modprobe team 2>/dev/null && sudo modprobe vrf 2>/dev/null && sudo modprobe macsec 2>/dev/null; then
13+
echo "The module team, vrf and macsec exist."
14+
return
15+
fi
16+
17+
[ -z "$WORKDIR" ] && WORKDIR=$(mktemp -d)
18+
cd $WORKDIR
19+
20+
KERNEL_RELEASE=$(uname -r)
21+
KERNEL_MAINVERSION=$(echo $KERNEL_RELEASE | cut -d- -f1)
22+
EXTRAVERSION=$(echo $KERNEL_RELEASE | cut -d- -f2)
23+
LOCALVERSION=$(echo $KERNEL_RELEASE | cut -d- -f3)
24+
VERSION=$(echo $KERNEL_MAINVERSION | cut -d. -f1)
25+
PATCHLEVEL=$(echo $KERNEL_MAINVERSION | cut -d. -f2)
26+
SUBLEVEL=$(echo $KERNEL_MAINVERSION | cut -d. -f3)
27+
28+
# Install the required debian packages to build the kernel modules
29+
apt-get install -y build-essential linux-headers-${KERNEL_RELEASE} autoconf pkg-config fakeroot
30+
apt-get install -y flex bison libssl-dev libelf-dev
31+
apt-get install -y libnl-route-3-200 libnl-route-3-dev libnl-cli-3-200 libnl-cli-3-dev libnl-3-dev
32+
33+
# Add the apt source mirrors and download the linux image source code
34+
cp /etc/apt/sources.list /etc/apt/sources.list.bk
35+
sed -i "s/^# deb-src/deb-src/g" /etc/apt/sources.list
36+
apt-get update
37+
apt-get source linux-image-unsigned-$(uname -r) > source.log
38+
39+
# Recover the original apt sources list
40+
cp /etc/apt/sources.list.bk /etc/apt/sources.list
41+
apt-get update
42+
43+
# Build the Linux kernel module drivers/net/team and vrf
44+
cd $(find . -maxdepth 1 -type d | grep -v "^.$")
45+
make allmodconfig
46+
mv .config .config.bk
47+
cp /boot/config-$(uname -r) .config
48+
grep NET_TEAM .config.bk >> .config
49+
echo CONFIG_NET_VRF=m >> .config
50+
echo CONFIG_MACSEC=m >> .config
51+
make VERSION=$VERSION PATCHLEVEL=$PATCHLEVEL SUBLEVEL=$SUBLEVEL EXTRAVERSION=-${EXTRAVERSION} LOCALVERSION=-${LOCALVERSION} modules_prepare
52+
make M=drivers/net/team
53+
mv drivers/net/Makefile drivers/net/Makefile.bak
54+
echo 'obj-$(CONFIG_NET_VRF) += vrf.o' > drivers/net/Makefile
55+
echo 'obj-$(CONFIG_MACSEC) += macsec.o' >> drivers/net/Makefile
56+
make M=drivers/net
57+
58+
# Install the module
59+
TEAM_DIR=$(echo /lib/modules/$(uname -r)/kernel/net/team)
60+
NET_DIR=$(echo /lib/modules/$(uname -r)/kernel/net)
61+
if [ ! -e "$TEAM_DIR/team.ko" ]; then
62+
mkdir -p $TEAM_DIR
63+
cp drivers/net/team/*.ko $TEAM_DIR/
64+
modinfo $TEAM_DIR/team.ko
65+
depmod
66+
modprobe team
67+
fi
68+
if [ ! -e "$NET_DIR/vrf.ko" ]; then
69+
mkdir -p $NET_DIR
70+
cp drivers/net/vrf.ko $NET_DIR/
71+
modinfo $NET_DIR/vrf.ko
72+
depmod
73+
modprobe vrf
74+
fi
75+
if [ ! -e "$NET_DIR/macsec.ko" ]; then
76+
mkdir -p $NET_DIR
77+
cp drivers/net/macsec.ko $NET_DIR/
78+
modinfo $NET_DIR/macsec.ko
79+
depmod
80+
modprobe macsec
81+
fi
82+
83+
cd /tmp
84+
rm -rf $WORKDIR
85+
}
86+
87+
build_and_install_kmodule
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM docker-sonic-vs
2+
3+
ARG docker_container_name
4+
5+
ADD ["wheels", "/wheels"]
6+
7+
# Uninstalls only sonic-utilities and does not impact its dependencies
8+
RUN pip3 uninstall -y sonic-utilities
9+
10+
# Installs sonic-utilities, adds missing dependencies, upgrades out-dated depndencies
11+
RUN pip3 install /wheels/sonic_utilities-1.2-py3-none-any.whl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
parameters:
2+
- name: timeout
3+
type: number
4+
default: 180
5+
6+
- name: log_artifact_name
7+
type: string
8+
9+
jobs:
10+
- job:
11+
displayName: vstest
12+
timeoutInMinutes: ${{ parameters.timeout }}
13+
14+
pool:
15+
vmImage: 'ubuntu-20.04'
16+
17+
steps:
18+
- task: DownloadPipelineArtifact@2
19+
inputs:
20+
artifact: docker-sonic-vs
21+
displayName: "Download docker sonic vs image"
22+
23+
- task: DownloadPipelineArtifact@2
24+
inputs:
25+
source: specific
26+
project: build
27+
pipeline: 9
28+
artifact: sonic-swss-common.amd64.ubuntu20_04
29+
runVersion: 'latestFromBranch'
30+
runBranch: 'refs/heads/master'
31+
displayName: "Download sonic swss common deb packages"
32+
33+
- task: DownloadPipelineArtifact@2
34+
inputs:
35+
source: specific
36+
project: build
37+
pipeline: 15
38+
artifact: sonic-swss-pytests
39+
runVersion: 'latestFromBranch'
40+
runBranch: 'refs/heads/master'
41+
displayName: "Download sonic swss pytests"
42+
43+
- checkout: self
44+
displayName: "Checkout sonic-utilities"
45+
46+
- script: |
47+
set -x
48+
sudo .azure-pipelines/build_and_install_module.sh
49+
50+
sudo apt-get install -y libhiredis0.14
51+
sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb || apt-get install -f
52+
sudo dpkg -i ../python3-swsscommon_1.0.0_amd64.deb
53+
54+
# install packages for vs test
55+
sudo apt-get install -y net-tools bridge-utils vlan
56+
sudo apt-get install -y python3-pip
57+
sudo pip3 install pytest==4.6.2 attrs==19.1.0 exabgp==4.0.10 distro==1.5.0 docker==4.4.1 redis==3.3.4 flaky==3.7.0
58+
displayName: "Install dependencies"
59+
60+
- script: |
61+
set -x
62+
sudo docker load -i ../docker-sonic-vs.gz
63+
docker ps
64+
ip netns list
65+
cd ../
66+
mkdir -p sonic-swss
67+
pushd sonic-swss
68+
tar xf ../pytest.tgz
69+
pushd tests
70+
sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
71+
displayName: "Run vs tests"
72+
73+
- task: PublishTestResults@2
74+
inputs:
75+
testResultsFiles: '**/tr.xml'
76+
testRunTitle: vstest
77+
condition: always()
78+
79+
- script: |
80+
cp -r ../sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
81+
displayName: "Collect logs"
82+
condition: always()
83+
84+
- publish: $(Build.ArtifactStagingDirectory)/
85+
artifact: ${{ parameters.log_artifact_name }}@$(System.JobAttempt)
86+
displayName: "Publish logs"
87+
condition: always()

.coveragerc

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[run]
2+
branch = True
3+
source =
4+
acl_loader
5+
clear
6+
config
7+
connect
8+
consutil
9+
counterpoll
10+
crm
11+
debug
12+
fdbutil
13+
fwutil
14+
pcieutil
15+
pddf_fanutil
16+
pddf_ledutil
17+
pddf_psuutil
18+
pddf_thermalutil
19+
pfc
20+
pfcwd
21+
psuutil
22+
scripts
23+
sfputil
24+
show
25+
sonic_installer
26+
ssdutil
27+
undebug
28+
utilities_common
29+
watchdogutil

.github/ISSUE_TEMPLATE.md

-60
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

-32
This file was deleted.

0 commit comments

Comments
 (0)