-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sbezverk:master' into master
- Loading branch information
Showing
47 changed files
with
1,808 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: cicd | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Environment | ||
run: | | ||
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
cache-dependency-path: "**/go.sum" | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Require: The version of golangci-lint to use. | ||
version: v1.53 | ||
- name: Run go tests | ||
run: | | ||
go test ./... | ||
go test -race ./... | ||
- name: Build binary | ||
run: make build | ||
|
||
integration_tests: | ||
needs: [tests] | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
go-version: [1.20.x] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: setup host kernel parameters | ||
run: ./build/set_kernel_params.sh | ||
- name: Setup Environment | ||
run: | | ||
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
cache-dependency-path: "**/go.sum" | ||
- name: Build gobmp container | ||
run: make container REGISTRY_NAME=localhost IMAGE_VERSION=cicd | ||
- name: Build validator binary | ||
run: make validator | ||
- name: pulling XRd container | ||
run: docker pull sbezverk/xrd-control-plane:7.9.2 | ||
- name: check for gobmp container | ||
run: docker images | ||
- name: starts unicast v4 integration test | ||
run: docker compose -f ./build/unicastv4-bgp/test_bed.yml up --detach | ||
- name: check conection to kafka and bmp session with a router | ||
id: session | ||
run: ./build/monitor_container.sh gobmp | ||
continue-on-error: true | ||
- name: run validator for ipv4 unicast | ||
id: validation | ||
run: ./bin/validator --validate=true --kafka=127.0.0.1:9092 --msg-file=./testdata/validator/ipv4_unicast.msg | ||
continue-on-error: true | ||
- name: Check on failures | ||
if: steps.session.outcome != 'success' || steps.validation.outcome != 'success' | ||
run: | | ||
docker ps -a | ||
docker logs gobmp | ||
docker logs xr-1 | ||
exit 1 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Changelog | ||
|
||
Message updates and major project changes should be documented here. | ||
|
||
## [Unreleased] | ||
|
||
### 2023-04-13 | ||
|
||
#### Changed | ||
|
||
- SR value "prefix_sid" was previous configured with "omitempty" json tag option, this option is now removed. A valid | ||
SID index of 0 is now explicit in the json output. | ||
|
||
### 2023-03-20 | ||
|
||
#### Fixed | ||
|
||
- unresv\_bw\_kbps data structure was appending a slice, leaving initial 0 values and growing beyond the expected length. | ||
Updated function to index the slice to overwrite initial values and keep the expected length. | ||
[\#215](https://github.com/sbezverk/gobmp/issues/215) | ||
|
||
### 2023-02-23 | ||
|
||
#### Added | ||
|
||
- ls\_link attribute max\_link\_bw\_kbps BGP-LS TLV Type 1089 stored as an uint64 integer in kbps | ||
[\#213](https://github.com/sbezverk/gobmp/issues/213) | ||
- ls\_link attribute max\_resv\_bw\_kbps BGP-LS TLV Type 1090 stored as uint64 integer in kbps | ||
[\#213](https://github.com/sbezverk/gobmp/issues/213) | ||
- ls\_link attribute unresv\_bw\_kbps BGP-LS TLV Type 1091 stored as a slice of 8 uint64 integers in kbps | ||
[\#213](https://github.com/sbezverk/gobmp/issues/213) | ||
|
||
#### Deprecated | ||
|
||
- ls\_link attribute max\_link\_bw BGP-LS TLV Type 1089 statically set to 0 | ||
[\#213](https://github.com/sbezverk/gobmp/issues/213) | ||
- ls\_link attribute max\_resv\_bw BGP-LS TLV Type 1090 statically set to 0 | ||
[\#213](https://github.com/sbezverk/gobmp/issues/213) | ||
- ls\_link attribute unresv\_bw BGP-LS TLV Type 1091 statically set to nil | ||
[\#213](https://github.com/sbezverk/gobmp/issues/213) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM scratch | ||
|
||
COPY ./bin/validator /validator | ||
ENTRYPOINT ["/validator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/bash | ||
|
||
cn=$1 | ||
cid=$(docker ps | grep ${cn} | awk '{ print $1 }') | ||
|
||
if [[ ${cid} == "" ]]; then | ||
echo "no container ${cn} detected" | ||
exit 1 | ||
fi | ||
|
||
echo "Container id: ${cid}" | ||
|
||
done=false | ||
found=false | ||
i=0 | ||
|
||
while [ ${done} == false ]; do | ||
|
||
msg=$(docker logs ${cid} | grep "Kafka publisher has been successfully initialized") | ||
if [[ ${msg} != "" ]]; then | ||
done=true | ||
found=true | ||
else | ||
i=$((i+1)) | ||
if [[ ${i} -eq 12 ]]; then | ||
done=true | ||
else | ||
sleep 10; | ||
fi | ||
fi | ||
done | ||
|
||
if [[ ${found} == true ]]; then | ||
echo "successfully connected to kafka" | ||
else | ||
echo "container ${cn} failed to connect to kafka, check container logs..." | ||
docker logs ${cid} | ||
exit 1 | ||
fi | ||
|
||
done=false | ||
found=false | ||
i=0 | ||
|
||
while [ ${done} == false ]; do | ||
|
||
msg=$(docker logs ${cid} | grep "client 10.1.1.3") | ||
if [[ ${msg} != "" ]]; then | ||
done=true | ||
found=true | ||
else | ||
i=$((i+1)) | ||
if [[ ${i} -eq 24 ]]; then | ||
done=true | ||
else | ||
sleep 10; | ||
fi | ||
fi | ||
done | ||
|
||
if [[ ${found} == true ]]; then | ||
echo "bmp session with 10.1.1.3 came up" | ||
else | ||
echo "container ${cn} failed to establish bmp session with 10.1.1.3, check gobmp and xr-1 containers' logs..." | ||
docker logs ${cid} | ||
docker logs $(docker ps | grep xr-1 | awk '{ print $1 }') | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
Oops, something went wrong.