Skip to content

Commit

Permalink
Merge branch 'main' into cli_context_cancellable
Browse files Browse the repository at this point in the history
  • Loading branch information
ram-mac authored Nov 25, 2024
2 parents 4b8161e + 3b0a8a5 commit 0570dd7
Show file tree
Hide file tree
Showing 601 changed files with 36,552 additions and 15,522 deletions.
32 changes: 26 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# Each line is a file pattern followed by one or more owners.
# Order is important; the last matching pattern takes the most
# precedence.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @openconfig/featureprofiles-maintainers will be requested for
# review when someone opens a pull request.
* @openconfig/featureprofiles-maintainers @openconfig/featureprofiles-quattro-tl
* @openconfig/featureprofiles-maintainers

# Tests which are ported from ate_tests to otg_tests may be reviewed by this team.
**/otg_tests/** @openconfig/featureprofiles-maintainers-otg @openconfig/featureprofiles-maintainers @openconfig/featureprofiles-quattro-tl
/internal/otgutils/ @openconfig/featureprofiles-maintainers-otg @openconfig/featureprofiles-maintainers @openconfig/featureprofiles-quattro-tl
# /feature folders each have owners who are auto requested for review and may merge PR's
/feature/acl/ @alokmtri-g
/feature/aft/ @sudhinj @yunjie-lu
/feature/bgp/ @dplore
/feature/dhcp/ @alokmtri-g
/feature/ethernet/ @ram-mac
/feature/interface/ @ram-mac
/feature/isis/ @rohit-rp
/feature/lldp/ @alokmtri-g
/feature/mpls/ @swetha-haridasula
/feature/mtu/ @swetha-haridasula
/feature/networkinstance/ @swetha-haridasula
/feature/platform/ @amrindrr
/feature/qos @sezhang2
/feature/routing_policy/ @swetha-haridasula
/feature/sampling/ @sudhinj
/feature/security @mihirpitale-googler
/feature/staticroute/ @swetha-haridasula
/feature/stp/ @alokmtri-g
/feature/system @swetha-haridasula
/feature/vrrp @amrindrr

# Order is important; the last matching pattern takes the most
# precedence.
# Common OTG utilities
/internal/otgutils/ @openconfig/featureprofiles-maintainers-otg
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/p4rt/README.md
--non-test-readme feature/security/gnsi/acctz/README.md
)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: featureprofiles
- name: Checkout wiki
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: "openconfig/featureprofiles.wiki"
path: featureprofiles.wiki
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*~
topologies/kne/testbed.kne.yml
.vscode/
.idea/
# used by `make validate_paths`
openconfig_public/
# used by `make proto/...`
Expand Down
21 changes: 8 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ 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.
* `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 +92,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 +103,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 +174,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 +186,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 +216,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 +429,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 +475,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
87 changes: 68 additions & 19 deletions doc/test-requirements-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,89 @@ assignees: ''

# Instructions for this template

Below is the required template for writing test requirements. Good examples of test
requirements include:
Below is the required template for writing test requirements. Good examples of
test requirements include:

* [TE-3.7: Base Hierarchical NHG Update](/feature/gribi/otg_tests/base_hierarchical_nhg_update/README.md)
* [gNMI-1.13: Telemetry: Optics Power and Bias Current](https://github.com/openconfig/featureprofiles/blob/main/feature/platform/tests/optics_power_and_bias_current_test/README.md)
* [RT-5.1: Singleton Interface](https://github.com/openconfig/featureprofiles/blob/main/feature/interface/singleton/otg_tests/singleton_test/README.md)
* [TE-18.1 gRIBI MPLS in UDP Encapsulation and
Decapsulation](https://github.com/openconfig/featureprofiles/blob/main/feature/gribi/otg_tests/mpls_in_udp/README.md)
* [TE-3.7: Base Hierarchical NHG
Update](/feature/gribi/otg_tests/base_hierarchical_nhg_update/README.md)
* [gNMI-1.13: Telemetry: Optics Power and Bias
Current](https://github.com/openconfig/featureprofiles/blob/main/feature/platform/tests/optics_power_and_bias_current_test/README.md)

# TestID-x.y: Short name of test here

## Summary

Write a few sentences or paragraphs describing the purpose and scope of the test.
Write a few sentences or paragraphs describing the purpose and scope of the
test.

## Testbed type

* Specify the .testbed topology file from the [topologies](https://github.com/openconfig/featureprofiles/tree/main/topologies) folder to be used with this test
* Specify the .testbed topology file from the
[topologies](https://github.com/openconfig/featureprofiles/tree/main/topologies)
folder to be used with this test

## Procedure

* Test environment setup
* Description of procedure to configure ATE and DUT with pre-requisites making it possible to cover the intended paths and RPC's.
### Test environment setup

* Description of procedure to configure ATE and DUT with pre-requisites making
it possible to cover the intended paths and RPCs.

### TestID-x.y.1 - Name of subtest 1

The following steps are typically present in each subtest.

* Step 1 - Generate DUT configuration

Replace this JSON formatted content with the "Canonical OC" that is expected to
be generated by the subtest. This configuration should be in JSON format.

```json
{
"openconfig-qos": {
"interfaces": [
{
"config": {
"interface-id": "PortChannel1.100"
},
"input": {
"classifiers": [
{
"classifier": "dest_A",
"config": {
"name": "dest_A",
"type": "IPV4"
}
}
],
"scheduler-policy": {
"config": {
"name": "limit_group_A_1Gb"
}
}
},
"interface": "PortChannel1.100"
},
]
}
}
```

* Step 2 - Push configuration to DUT using gnmi.Set with REPLACE option
* Step 3 - Send Traffic
* Step 4 - Validation with pass/fail criteria

* TestID-x.y.z - Name of subtest
* Step 1
* Step 2
* Validation and pass/fail criteria
### TestID-x.y.2 - Name of subtest 2

* TestID-x.y.z - Name of subtest
* Step 1
* Step 2
* Validation and pass/fail criteria
Repeat the format of the first subtest for each additional subtest defined.

## OpenConfig Path and RPC Coverage

This example yaml defines the OC paths intended to be covered by this test. OC paths used for test environment setup are not required to be listed here.
This yaml stanza defines the OC paths intended to be covered by this test. OC
paths used for test environment setup are not required to be listed here. This
content is parsed by automation to derive the test coverage

```yaml
paths:
Expand All @@ -64,6 +112,7 @@ rpcs:
## Required DUT platform
* Specify the minimum DUT-type:
* MFF - A modular form factor device containing LINECARDs, FABRIC and redundant CONTROLLER_CARD components
* MFF - A modular form factor device containing LINECARDs, FABRIC and
redundant CONTROLLER_CARD components
* FFF - fixed form factor
* vRX - virtual router device
Loading

0 comments on commit 0570dd7

Please sign in to comment.