Skip to content

Commit

Permalink
Merge branch 'main' into RT-1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
cprabha authored Aug 28, 2024
2 parents 845dcc1 + 582cee5 commit ba630cc
Show file tree
Hide file tree
Showing 241 changed files with 15,797 additions and 5,431 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/nosimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@ jobs:
- name: Generate Examples and Check No Diff
run: |
cd tools/nosimage
go run example/generate_example.go -file-path example/example_nosimageprofile.textproto
go run example/generate_example.go -file-path example/example_nosimageprofile_invalid.textproto -invalid
go generate ./example
git diff --exit-code --ignore-all-space --ignore-blank-lines
- name: Validate Good Example
run: |
cd tools/nosimage
go run validate/validate.go -file example/example_nosimageprofile.textproto; rm -rf tmp
go run validate/validate.go -file example/valid_example_nosimageprofile.textproto; rm -rf tmp
- name: Validate Bad Example
run: |
cd tools/nosimage
if go run validate/validate.go -file example/example_nosimageprofile_invalid.textproto; then
echo "Validation passed, but failure expected"
exit 1
fi
for file in example/invalid-*.textproto; do
if go run validate/validate.go -file "$file"; then
echo "Validation passed for $file, but failure expected"
exit 1
fi
done
rm -rf tmp
4 changes: 2 additions & 2 deletions .github/workflows/readme_oc_path_and_rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
go install ./tools/validate_readme_spec
exemption_flags=(
--non-test-readme security/gnsi/certz/test_data/README.md
--non-test-readme experimental/p4rt/README.md
--non-test-readme feature/security/gnsi/certz/test_data/README.md
--non-test-readme feature/experimental/p4rt/README.md
--non-test-readme feature/security/gnsi/acctz/README.md
)
Expand Down
25 changes: 12 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ The directory tree is organized as follows:
* `cloudbuild/` contains google cloud build scripts for running virtual
routers in containers on [KNE](https://github.com/openconfig/kne)
* `feature/` contains definition and tests of feature profiles.
* `feature/experimental` contains new features and tests which are not yet
categorized or not confirmed to pass on any hardware platform or software
release. When the test is deemed more mature, it is moved to the `feature/`
directory.
* `feature/experimental` contains tests which have automation which is
not confirmed to pass on any hardware platform or software release.
When the test automation is passing against at least one DUT,
it is moved to the `feature/` directory.
* `internal/` contains packages used by feature profile tests.
* `proto/` contains protobuf files for feature profiles.
* `tools/` contains code used for CI checks.
Expand Down Expand Up @@ -96,7 +96,7 @@ allowed file types, please file an issue for discussion.
## Test Suite Organization

Test suites should be placed in subdirectories formatted like
`feature/<featurename>/[<sub-feature>/]<tests|ate_tests|otg_tests|kne_tests>/<test_name>/<test_name>.go`.
`feature/<featurename>/[<sub-feature>/]<tests|otg_tests|kne_tests>/<test_name>/<test_name>.go`.
For example:

* `feature/interface/` is the collection of interface feature profiles.
Expand All @@ -107,7 +107,8 @@ For example:
* `feature/interface/singleton/feature.textproto` - defines the singleton
interface feature profile in machine readable format.
* `feature/interface/singleton/ate_tests/` contains the singleton interfaces
test suite using ATE traffic generation API.
test suite using ATE traffic generation API. Note, use of the ATE API is
deprecated and should not be used for any new test development.
* `feature/interface/singleton/otg_tests/` contains the singleton interfaces
test suite using OTG traffic generation API.
* `feature/interface/singleton/kne_tests/` contains the singleton interfaces
Expand Down Expand Up @@ -177,7 +178,7 @@ were discovered when implementing the code.
## Test Structure

Generally, a Feature Profiles ONDATRA test has the following stages: configure
DUT, configure ATE, generate and verify traffic, verify telemetry. The
DUT, configure OTG, generate and verify traffic, verify telemetry. The
configuration stages should be factored out to their own functions, and any
subtests should be run under `t.Run` so the test output clearly reflects which
parts of the test passed and which parts failed.
Expand All @@ -189,13 +190,13 @@ occurred.
```
func TestFoo(t *testing.T) {
configureDUT(t) // calls t.Fatal() on error.
configureATE(t) // calls t.Fatal() on error.
configureOTG(t) // calls t.Fatal() on error.
t.Run("Traffic", func(t *testing.T) { ... })
t.Run("Telemetry", func(t *testing.T) { ... })
}
```

In the above example, `configureDUT` and `configureATE` should not be subtests,
In the above example, `configureDUT` and `configureOTG` should not be subtests,
otherwise they could be skipped when someone specifies a test filter. The
"Traffic" and "Telemetry" subtests will both run even if there is a fatal
condition during `t.Run()`.
Expand All @@ -219,7 +220,7 @@ func TestTableDriven(t *testing.T) {
t.Run(c.name, func(t *testing.T) {
t.Log("Description: ", c.desc)
configureDUT(t, /* parameterized by c */)
configureATE(t, /* parameterized by c */)
configureOTG(t, /* parameterized by c */)
t.Run("Traffic", func(t *testing.T) { ... })
t.Run("Telemetry", func(t *testing.T) { ... })
})
Expand Down Expand Up @@ -432,8 +433,6 @@ To contribute a pull request:
[GitHub Quickstart](https://docs.github.com/en/get-started/quickstart)
guide.

* New contributions should be in the feature/experimental directory.

1. When opening a pull request, use a descriptive title and detail. See
[Pull Request Title](#pull-request-title) below.

Expand Down Expand Up @@ -480,7 +479,7 @@ preferred format is:
```
* (M) internal/fptest/*
- Add a helper for referencing a keychain from other modules.
* (M) feature/experimental/isis/ate_tests/base_adjacencies_test
* (M) feature/isis/otg_tests/base_adjacencies_test
- Fix testing of hello-authentication to reference a specific
keychain.
- Fix authentication of *SNP packets, referencing a keychain
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ proto/nosimage_go_proto/nosimage.pb.go: proto/nosimage.proto protoimports
protoc -I='protobuf-import' --proto_path=proto --go_out=./proto/nosimage_go_proto --go_opt=paths=source_relative --go_opt=Mnosimage.proto=proto/nosimage_go_proto --go_opt=Mgithub.com/openconfig/featureprofiles/proto/ocpaths.proto=github.com/openconfig/featureprofiles/proto/ocpaths_go_proto --go_opt=Mgithub.com/openconfig/featureprofiles/proto/ocrpcs.proto=github.com/openconfig/featureprofiles/proto/ocrpcs_go_proto nosimage.proto
goimports -w proto/nosimage_go_proto/nosimage.pb.go

proto/testregistry_go_proto/testregistry.pb.go: proto/testregistry.proto protoimports
mkdir -p proto/testregistry_go_proto
protoc -I='protobuf-import' --proto_path=proto --go_out=./proto/testregistry_go_proto --go_opt=paths=source_relative --go_opt=Mtestregistry.proto=proto/testregistry_go_proto testregistry.proto
goimports -w proto/testregistry_go_proto/testregistry.pb.go

topologies/proto/binding/binding.pb.go: topologies/proto/binding.proto protoimports
mkdir -p topologies/proto/binding
protoc -I='protobuf-import' --proto_path=topologies/proto --go_out=. --go_opt=Mbinding.proto=topologies/proto/binding binding.proto
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild/virtual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
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
name: us-west1-docker.pkg.dev/${PROJECT_ID}/featureprofiles-ci/remote-builder
waitFor: ["-"]
env:
- USERNAME=user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ platform_exceptions: {
isis_single_topology_required: true
}
}
platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
isis_level_enabled: true
}
}
platform_exceptions: {
platform: {
vendor: ARISTA
Expand Down
92 changes: 92 additions & 0 deletions feature/bgp/admin_distance/otg_tests/admin_distance_test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# RT-1.34: BGP route-distance configuration

## Summary

BGP default-route-distance, external-route-distance and internal-route-distance (administrative distance) configuration.

## Testbed type

* https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_4.testbed

## Procedure

### Applying configuration

For each section of configuration below, prepare a gnmi.SetBatch with all the configuration items appended to one SetBatch. Then apply the configuration to the DUT in one gnmi.Set using the `replace` option

#### Initial Setup:

* Connect DUT port-1, 2 and 3 to ATE port-1, 2 and 3
* Configure IPv4/IPv6 addresses on the ports
* Create an IPv4 network i.e. ```ipv4-network-1 = 192.168.10.0/24``` attached to ATE port-1 and port-2
* Create an IPv6 network i.e. ```ipv6-network-1 = 2024:db8:64:64::/64``` attached to ATE port-1 and port-2
* Configure IPv4 and IPv6 IS-IS between DUT Port-1 and ATE Port-1
* /network-instances/network-instance/protocols/protocol/isis/global/config
* Advertise ```ipv4-network-1 = 192.168.10.0/24``` and ```ipv6-network-1 = 2024:db8:64:64::/64``` from ATE to DUT over the IPv4 and IPv6 IS-IS session on port-1

### RT-1.34.1 [TODO:https://github.com/openconfig/featureprofiles/issues/3050]
#### Validate traffic with modified eBGP Route-Distance of 5
* 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-1 = 192.168.10.0/24``` and ```ipv6-network-1 = 2024:db8:64:64::/64``` from ATE to DUT over the IPv4 and IPv6 eBGP session on port-2
* Configure Route-Distance of eBGP session on port-2 to 5
* /network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/config/external-route-distance
* Validate using gNMI Subscribe with mode 'ONCE' that the correct Route-Distance value of 5 is reported:
* /network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/state/external-route-distance
* Generate traffic from ATE port-3 towards ```ipv4-network-1 = 192.168.10.0/24``` and ```ipv6-network-1 = 2024:db8:64:64::/64```
* Verify that the traffic is received on port-2 of the ATE

### RT-1.34.2 [TODO:https://github.com/openconfig/featureprofiles/issues/3050]
#### Validate traffic with modified eBGP Route-Distance of 250
* Configure Route-Distance of eBGP session on port-2 to 250
* /network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/config/external-route-distance
* Validate using gNMI Subscribe with mode 'ONCE' that the correct Route-Distance value of 250 is reported:
* /network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/state/external-route-distance
* Generate traffic from ATE port-3 towards ```ipv4-network-1 = 192.168.10.0/24``` and ```ipv6-network-1 = 2024:db8:64:64::/64```
* Verify that the traffic is received on port-1 of the ATE

### RT-1.34.3 [TODO:https://github.com/openconfig/featureprofiles/issues/3050]
#### Validate traffic with modified iBGP Route-Distance of 5
* Replace IPv4 and IPv6 eBGP with IPv4 and IPv6 iBGP 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-1 = 192.168.10.0/24``` and ```ipv6-network-1 = 2024:db8:64:64::/64``` from ATE to DUT over the IPv4 and IPv6 iBGP session on port-2
* Configure Route-Distance of iBGP session on port-2 to 5
* /network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/config/internal-route-distance
* Validate using gNMI Subscribe with mode 'ONCE' that the correct Route-Distance value of 5 is reported:
* /network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/state/internal-route-distance
* Generate traffic from ATE port-3 towards ```ipv4-network-1 = 192.168.10.0/24``` and ```ipv6-network-1 = 2024:db8:64:64::/64```
* Validate that the traffic is received on port-2 of the ATE

### RT-1.34.4 [TODO:https://github.com/openconfig/featureprofiles/issues/3050]
#### Validate traffic with modified iBGP Route-Distance of 250
* Configure Route-Distance of iBGP session on port-2 to 250
* /network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/config/internal-route-distance
* Validate using gNMI Subscribe with mode 'ONCE' that the correct Route-Distance value of 250 is reported:
* /network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/state/internal-route-distance
* Generate traffic from ATE port-3 towards ```ipv4-network-1 = 192.168.10.0/24``` and ```ipv6-network-1 = 2024:db8:64:64::/64```
* Validate that the traffic is received on port-1 of the ATE

## OpenConfig Path and RPC Coverage

The below yaml defines the OC paths intended to be covered by this test. OC
paths used for test setup are not listed here.

```yaml
paths:
## Config paths
### Route-Distance
/network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/config/external-route-distance:
/network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/config/internal-route-distance:

## State paths
### Route-Distance
/network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/state/internal-route-distance:
/network-instances/network-instance/protocols/protocol/bgp/global/default-route-distance/state/external-route-distance:

rpcs:
gnmi:
gNMI.Set:
gNMI.Subscribe:
```
Loading

0 comments on commit ba630cc

Please sign in to comment.