Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Sep 12, 2023
2 parents 363589a + 9547060 commit ce5a837
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 12 deletions.
32 changes: 31 additions & 1 deletion .azure-pipelines/build-swss-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ parameters:
- name: artifact_name
type: string

- name: syslog_artifact_name
type: string

jobs:
- job:
displayName: ${{ parameters.arch }}
Expand Down Expand Up @@ -65,7 +68,14 @@ jobs:
libzmq3-dev \
swig4.0 \
libdbus-1-dev \
libteam-dev
libteam-dev \
rsyslog
sudo perl -i.bk -ne 'print if not /SONiCFileFormat|ActionFileDefaultTemplate/' /etc/rsyslog.conf
sudo sed -ie '/GLOBAL DIRECTIVES/{s/$/\n\$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-lst-lf%\\n"\n\$ActionFileDefaultTemplate SONiCFileFormat/}' /etc/rsyslog.conf
sudo service rsyslog start
displayName: "Install dependencies"
- task: DownloadPipelineArtifact@2
inputs:
Expand Down Expand Up @@ -121,6 +131,8 @@ jobs:
sudo dpkg -i $(find ./download -name libyang_*.deb)
sudo dpkg -i $(find ./download -name *.deb)
rm -rf download || true
cat /etc/apt/sources.list
dpkg --list |grep libnl
workingDirectory: $(Build.ArtifactStagingDirectory)
displayName: "Install libnl3, sonic swss common, and sairedis"
- script: |
Expand All @@ -133,3 +145,21 @@ jobs:
- publish: $(Build.ArtifactStagingDirectory)
artifact: ${{ parameters.artifact_name }}
displayName: "Archive swss debian packages"
- script: |
pwd
sudo chmod a+r /var/log/syslog*
tar -czf syslog-swss.tgz /var/log/syslog*
ls -al .
ls -al /var/log/
displayName: "Env info"
condition: always()
- task: CopyFiles@2
displayName: "Copy syslog to staging directory"
condition: always()
inputs:
contents: 'syslog-swss.tgz'
targetFolder: $(Build.ArtifactStagingDirectory)
- publish: $(Build.ArtifactStagingDirectory)/
artifact: ${{ parameters.syslog_artifact_name }}@$(System.JobAttempt)
displayName: "Publish syslog artifacts"
condition: always()
3 changes: 3 additions & 0 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ jobs:
sudo apt-get install -y rsyslog
sudo service rsyslog start
cat /etc/apt/sources.list
dpkg --list | grep libnl
displayName: "Install dependencies"
- task: DownloadPipelineArtifact@2
# amd64 artifact name does not has arch suffix
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
autoconf-archive \
uuid-dev \
libjansson-dev \
nlohmann-json3-dev \
python
- if: matrix.language == 'cpp'
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ stages:
sonic_slave: sonic-slave-${{ parameters.debian_version }}
swss_common_artifact_name: sonic-swss-common
sairedis_artifact_name: sonic-sairedis
syslog_artifact_name: sonic-swss.syslog
artifact_name: sonic-swss
debian_version: ${{ parameters.debian_version }}

Expand Down
2 changes: 1 addition & 1 deletion lib/ClientConfig.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ClientConfig.h"

#include "swss/logger.h"
#include "swss/json.hpp"
#include <nlohmann/json.hpp>

#include <cstring>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion lib/ContextConfigContainer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ContextConfigContainer.h"

#include "swss/logger.h"
#include "swss/json.hpp"
#include <nlohmann/json.hpp>

#include <cstring>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion lib/ServerConfig.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ServerConfig.h"

#include "swss/logger.h"
#include "swss/json.hpp"
#include <nlohmann/json.hpp>

#include <cstring>
#include <fstream>
Expand Down
5 changes: 1 addition & 4 deletions meta/SaiSerialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

#include "swss/tokenize.h"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#include "swss/json.hpp"
#pragma GCC diagnostic pop
#include <nlohmann/json.hpp>

#include <inttypes.h>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion saiasiccmp/View.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern "C" {
#include "saimetadata.h"
}

#include "swss/json.hpp"
#include <nlohmann/json.hpp>
#include "swss/table.h"

#include "syncd/AsicView.h"
Expand Down
3 changes: 2 additions & 1 deletion unittest/meta/TestNotificationFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "sai_serialize.h"

#include <gtest/gtest.h>
#include <nlohmann/json.hpp>

#include <memory>

Expand All @@ -13,7 +14,7 @@ TEST(NotificationFactory, deserialize)
{
EXPECT_THROW(NotificationFactory::deserialize("foo", "bar"), std::runtime_error);

EXPECT_THROW(NotificationFactory::deserialize(SAI_SWITCH_NOTIFICATION_NAME_FDB_EVENT, "bar"), std::invalid_argument);
EXPECT_THROW(NotificationFactory::deserialize(SAI_SWITCH_NOTIFICATION_NAME_FDB_EVENT, "bar"), nlohmann::detail::parse_error);
}

TEST(NotificationFactory, deserialize_fdb_event)
Expand Down
2 changes: 1 addition & 1 deletion vslib/ContextConfigContainer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ContextConfigContainer.h"

#include "swss/logger.h"
#include "swss/json.hpp"
#include <nlohmann/json.hpp>

#include <cstring>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion vslib/FdbInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#include "swss/json.hpp"
#include <nlohmann/json.hpp>
#pragma GCC diagnostic pop

using namespace saivs;
Expand Down

0 comments on commit ce5a837

Please sign in to comment.