Skip to content

Commit

Permalink
Merge branch 'master' into srv6_sairedis
Browse files Browse the repository at this point in the history
  • Loading branch information
Kumaresh Perumal committed Sep 1, 2021
2 parents f00dc70 + f2075ff commit e67e620
Show file tree
Hide file tree
Showing 80 changed files with 7,111 additions and 5,533 deletions.
23 changes: 18 additions & 5 deletions .azure-pipelines/build-swss-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ jobs:
sudo apt-get install -y libzmq5 libzmq3-dev
sudo apt-get install -qq -y \
libhiredis-dev \
libnl-3-dev \
libnl-genl-3-dev \
libnl-route-3-dev \
libnl-nf-3-dev \
swig3.0
sudo apt-get install -y libdbus-1-3
sudo apt-get install -y libteam-dev \
Expand All @@ -73,7 +69,24 @@ jobs:
inputs:
artifact: ${{ parameters.sairedis_artifact_name }}
displayName: "Download sonic sairedis deb packages"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 1
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic buildimage"
- script: |
sudo dpkg -i target/debs/buster/libnl-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-genl-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-genl-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-route-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-route-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-nf-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-nf-3-dev_*.deb
sudo dpkg -i libswsscommon_1.0.0_${{ parameters.arch }}.deb
sudo dpkg -i libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
sudo dpkg -i libsaivs_*.deb
Expand All @@ -84,7 +97,7 @@ jobs:
sudo dpkg -i libsaimetadata-dev_*.deb
sudo dpkg -i syncd-vs_*.deb
workingDirectory: $(Pipeline.Workspace)
displayName: "Install sonic swss common and sairedis"
displayName: "Install libnl3, sonic swss common, and sairedis"
- checkout: sonic-swss
path: s
submodules: true
Expand Down
36 changes: 34 additions & 2 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ parameters:
type: boolean
default: false

- name: archive_gcov
type: boolean
default: false

jobs:
- job:
displayName: ${{ parameters.arch }}
Expand Down Expand Up @@ -97,20 +101,48 @@ jobs:
- checkout: self
submodules: true
- script: |
set -ex
./autogen.sh
fakeroot dpkg-buildpackage -b -us -uc -Tbinary-syncd-vs -j$(nproc) && cp ../*.deb .
displayName: "Compile sonic sairedis"
fakeroot debian/rules DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' CFLAGS="" CXXFLAGS="" binary-syncd-vs && cp ../*.deb .
displayName: "Compile sonic sairedis with coverage enabled"
- script: |
sudo cp azsyslog.conf /etc/rsyslog.conf
sudo service rsyslog restart
displayName: "Update rsyslog.conf"
- ${{ if eq(parameters.run_unit_test, true) }}:
- script: |
set -ex
git clone https://github.com/Spacetown/gcovr.git
cd gcovr/
git checkout origin/recursive_search_file
sudo pip3 install setuptools
sudo python3 setup.py install
cd ..
sudo rm -rf gcovr
displayName: "Install gcovr 5.0 with recursive fix"
- script: |
set -ex
make check
gcovr --version
gcovr -r ./ -e ".*/SAI/.*" -e ".+/json.hpp" -e "swss/.+" -e ".*/.libs/.*" -e ".*/debian/.*" --exclude-unreachable-branches --exclude-throw-branches -x -o coverage.xml
displayName: "Run sonic sairedis unit tests"
- publish: $(System.DefaultWorkingDirectory)/
artifact: ${{ parameters.artifact_name }}
displayName: "Archive sonic sairedis debian packages"
- ${{ if eq(parameters.archive_gcov, true) }}:
- 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/10/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
displayName: "Install .NET CORE"
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
displayName: 'Publish test coverage'
- script: |
pwd
sudo chmod a+r /var/log/syslog*
Expand Down
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,25 @@ deps/
# Executables #
###############
lib/tests
vslib/tests
meta/tests
saiasiccmp/saiasiccmp
saidiscovery/saidiscovery
saidump/saidump
saiplayer/saiplayer
saisdkdump/saisdkdump
syncd/syncd
syncd/syncd_request_shutdown
tests/syncd
tests/vssyncd
saiasiccmp/saiasiccmp
tests/tests
tests/testclient
tests/tests
tests/vssyncd
unittest/lib/tests
unittest/lib/testslibsairedis
unittest/meta/tests
unittest/syncd/tests
unittest/vslib/tests
unittest/vslib/testslibsaivs
vslib/tests

# Temporary files #
###################
Expand Down
5 changes: 3 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ stages:
artifact_name: sonic-sairedis
syslog_artifact_name: sonic-sairedis.syslog
run_unit_test: true
archive_gcov: true

- stage: BuildArm
dependsOn: Build
Expand All @@ -35,7 +36,7 @@ stages:
- template: .azure-pipelines/build-template.yml
parameters:
arch: armhf
timeout: 180
timeout: 240
pool: sonicbld
sonic_slave: sonic-slave-buster-armhf
swss_common_artifact_name: sonic-swss-common.armhf
Expand All @@ -45,7 +46,7 @@ stages:
- template: .azure-pipelines/build-template.yml
parameters:
arch: arm64
timeout: 180
timeout: 240
pool: sonicbld
sonic_slave: sonic-slave-buster-arm64
swss_common_artifact_name: sonic-swss-common.arm64
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ binary-syncd-vs:

override_dh_auto_configure:
./autogen.sh
dh_auto_configure -- $(shell cat /tmp/syncd-build) ${SWSS_COMMON_CONFIG}
dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS) $(shell cat /tmp/syncd-build) ${SWSS_COMMON_CONFIG}

override_dh_install:
dh_install
Expand Down
5 changes: 5 additions & 0 deletions lib/Switch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ void Switch::updateNotifications(
(sai_queue_pfc_deadlock_notification_fn)attr.value.ptr;
break;

case SAI_SWITCH_ATTR_BFD_SESSION_STATE_CHANGE_NOTIFY:
m_switchNotifications.on_bfd_session_state_change =
(sai_bfd_session_state_change_notification_fn)attr.value.ptr;
break;

default:
SWSS_LOG_ERROR("pointer for %s is not handled, FIXME!", meta->attridname);
break;
Expand Down
5 changes: 5 additions & 0 deletions lib/sairediscommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
#define SYNCD_INIT_VIEW "INIT_VIEW"
#define SYNCD_APPLY_VIEW "APPLY_VIEW"
#define SYNCD_INSPECT_ASIC "SYNCD_INSPECT_ASIC"

#define ASIC_STATE_TABLE "ASIC_STATE"
#define TEMP_PREFIX "TEMP_"

#define REDIS_COMMUNICATION_MODE_REDIS_ASYNC_STRING "redis_async"
#define REDIS_COMMUNICATION_MODE_REDIS_SYNC_STRING "redis_sync"
#define REDIS_COMMUNICATION_MODE_ZMQ_SYNC_STRING "zmq_sync"

/*
* Asic state table commands. Those names are special and they will be used
* inside swsscommon library LUA scripts to perform operations on redis
Expand Down
22 changes: 4 additions & 18 deletions meta/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,21 @@ libsaimeta_la_SOURCES = \
NotificationQueuePfcDeadlock.cpp \
NotificationSwitchShutdownRequest.cpp \
NotificationSwitchStateChange.cpp \
NotificationBfdSessionStateChange.cpp \
NumberOidIndexGenerator.cpp \
OidRefCounter.cpp \
PerformanceIntervalTimer.cpp \
PortRelatedSet.cpp \
RedisSelectableChannel.cpp \
SaiAttributeList.cpp \
SaiAttrWrapper.cpp \
SaiAttributeList.cpp \
SaiInterface.cpp \
SaiObjectCollection.cpp \
SaiObject.cpp \
SaiObjectCollection.cpp \
SaiSerialize.cpp \
SelectableChannel.cpp \
ZeroMQSelectableChannel.cpp

libsaimeta_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
libsaimeta_la_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) $(CODE_COVERAGE_CXXFLAGS)
libsaimeta_la_LIBADD = -lhiredis -lswsscommon libsaimetadata.la $(CODE_COVERAGE_LIBS)

bin_PROGRAMS = tests

tests_SOURCES = \
tests.cpp \
DummySaiInterface.cpp \
MetaTestSaiInterface.cpp \
NumberOidIndexGenerator.cpp \
../lib/VirtualObjectIdManager.cpp \
../lib/SwitchConfig.cpp \
../lib/SwitchConfigContainer.cpp

tests_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON)
tests_LDADD = -lhiredis -lswsscommon -lpthread libsaimetadata.la libsaimeta.la -lzmq

TESTS = tests

0 comments on commit e67e620

Please sign in to comment.