Skip to content

Commit

Permalink
Merge branch 'main' into DP13
Browse files Browse the repository at this point in the history
  • Loading branch information
charantejag504 authored Mar 7, 2024
2 parents e869000 + a826abc commit 8e80d3e
Show file tree
Hide file tree
Showing 131 changed files with 15,743 additions and 672 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
~/go/pkg/mod
~/.cache/go-build
key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ github.job }}-${{ runner.os }}-go-build-
- name: Build
run: go build -v ./...
test:
Expand All @@ -41,7 +40,6 @@ jobs:
~/go/pkg/mod
~/.cache/go-build
key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ github.job }}-${{ runner.os }}-go-build-
# Dependency for Go module github.com/google/gopacket
- name: Install libpcap-dev
run: sudo apt-get -y install libpcap-dev
Expand Down Expand Up @@ -75,7 +73,6 @@ jobs:
~/.cache/go-build
~/.cache/staticcheck
key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ github.job }}-${{ runner.os }}-go-build-
# Dependency for Go module github.com/google/gopacket
- name: Install libpcap-dev
run: sudo apt-get -y install libpcap-dev
Expand All @@ -99,9 +96,11 @@ jobs:
#
# goimports does not support "gofmt -s" so both goimports and gofmt are
# required.
if goimports -d . | grep '^'; then
exit 1
fi
find . -name "*.go" | egrep -v "pb.go$" | while read l; do
if goimports -d $l | grep '^'; then
exit 1;
fi;
done
- name: Get revive
run: go install github.com/mgechev/[email protected]
- name: Run revive
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/protobufs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
~/go/pkg/mod
~/.cache/go-build
key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ github.job }}-${{ runner.os }}-go-build-
- name: Install protobuf
uses: arduino/setup-protoc@v1
with:
Expand Down Expand Up @@ -104,7 +103,6 @@ jobs:
~/go/pkg/mod
~/.cache/go-build
key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ github.job }}-${{ runner.os }}-go-build-
- name: Fetch Openconfig Models
run: make openconfig_public
- name: Validate Paths
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Pull Request
on: [pull_request]
jobs:
check_style:
name: Check style against CONTRIBUTING.md
check_ips:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Perl
uses: perl-actions/install-with-cpanm@v1
with:
Expand All @@ -14,9 +15,24 @@ jobs:
uses: actions/checkout@v3
- name: IP Addresses Assignment
run: |
find . -name \*.go -exec ./tools/check_ip_addresses.pl \{} +
git diff --name-only main | while read l; do
./tools/check_ip_addresses.pl $l;
done
check_style:
name: Check style against CONTRIBUTING.md
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Allowed File Types
run: ./tools/allowed_file_types.sh
- name: Block hyphenated directory names
run: |
if ! find ./feature -type d -name '*-*' -print -exec false {} +; then
echo "Hyphenated directories are not allowed. Please use a different separator like underscore."
exit 1
fi
- name: Enum
run: |
fail=0
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
~/go/pkg/mod
~/.cache/go-build
key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ github.job }}-${{ runner.os }}-go-build-
- name: Build Wiki
run: |
pushd featureprofiles.wiki
Expand Down
65 changes: 24 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ The directory tree is organized as follows:
* `tools/` contains code used for CI checks.
* `topologies/` contains the testbed topology definitions.

Directory names are not allowed to contain hyphen (-) characters.

## Allowed File Types

Regular files should be plain text in either ASCII or UTF-8 encoding. Please
Expand Down Expand Up @@ -123,8 +125,8 @@ in the [project](https://github.com/orgs/openconfig/projects/2/views/1) item.

Each test must also be accompanied by a `metadata.textproto` file that supplies
the metadata for annotating the JUnit XML test results. This file can be
generated or updated using the command: `go run ./tools/addrundata --fix`.
See [addrundata](/tools/addrundata/README.md) for more info.
generated or updated using the command: `go run ./tools/addrundata --fix`. See
[addrundata](/tools/addrundata/README.md) for more info.

For example:

Expand Down Expand Up @@ -338,51 +340,29 @@ a1v4.Protocol, _ = a1v4.To_Acl_AclSet_AclEntry_Ipv4_Protocol_Union(6)

## IP Addresses Assignment

Netblocks used in the test topology should follow IPv4 Address Blocks Reserved
for Documentation ([RFC 5737]), IPv4 reserved for Benchmarking Methodology
([RFC 2544]), and IPv6 Address Prefix Reserved for Documentation ([RFC 3849]).
In particular:

[RFC 5737]: https://datatracker.ietf.org/doc/html/rfc5737
[RFC 2544]: https://datatracker.ietf.org/doc/html/rfc2544
[RFC 3849]: https://datatracker.ietf.org/doc/html/rfc3849

For IPv6, link local addresses (FE80::/10) addresses are allowed in contexts
where link local is being tested.
> **Warning:** Though we are trying to use RFC defined non-globally routable
> space in tests, there might be tests (e.g. scaling tests) that are still using
> public routable ranges. Users who run the tests own the responsibility of not
> leaking test traffic to internet.
### IPv4

* `TEST-NET-1`: (192.0.2.0/24): control plane addresses split into /30 subnets
for each ATE/DUT port pair.
* `TEST-NET-2`: (198.51.100.0/24): data plane source network addresses used
for traffic testing; split as needed.
* `TEST-NET-3`: (203.0.113.0/24): data plane destination network addresses
used for traffic testing; split as needed.
* `BMWG`: (198.18.0.0/15): additional data plane networks.

* 20.0.0.1/15: data plane source network addresses used for scale testing.

* 30.0.0.1/15: data plane source network addresses used for scale testing.

* 100.0.0.0/12: data plane source network addresses used for scale testing.

* 138.0.11.0/24: data plane source network addresses used for traffic testing; split as needed.

* 192.51.100.1/24: data plane source network addresses used for traffic testing; split as needed.

* 192.51.129.0/22: data plane source network addresses used for traffic testing; split as needed.

* 192.55.200.3/32: data plane source network addresses used for traffic testing; split as needed.

* 198.100.200.123/24: data plane source network addresses used for traffic testing; split as needed.

* 203.10.113.1/24: data plane source network addresses used for traffic testing; split as needed.

* 192.58.200.1/24: data plane source network addresses used for traffic testing; split as needed.
* 192.0.2.0/24 ([TEST-NET-1](https://www.iana.org/go/rfc5737)): control plane
addresses split into /30 subnets for each ATE/DUT port pair.
* 198.51.100.0/24 ([TEST-NET-2](https://www.iana.org/go/rfc5737)): data plane
source network addresses used for traffic testing; split as needed.
* 203.0.113.0/24 ([TEST-NET-3](https://www.iana.org/go/rfc5737)): data plane
destination network addresses used for traffic testing; split as needed.
* 100.64.0.0/10 ([CGN Shared Space](https://www.iana.org/go/rfc6598)):
additional network address; split as needed.
* 198.18.0.0/15 ([Device Benchmark Testing](https://www.iana.org/go/rfc2544)):
additional network address; split as needed.

### IPv6

2001:DB8::/32 is a very large space, so we divide them as follows.
2001:DB8::/32
([Reserved for Documentation](https://datatracker.ietf.org/doc/html/rfc3849)) is
a very large space, so we divide them as follows.

* 2001:DB8:0::/64: control plane addresses split into /126 subnets for each
ATE/DUT port pair.
Expand All @@ -391,6 +371,9 @@ where link local is being tested.
* 2001:DB8:2::/64: data plane addresses used for traffic testing as the
destination address; split as needed.

Link local addresses (FE80::/10) addresses are allowed in contexts where link
local is being tested.

### Rationale

The properties being tested in the test plan are agnostic to the IP addresses
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ or by opening a GitHub

# Running Tests on Virtual Devices

> **Warning:** Though we are trying to use RFC defined non-globally routable
> space in tests, there might be tests (e.g. scaling tests) that are still using
> public routable ranges. Users who run the tests own the responsibility of not
> leaking test traffic to internet.
Tests may be run on virtual devices using the
[Kubernetes Network Emulation](https://github.com/openconfig/kne) binding.

Expand Down
7 changes: 6 additions & 1 deletion cloudbuild/virtual.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
steps:
- id: fetch-secrets
name: gcr.io/cloud-builders/gcloud
script: |
gcloud secrets versions access latest --secret=featureprofiles-ci-ssh > builder-key
gcloud secrets versions access latest --secret=featureprofiles-ci-ssh-pub > builder-key.pub
- id: fp-presubmit
name: gcr.io/${PROJECT_ID}/remote-builder
waitFor: ["-"]
env:
- USERNAME=user
- SSH_ARGS=--internal-ip --ssh-key-expire-after=1d
- SSH_ARGS=--internal-ip
- INSTANCE_NAME=fp-presubmit-${BUILD_ID}
- INSTANCE_ARGS=--network cloudbuild-workers --image-project gep-kne --image-family kne --machine-type ${_MACHINE_TYPE} ${_MACHINE_ARGS} --boot-disk-size 200GB [email protected] --scopes=default,compute-rw
- ZONE=us-west1-a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

* Connect DUT port-1, 2 to ATE port-1, 2
* Configure IPv4/IPv6 addresses on the ports
* Create an IPv4 networks i.e. ```ipv4-network = 192.168.10.0/24``` attached to ATE port-1
* Create an IPv6 networks i.e. ```ipv6-network = 2024:db8:128:128::/64``` attached to ATE port-1
* Configure IPv4 and IPv6 eBGP between DUT Port-1 and ATE Port-1
* Create an IPv4 networks i.e. ```ipv4-network = 192.168.10.0/24``` attached to ATE port-2
* Create an IPv6 networks i.e. ```ipv6-network = 2024:db8:128:128::/64``` attached to ATE port-2
* Configure IPv4 and IPv6 eBGP between DUT Port-2 and ATE Port-2
* /network-instances/network-instance/protocols/protocol/bgp/global/config
* /network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/
* Advertise ```ipv4-network = 192.168.10.0/24``` and ```ipv6-network = 2024:db8:128:128::/64``` from ATE to DUT with community ```64512:100```
* Configure IPv4 and IPv6 IS-IS L2 adjacency between ATE port-2 and DUT port-2
* Configure IPv4 and IPv6 IS-IS L2 adjacency between ATE port-1 and DUT port-1
* /network-instances/network-instance/protocols/protocol/isis/global/afi-safi
* Set level-capability to ```LEVEL_2```
* /network-instances/network-instance/protocols/protocol/isis/global/config/level-capability
Expand Down Expand Up @@ -119,8 +119,8 @@
##### Validate test results
* Validate that the IS-IS on ATE receives the redistributed BGP route for network ```ipv4-network``` i.e. ```192.168.10.0/24```
* /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/extended-ipv4-reachability/prefixes/prefix/state/prefix
* Initiate traffic from ATE port-2 to the DUT and destined to ```ipv4-network``` i.e. ```192.168.10.0/24```
* Validate that the traffic is received on ATE port-1
* Initiate traffic from ATE port-1 to the DUT and destined to ```ipv4-network``` i.e. ```192.168.10.0/24```
* Validate that the traffic is received on ATE port-2

### RT-1.28.3 [TODO: https://github.com/openconfig/featureprofiles/issues/2570]
#### IPv4: Non matching BGP community in a community-set should not be redistributed to IS-IS
Expand All @@ -132,7 +132,7 @@
* /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-member
##### Attach community-set to the route-policy
* For routing-policy ```route-policy-v4``` statement ```statement-v4``` reference the community set ```community-set-v4```
* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-community/reference/config/community-set-ref
* /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-community-set
##### Verification
* Verity a community set with name ```community-set-v4``` exists
* /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/state/community-set-name
Expand All @@ -155,8 +155,8 @@
* Validate that the IS-IS on ATE receives the redistributed BGP route for network ```ipv4-network``` i.e. ```192.168.10.0/24```
* /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/extended-ipv4-reachability/prefixes/prefix/state/prefix
* /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/extended-ipv4-reachability/prefixes/prefix/state/metric
* Initiate traffic from ATE port-2 to the DUT and destined to ```ipv4-network``` i.e. ```192.168.10.0/24```
* Validate that the traffic is received on ATE port-1
* Initiate traffic from ATE port-1 to the DUT and destined to ```ipv4-network``` i.e. ```192.168.10.0/24```
* Validate that the traffic is received on ATE port-2

### RT-1.28.5 [TODO: https://github.com/openconfig/featureprofiles/issues/2570]
#### Non matching IPv6 BGP prefixes in a prefix-set should not be redistributed to IS-IS
Expand Down Expand Up @@ -248,8 +248,8 @@
##### Validate test results
* Validate that the IS-IS on ATE receives the redistributed BGP route for network ```ipv6-network``` i.e. ```2024:db8:128:128::/64```
* /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/extended-ipv6-reachability/prefixes/prefix/state/prefix
* Initiate traffic from ATE port-2 to the DUT and destined to ```ipv6-network``` i.e. ```2024:db8:128:128::/64```
* Validate that the traffic is received on ATE port-1
* Initiate traffic from ATE port-1 to the DUT and destined to ```ipv6-network``` i.e. ```2024:db8:128:128::/64```
* Validate that the traffic is received on ATE port-2

### RT-1.28.7 [TODO: https://github.com/openconfig/featureprofiles/issues/2570]
#### IPv6: Non matching BGP community in a community-set should not be redistributed to IS-IS
Expand All @@ -261,7 +261,7 @@
* /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-member
##### Attach community-set to the route-policy
* For routing-policy ```route-policy-v6``` statement ```statement-v6``` reference the community set ```community-set-v6```
* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-community/reference/config/community-set-ref
* /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-community-set
##### Verification
* Verity a community set with name ```community-set-v6``` exists
* /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/state/community-set-name
Expand All @@ -284,8 +284,8 @@
* Validate that the IS-IS on ATE receives the redistributed BGP route for network ```ipv6-network``` i.e. ```2024:db8:128:128::/64```
* /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/extended-ipv6-reachability/prefixes/prefix/state/prefix
* /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/extended-ipv6-reachability/prefixes/prefix/state/metric
* Initiate traffic from ATE port-2 to the DUT and destined to ```ipv6-network``` i.e. ```2024:db8:128:128::/64```
* Validate that the traffic is received on ATE port-1
* Initiate traffic from ATE port-1 to the DUT and destined to ```ipv6-network``` i.e. ```2024:db8:128:128::/64```
* Validate that the traffic is received on ATE port-2

## Config parameter coverage

Expand Down
Loading

0 comments on commit 8e80d3e

Please sign in to comment.