Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
yatancuyu authored Jan 30, 2024
2 parents b0c90cf + 63b50de commit b8199b3
Show file tree
Hide file tree
Showing 136 changed files with 4,576 additions and 1,052 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+'

jobs:
build-debian-package-jammy:
name: build (Ubuntu 22.04)
runs-on: builder
container:
image: yanetplatform/builder
steps:
- uses: actions/checkout@v3
- run: |
export YANET_VERSION=${{github.ref_name}}
export YANET_VERSION=${YANET_VERSION:1}
export YANET_VERSION_MAJOR=${YANET_VERSION%.*}
export YANET_VERSION_MINOR=${YANET_VERSION#*.}
export YANET_VERSION_REVISION=${{github.run_number}}
export YANET_VERSION_HASH=${{github.sha}}
export YANET_VERSION_CUSTOM=stable
meson setup --prefix=/target \
-Dtarget=release \
-Dyanet_config=release,l3balancer,firewall \
-Darch=corei7,broadwell,knl \
-Dversion_major=$YANET_VERSION_MAJOR \
-Dversion_minor=$YANET_VERSION_MINOR \
-Dversion_revision=$YANET_VERSION_REVISION \
-Dversion_hash=$YANET_VERSION_HASH \
-Dversion_custom=$YANET_VERSION_CUSTOM \
build
meson compile -C build
- run: meson install -C build
- run: |
cp -r debian /target/DEBIAN
sed -i "s/__VERSION__/${YANET_VERSION}/g" /target/DEBIAN/control
- run: |
mkdir /export
dpkg-deb -b "/target" /export/yanet_${YANET_VERSION}_ubuntu22.04.deb
- uses: actions/upload-artifact@v3
with:
name: target_debian
path: /export/yanet*.deb

build-debian-package-bionic:
name: build (Ubuntu 18.04)
runs-on: builder
container:
image: yanetplatform/builder_ubuntu18.04
steps:
- uses: actions/checkout@v3
- run: |
export YANET_VERSION=${{github.ref_name}}
export YANET_VERSION=${YANET_VERSION:1}
export YANET_VERSION_MAJOR=${YANET_VERSION%.*}
export YANET_VERSION_MINOR=${YANET_VERSION#*.}
export YANET_VERSION_REVISION=${{github.run_number}}
export YANET_VERSION_HASH=${{github.sha}}
export YANET_VERSION_CUSTOM=stable
meson setup --prefix=/target \
-Dtarget=release \
-Dyanet_config=release,l3balancer,firewall \
-Darch=corei7,broadwell,knl \
-Dversion_major=$YANET_VERSION_MAJOR \
-Dversion_minor=$YANET_VERSION_MINOR \
-Dversion_revision=$YANET_VERSION_REVISION \
-Dversion_hash=$YANET_VERSION_HASH \
-Dversion_custom=$YANET_VERSION_CUSTOM \
build
meson compile -C build
- run: meson install -C build
- run: |
cp -r debian /target/DEBIAN
sed -i "s/__VERSION__/${YANET_VERSION}/g" /target/DEBIAN/control
- run: |
mkdir /export
dpkg-deb -b "/target" /export/yanet_${YANET_VERSION}_ubuntu18.04.deb
- uses: actions/upload-artifact@v3
with:
name: target_debian
path: /export/yanet*.deb
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ build_*
__pycache__
report/
.*
compile_commands.json
20 changes: 15 additions & 5 deletions autotest/autotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,11 @@ void tAutotest::recvThread(std::string interfaceName,
}
}
success = false;

if (expect_pcaps.size() == 1)
{
expect_pcaps[0].advance();
}
}

packetsCount++;
Expand Down Expand Up @@ -1276,6 +1281,12 @@ void tAutotest::mainThread()

fflushSharedMemory();

/// clear dataplane states
{
dataPlane.balancer_state_clear();
dataPlane.neighbor_clear();
}

try
{
{
Expand All @@ -1292,10 +1303,13 @@ void tAutotest::mainThread()
YANET_LOG_ERROR("invalid config: eResult %d\n", static_cast<std::uint32_t>(result));
throw "";
}
controlPlane.rib_flush();

this->request.swap(request);
}

dataPlane.neighbor_flush();

YAML::Node yamlRoot = YAML::LoadFile(configFilePath + "/autotest.yaml");

for (const YAML::Node& yamlStep : yamlRoot["steps"])
Expand Down Expand Up @@ -1459,11 +1473,6 @@ void tAutotest::mainThread()
std::abort();
}

/// clear dataplane states
{
dataPlane.balancer_state_clear();
}

YANET_LOG_PRINT(ANSI_COLOR_GREEN "done '%s'\n\n" ANSI_COLOR_RESET, configFilePath.data());
fflush(stdout);
fflush(stderr);
Expand Down Expand Up @@ -1613,6 +1622,7 @@ bool nAutotest::tAutotest::step_reload(const YAML::Node& yamlStep)
YANET_LOG_ERROR("invalid config: eResult %d\n", static_cast<std::uint32_t>(result));
return false;
}
controlPlane.rib_flush();

this->request.swap(request);

Expand Down
3 changes: 0 additions & 3 deletions autotest/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

#include <stdio.h>

#include "common/define.h"
#include "common/type.h"

#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
Expand Down
1 change: 0 additions & 1 deletion autotest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "common/result.h"

#include "autotest.h"
#include "common.h"

common::log::LogPriority common::log::logPriority = common::log::TLOG_DEBUG;

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ steps:
- ipv6Update: "::/0 -> fe80::1"
- ipv6LabelledUpdate:
- "cccc::/16 -> caca::123|210"
- "dddd::/16 -> fe80::1|211"
- "dddd::/16 -> cbcb::1|211"
- sendPackets:
- port: kni0
send: 001-send.pcap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
"neighborMacAddress": "00:00:00:00:00:02",
"nextModule": "lp0.200"
}
}
},
"ignore_tables": [
"ipv4 mpls",
"ipv6 mpls"
]
}
}
}
Loading

0 comments on commit b8199b3

Please sign in to comment.