From c206e2cc9a52ff621e7e2b48e0bc400a62762b9e Mon Sep 17 00:00:00 2001 From: Ali Al-Shabibi Date: Thu, 1 Aug 2024 01:52:00 +0200 Subject: [PATCH 1/5] Adding Containerz CNTR-1.1 test (#3121) --- feature/container/containerz/README.md | 30 ----- .../tests/container_lifecycle/README.md | 113 ++++++++++++++++++ .../container_lifecycle/containerz_test.go | 66 ++++++++++ .../container_lifecycle/metadata.textproto | 7 ++ go.mod | 11 +- go.sum | 26 ++-- internal/cntrsrv/build/Dockerfile.local | 5 + testregistry.textproto | 60 ++++++++++ topologies/binding/binding.go | 12 +- 9 files changed, 276 insertions(+), 54 deletions(-) delete mode 100644 feature/container/containerz/README.md create mode 100644 feature/container/containerz/tests/container_lifecycle/README.md create mode 100644 feature/container/containerz/tests/container_lifecycle/containerz_test.go create mode 100644 feature/container/containerz/tests/container_lifecycle/metadata.textproto create mode 100644 internal/cntrsrv/build/Dockerfile.local diff --git a/feature/container/containerz/README.md b/feature/container/containerz/README.md deleted file mode 100644 index 44f7dcef0019..000000000000 --- a/feature/container/containerz/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# CNTR-1: Basic container lifecycle via `gnoi.Containerz`. - -## CNTR-1.1: Deploy and Start a Container - -Using the -[`gnoi.Containerz`](https://github.com/openconfig/gnoi/tree/main/containerz) API -(reference implementation to be available -[`openconfig/containerz`](https://github.com/openconfig/containerz), deploy a -container to the DUT. Using `gnoi.Containerz` start the container. - -The container should expose a simple health API. The test succeeds if is -possible to connect to the container via the gRPC API to determine its health. - -## CNTR-1.2: Retrieve a running container's logs. - -Using the container started as part of CNTR-1.1, retrieve the logs from the -container and ensure non-zero contents are returned when using -`gnoi.Containerz.Log`. - -## CNTR-1.3: List the running containers on a DUT - -Using the container started as part of CNTR-1.1, validate that the container is -included in the listed set of containers when calling `gnoi.Containerz.List`. - -## CNTR-1.4: Stop a container running on a DUT. - -Using the container started as part of CNTR-1.2, validate that the container can -be stopped, and is subsequently no longer listed in the `gnoi.Containerz.List` -API. - diff --git a/feature/container/containerz/tests/container_lifecycle/README.md b/feature/container/containerz/tests/container_lifecycle/README.md new file mode 100644 index 000000000000..768d43fee2b4 --- /dev/null +++ b/feature/container/containerz/tests/container_lifecycle/README.md @@ -0,0 +1,113 @@ +# CNTR-1: Basic container lifecycle via `gnoi.Containerz`. + +## Summary + +Verify the correct behaviour of `gNOI.Containerz` when operating containers. + +## Procedure + +This step only applies if the reference implementation of containerz is being +tested. + +Start by pulling the reference implementation: + +```shell +$ git clone git@github.com:openconfig/containerz.git +``` + +Then `cd` into the containerz directory and build containerz: + +```shell +$ cd containerz +$ go build . +``` + +Finally start containerz: + +```shell +$ ./containerz start +``` + +You should see the following output: + +```shell +$ ./containerz start +I0620 12:02:57.408496 3615908 janitor.go:33] janitor-starting +I0620 12:02:57.408547 3615908 janitor.go:36] janitor-started +I0620 12:02:57.408583 3615908 server.go:167] server-start +I0620 12:02:57.408595 3615908 server.go:170] Starting up on Containerz server, listening on: [::]:19999 +I0620 12:02:57.408608 3615908 server.go:171] server-ready +``` + +### Build Test Container + +The test container is available in the feature profile repository under +`internal/cntrsrv`. + +Start by entering in that directory and running the following commands: + +```shell +$ cd internal/cntrsrv +$ go mod vendor +$ CGO_ENABLED=0 go build . +$ docker build -f build/Dockerfile.local -t cntrsrv:latest . +``` + +At this point you will have a container image build for the test container. + +```shell +$ docker images +REPOSITORY TAG IMAGE ID CREATED SIZE +cntrsrv latest 8d786a6eebc8 3 minutes ago 21.4MB +``` + +Now export the container to a tarball. + +```shell +$ docker save -o /tmp/cntrsrv.tar cntrsrv:latest +$ docker rmi cntrsrv:latest +``` + +This is the tarball that will be used during tests. + +## CNTR-1.1: Deploy and Start a Container + +Using the +[`gnoi.Containerz`](https://github.com/openconfig/gnoi/tree/main/containerz) API +(reference implementation to be available +[`openconfig/containerz`](https://github.com/openconfig/containerz), deploy a +container to the DUT. Using `gnoi.Containerz` start the container. + +The container should expose a simple health API. The test succeeds if is +possible to connect to the container via the gRPC API to determine its health. + +## CNTR-1.2: Retrieve a running container's logs. + +Using the container started as part of CNTR-1.1, retrieve the logs from the +container and ensure non-zero contents are returned when using +`gnoi.Containerz.Log`. + +## CNTR-1.3: List the running containers on a DUT + +Using the container started as part of CNTR-1.1, validate that the container is +included in the listed set of containers when calling `gnoi.Containerz.List`. + +## CNTR-1.4: Stop a container running on a DUT. + +Using the container started as part of CNTR-1.2, validate that the container can +be stopped, and is subsequently no longer listed in the `gnoi.Containerz.List` +API. + +## OpenConfig Path and RPC Coverage + +The below yaml defines the RPCs intended to be covered by this test. + +```yaml +rpcs: + gnoi: + containerz.Containerz.Deploy: + containerz.Containerz.StartContainer: + containerz.Containerz.StopContainer: + containerz.Containerz.Log: + containerz.Containerz.ListContainer: +``` \ No newline at end of file diff --git a/feature/container/containerz/tests/container_lifecycle/containerz_test.go b/feature/container/containerz/tests/container_lifecycle/containerz_test.go new file mode 100644 index 000000000000..f7be52e16b74 --- /dev/null +++ b/feature/container/containerz/tests/container_lifecycle/containerz_test.go @@ -0,0 +1,66 @@ +package container_lifecycle + +import ( + "context" + "crypto/tls" + "flag" + "testing" + + "github.com/openconfig/containerz/client" + cpb "github.com/openconfig/featureprofiles/internal/cntrsrv/proto/cntr" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +var ( + containerTar = flag.String("container_tar", "/tmp/cntrsrv.tar", "The container tarball to deploy.") + containerzAddr = flag.String("containerz_addr", "localhost:19999", "containerz server address") +) + +// TestDeployAndStartContainer implements CNTR-1.1 validating that it is +// possible deploy and start a container via containerz. +func TestDeployAndStartContainer(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + cli, err := client.NewClient(ctx, *containerzAddr) + if err != nil { + t.Fatalf("unable to dial containerz: %v", err) + } + + progCh, err := cli.PushImage(ctx, "cntrsrv", "latest", *containerTar) + if err != nil { + t.Fatalf("unable to push image: %v", err) + } + + for prog := range progCh { + switch { + case prog.Error != nil: + t.Fatalf("failed to push image: %v", err) + case prog.Finished: + t.Logf("Pushed %s/%s\n", prog.Image, prog.Tag) + default: + t.Logf(" %d bytes pushed", prog.BytesReceived) + } + } + + ret, err := cli.StartContainer(ctx, "cntrsrv", "latest", "./cntrsrv", "test-instance", client.WithPorts([]string{"60061:60061"})) + if err != nil { + t.Fatalf("unable to start container: %v", err) + } + t.Logf("Started %s", ret) + + tlsc := credentials.NewTLS(&tls.Config{ + InsecureSkipVerify: true, // NOLINT + }) + conn, err := grpc.DialContext(ctx, "localhost:60061", grpc.WithTransportCredentials(tlsc), grpc.WithBlock()) + if err != nil { + t.Fatalf("Failed to dial cntrsrv, %v", err) + } + + cntrCli := cpb.NewCntrClient(conn) + if _, err = cntrCli.Ping(ctx, &cpb.PingRequest{}); err != nil { + t.Errorf("unable to reach cntrsrv: %v", err) + } + +} diff --git a/feature/container/containerz/tests/container_lifecycle/metadata.textproto b/feature/container/containerz/tests/container_lifecycle/metadata.textproto new file mode 100644 index 000000000000..7d84745fd469 --- /dev/null +++ b/feature/container/containerz/tests/container_lifecycle/metadata.textproto @@ -0,0 +1,7 @@ +# proto-file: github.com/openconfig/featureprofiles/proto/metadata.proto +# proto-message: Metadata + +uuid: "a477c97d-c895-4af3-9c97-9327bf86d517" +plan_id: "CNTR-1" +description: "Basic container lifecycle via `gnoi.Containerz`." +testbed: TESTBED_DUT_ATE_2LINKS \ No newline at end of file diff --git a/go.mod b/go.mod index 40f4d310dded..cbbf859e66ce 100644 --- a/go.mod +++ b/go.mod @@ -16,9 +16,10 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/kr/pretty v0.3.1 github.com/open-traffic-generator/snappi/gosnappi v1.3.0 + github.com/openconfig/containerz v0.0.0-20240620162940-e0bf23af17d6 github.com/openconfig/entity-naming v0.0.0-20230912181021-7ac806551a31 github.com/openconfig/gnmi v0.11.0 - github.com/openconfig/gnoi v0.4.0 + github.com/openconfig/gnoi v0.4.1-0.20240501161656-1d16819bab6a github.com/openconfig/gnoigo v0.0.0-20240320202954-ebd033e3542c github.com/openconfig/gnsi v1.4.5 github.com/openconfig/gocloser v0.0.0-20220310182203-c6c950ed3b0b @@ -44,11 +45,11 @@ require ( golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 golang.org/x/text v0.14.0 google.golang.org/api v0.162.0 - google.golang.org/grpc v1.63.0 - google.golang.org/protobuf v1.33.0 + google.golang.org/grpc v1.63.2 + google.golang.org/protobuf v1.34.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/klog/v2 v2.100.1 + k8s.io/klog/v2 v2.120.1 ) require ( @@ -153,7 +154,7 @@ require ( golang.org/x/mod v0.16.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.20.0 // indirect golang.org/x/term v0.18.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.19.0 // indirect diff --git a/go.sum b/go.sum index 4bbda0ef3d73..0838dc649922 100644 --- a/go.sum +++ b/go.sum @@ -1366,7 +1366,6 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -1638,6 +1637,8 @@ github.com/open-traffic-generator/snappi/gosnappi v1.3.0 h1:6SFSuZLTuncLW1xMcBG5 github.com/open-traffic-generator/snappi/gosnappi v1.3.0/go.mod h1:CaE4nisXftNXdXWvTSqb4eiW2WMFIXkJsH5rqPoipcg= github.com/openconfig/attestz v0.2.0 h1:VuksFIG1OlGnRuUpdTFAkMyAY59ITvyLbp4AtiTXV64= github.com/openconfig/attestz v0.2.0/go.mod h1:byY6H68zm3VXmQHEb4O4OZtRtFyHEjkmzrvIljYc79Y= +github.com/openconfig/containerz v0.0.0-20240620162940-e0bf23af17d6 h1:4SPV//llewH/1v5l3+ogzUubksBGSeI+hHLXTAw2T1A= +github.com/openconfig/containerz v0.0.0-20240620162940-e0bf23af17d6/go.mod h1:Byu9uT5Yyz8XEKv9eUBcWqAoUADVvfmN8m+BGqTQPoc= github.com/openconfig/entity-naming v0.0.0-20230912181021-7ac806551a31 h1:K/9O+J20+liIof8WjquMydnebD0N1U9ItjhJYF6H4hg= github.com/openconfig/entity-naming v0.0.0-20230912181021-7ac806551a31/go.mod h1:ZRUrfwYYY+pLaOoWPad3p/8J4LLQcSqtXhBCkD2pXJc= github.com/openconfig/gnmi v0.0.0-20200414194230-1597cc0f2600/go.mod h1:M/EcuapNQgvzxo1DDXHK4tx3QpYM/uG4l591v33jG2A= @@ -1645,8 +1646,8 @@ github.com/openconfig/gnmi v0.0.0-20200508230933-d19cebf5e7be/go.mod h1:M/EcuapN github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NTa5a8vj6E= github.com/openconfig/gnmi v0.11.0 h1:H7pLIb/o3xObu3+x0Fv9DCK7TH3FUh7mNwbYe+34hFw= github.com/openconfig/gnmi v0.11.0/go.mod h1:9oJSQPPCpNvfMRj8e4ZoLVAw4wL8HyxXbiDlyuexCGU= -github.com/openconfig/gnoi v0.4.0 h1:jbYXRMNmmvA8ZFv2FBLrYoxA1MFSui4tEui+8LAWyVc= -github.com/openconfig/gnoi v0.4.0/go.mod h1:0d3/bgooXM/je6jI+fb7+9Iky8R8k6zSFG19xRYTRso= +github.com/openconfig/gnoi v0.4.1-0.20240501161656-1d16819bab6a h1:wDllmsI9aUalYMF3Z0VQa2GZv8hcaHYfZsSNJARuUfk= +github.com/openconfig/gnoi v0.4.1-0.20240501161656-1d16819bab6a/go.mod h1:QVnt7KL8l6WphIfLuHHpgZfNO+MoXE610gSLOLV9VcI= github.com/openconfig/gnoigo v0.0.0-20240320202954-ebd033e3542c h1:egPgBUBDn0XEtbz0CvE+Bh/I/3iTzwzMq5/rmtPJdQs= github.com/openconfig/gnoigo v0.0.0-20240320202954-ebd033e3542c/go.mod h1:Se/HklUcFVcCGB66khgYouiesLRPoa4UL1ovvmE/68k= github.com/openconfig/gnpsi v0.3.2 h1:+bl1bXMOTrWOcGydWB+8wGgvxlgvL8Y6joAiWFU5sog= @@ -1755,8 +1756,8 @@ github.com/sirikothe/gotextfsm v1.0.1-0.20200816110946-6aa2cfd355e4 h1:FHUL2HofY github.com/sirikothe/gotextfsm v1.0.1-0.20200816110946-6aa2cfd355e4/go.mod h1:CJYqpTg9u5VPCoD0VEl9E68prCIiWQD8m457k098DdQ= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= @@ -2191,8 +2192,8 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2680,8 +2681,8 @@ google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9Y google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= -google.golang.org/grpc v1.63.0 h1:WjKe+dnvABXyPJMD7KDNLxtoGk5tgk+YFWN6cBWjZE8= -google.golang.org/grpc v1.63.0/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2702,8 +2703,9 @@ google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2744,8 +2746,8 @@ k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k= k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s= k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a h1:gmovKNur38vgoWfGtP5QOGNOA7ki4n6qNYoFAgMlNvg= k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY= k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 h1:xMMXJlJbsU8w3V5N2FLDQ8YgU8s1EoULdbQBcAeNJkY= diff --git a/internal/cntrsrv/build/Dockerfile.local b/internal/cntrsrv/build/Dockerfile.local new file mode 100644 index 000000000000..997c221adf2b --- /dev/null +++ b/internal/cntrsrv/build/Dockerfile.local @@ -0,0 +1,5 @@ +FROM alpine:3.16 + +COPY cntrsrv / + +CMD ["./cntrsrv"] diff --git a/testregistry.textproto b/testregistry.textproto index 7a3246268080..936cf7dccca9 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -1577,3 +1577,63 @@ test: { readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/gnpsi/otg_tests/sampling_test/README.md" exec: " " } +test: { + id: "CNTR-1" + description: "Basic container lifecycle via `gnoi.Containerz`." + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/containerz/tests/container_lifecycle/README.md" + exec: " " +} +test: { + id: "CNTR-1.1" + description: "Deploy and Start a Container" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/containerz/tests/container_lifecycle/README.md" + exec: " " +} +test: { + id: "CNTR-1.2" + description: "Retrieve a running container's logs." + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/containerz/tests/container_lifecycle/README.md" + exec: " " +} +test: { + id: "CNTR-1.3" + description: "List the running containers on a DUT" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/containerz/tests/container_lifecycle/README.md" + exec: " " +} +test: { + id: "CNTR-1.4" + description: "Stop a container running on a DUT." + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/containerz/tests/container_lifecycle/README.md" + exec: " " +} +test: { + id: "CNTR-2" + description: "Container network connectivity tests" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/networking/tests/container_connectivity/README.md" + exec: " " +} +test: { + id: "CNTR-2.1" + description: "Connect to container from external client." + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/networking/tests/container_connectivity/README.md" + exec: " " +} +test: { + id: "CNTR-2.2" + description: "Connect to locally running service." + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/networking/tests/container_connectivity/README.md" + exec: " " +} +test: { + id: "CNTR-2.3" + description: "Connect to a remote node." + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/networking/tests/container_connectivity/README.md" + exec: " " +} +test: { + id: "CNTR-2.4" + description: "Connect to another container on a local node" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/container/networking/tests/container_connectivity/README.md" + exec: " " +} \ No newline at end of file diff --git a/topologies/binding/binding.go b/topologies/binding/binding.go index 71f7c21c0343..43c9eb3e8953 100644 --- a/topologies/binding/binding.go +++ b/topologies/binding/binding.go @@ -27,27 +27,25 @@ import ( grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" "github.com/open-traffic-generator/snappi/gosnappi" + bindpb "github.com/openconfig/featureprofiles/topologies/proto/binding" + gpb "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnoigo" + grpb "github.com/openconfig/gribi/v1/proto/service" "github.com/openconfig/ondatra/binding" "github.com/openconfig/ondatra/binding/grpcutil" "github.com/openconfig/ondatra/binding/introspect" "github.com/openconfig/ondatra/binding/ixweb" + opb "github.com/openconfig/ondatra/proto" + p4pb "github.com/p4lang/p4runtime/go/p4/v1" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/knownhosts" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" - - bindpb "github.com/openconfig/featureprofiles/topologies/proto/binding" - gpb "github.com/openconfig/gnmi/proto/gnmi" - grpb "github.com/openconfig/gribi/v1/proto/service" - opb "github.com/openconfig/ondatra/proto" - p4pb "github.com/p4lang/p4runtime/go/p4/v1" ) var ( // To be stubbed out by unit tests. - //lint:ignore SA1019 DialContext allows for blocking on new connections. grpcDialContextFn = grpc.DialContext gosnappiNewAPIFn = gosnappi.NewApi ) From cbd87ffa91c71bcf323285db08daf4e898f4b186 Mon Sep 17 00:00:00 2001 From: prakashbadri-arista <127355794+prakashbadri-arista@users.noreply.github.com> Date: Wed, 31 Jul 2024 21:20:54 -0700 Subject: [PATCH 2/5] Fix basic_encap_test failure due to incorrect TTL validation in the test (#3344) The test incorrectly expects the encapsulated egress packet to have a TTL value of 0. But the expectation should be to have a TTL value = ingress pkt's TTL - 1 ( accounting for the TTL decrement on the encapsulating router ). The fix changes the expected TTL value to reflect this behavior --- .../gribi/otg_tests/basic_encap_test/basic_encap_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go b/feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go index 26a330162fe1..29c7918da75b 100644 --- a/feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go +++ b/feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go @@ -364,7 +364,7 @@ func TestBasicEncap(t *testing.T) { }{ { name: fmt.Sprintf("Test1 IPv4 Traffic WCMP Encap dscp %d", dscpEncapA1), - pattr: packetAttr{dscp: dscpEncapA1, protocol: ipipProtocol}, + pattr: packetAttr{dscp: dscpEncapA1, protocol: ipipProtocol, ttl: 99}, flows: []gosnappi.Flow{fa4.getFlow("ipv4", "ip4a1", dscpEncapA1)}, weights: wantWeights, capturePorts: otgDstPorts, @@ -372,7 +372,7 @@ func TestBasicEncap(t *testing.T) { }, { name: fmt.Sprintf("Test2 IPv6 Traffic WCMP Encap dscp %d", dscpEncapA1), - pattr: packetAttr{dscp: dscpEncapA1, protocol: ipv6ipProtocol}, + pattr: packetAttr{dscp: dscpEncapA1, protocol: ipv6ipProtocol, ttl: 99}, flows: []gosnappi.Flow{fa6.getFlow("ipv6", "ip6a1", dscpEncapA1)}, weights: wantWeights, capturePorts: otgDstPorts, @@ -380,7 +380,7 @@ func TestBasicEncap(t *testing.T) { }, { name: fmt.Sprintf("Test3 IPinIP Traffic WCMP Encap dscp %d", dscpEncapA1), - pattr: packetAttr{dscp: dscpEncapA1, protocol: ipipProtocol}, + pattr: packetAttr{dscp: dscpEncapA1, protocol: ipipProtocol, ttl: 99}, flows: []gosnappi.Flow{faIPinIP.getFlow("ipv4in4", "ip4in4a1", dscpEncapA1), faIPinIP.getFlow("ipv6in4", "ip6in4a1", dscpEncapA1), }, @@ -390,7 +390,7 @@ func TestBasicEncap(t *testing.T) { }, { name: fmt.Sprintf("No Match Dscp %d Traffic", dscpEncapNoMatch), - pattr: packetAttr{protocol: udpProtocol, dscp: dscpEncapNoMatch}, + pattr: packetAttr{protocol: udpProtocol, dscp: dscpEncapNoMatch, ttl: 99}, flows: []gosnappi.Flow{fa4.getFlow("ipv4", "ip4nm", dscpEncapNoMatch)}, weights: noMatchWeight, capturePorts: otgDstPorts[:1], From f0cb7b04b29e485467035849f53a1e2578e26b40 Mon Sep 17 00:00:00 2001 From: Pramod Maurya Date: Thu, 1 Aug 2024 10:07:48 +0530 Subject: [PATCH 3/5] added valid ttl value for comparison (#3343) --- feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go b/feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go index 29c7918da75b..d5109eef5f1e 100644 --- a/feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go +++ b/feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go @@ -59,7 +59,7 @@ const ( vrfEncapB = "ENCAP_TE_VRF_B" ipv4PrefixLen = 30 ipv6PrefixLen = 126 - trafficDuration = 30 * time.Second + trafficDuration = 15 * time.Second nhg10ID = 10 nh201ID = 201 nh202ID = 202 From 7fae4311110146427c0ca50f00550add15c407ce Mon Sep 17 00:00:00 2001 From: Prem Singh <94350992+singh-prem@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:36:17 +0530 Subject: [PATCH 4/5] fixes mgt-1 : Management HA solution test (#3259) * added initial code * added deviations * taken care of review comments --- .../management_ha_test/management_ha_test.go | 38 ++++- .../management_ha_test/metadata.textproto | 12 ++ internal/cfgplugins/bgp.go | 2 +- internal/deviations/deviations.go | 15 ++ proto/metadata.proto | 7 + proto/metadata_go_proto/metadata.pb.go | 130 ++++++++++++------ 6 files changed, 156 insertions(+), 48 deletions(-) diff --git a/feature/system/management/otg_tests/management_ha_test/management_ha_test.go b/feature/system/management/otg_tests/management_ha_test/management_ha_test.go index 56dc565f3666..b1da32ac4046 100644 --- a/feature/system/management/otg_tests/management_ha_test/management_ha_test.go +++ b/feature/system/management/otg_tests/management_ha_test/management_ha_test.go @@ -18,6 +18,7 @@ import ( "fmt" "math" "sort" + "strconv" "testing" "time" @@ -31,6 +32,7 @@ import ( "github.com/openconfig/ondatra/gnmi" "github.com/openconfig/ondatra/gnmi/oc" "github.com/openconfig/ondatra/netutil" + "github.com/openconfig/ygnmi/schemaless" "github.com/openconfig/ygnmi/ygnmi" "github.com/openconfig/ygot/ygot" ) @@ -41,6 +43,7 @@ const ( prefixesCount = 1 pathID = 1 defaultRoute = "0:0:0:0:0:0:0:0" + ateNetPrefix = "2001:0db8::192:0:3:1" ) var ( @@ -80,7 +83,14 @@ func TestManagementHA1(t *testing.T) { true, true, ) - if deviations.SetNoPeerGroup(dut) { + if deviations.BgpAfiSafiInDefaultNiBeforeOtherNi(dut) { + g := bs.DUTConf.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).GetOrCreateProtocol(cfgplugins.PTBGP, "BGP").GetOrCreateBgp().GetOrCreateGlobal() + g.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_L3VPN_IPV6_UNICAST).Enabled = ygot.Bool(true) + } + bgp := bs.DUTConf.GetOrCreateNetworkInstance(mgmtVRF).GetOrCreateProtocol(cfgplugins.PTBGP, "BGP").GetOrCreateBgp() + bgp.GetOrCreateGlobal().GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).GetOrCreateUseMultiplePaths().GetOrCreateEbgp() + + if deviations.SetNoPeerGroup(dut) || deviations.PeerGroupDefEbgpVrfUnsupported(dut) { bs.DUTConf.GetOrCreateNetworkInstance(mgmtVRF).GetOrCreateProtocol(cfgplugins.PTBGP, "BGP").GetOrCreateBgp().PeerGroup = nil neighbors := bs.DUTConf.GetOrCreateNetworkInstance(mgmtVRF).GetOrCreateProtocol(cfgplugins.PTBGP, "BGP").GetOrCreateBgp().Neighbor for _, neighbor := range neighbors { @@ -193,7 +203,7 @@ func createFlowV6(t *testing.T, bs *cfgplugins.BGPSession) { e1 := v6Flow.Packet().Add().Ethernet() e1.Src().SetValues([]string{bs.ATEPorts[3].MAC}) v6 := v6Flow.Packet().Add().Ipv6() - v6.Src().SetValue(bs.ATEPorts[3].IPv6) + v6.Src().SetValue(ateNetPrefix) v6.Dst().Increment().SetStart(prefixesStart).SetCount(1) icmp1 := v6Flow.Packet().Add().Icmp() icmp1.SetEcho(gosnappi.NewFlowIcmpEcho()) @@ -249,10 +259,13 @@ func configureLoopbackOnDUT(t *testing.T, dut *ondatra.DUTDevice) { func createInterfaces(t *testing.T, dut *ondatra.DUTDevice, intfNames []string) { root := &oc.Root{} - for _, intfName := range intfNames { + for index, intfName := range intfNames { i := root.GetOrCreateInterface(intfName) + i.Type = oc.IETFInterfaces_InterfaceType_ethernetCsmacd + i.Description = ygot.String(fmt.Sprintf("Port %s", strconv.Itoa(index+1))) if intfName == netutil.LoopbackInterface(t, dut, 1) { i.Type = oc.IETFInterfaces_InterfaceType_softwareLoopback + i.Description = ygot.String(fmt.Sprintf("Port %s", intfName)) } si := i.GetOrCreateSubinterface(0) si.Enabled = ygot.Bool(true) @@ -315,7 +328,16 @@ func advertiseDUTLoopbackToATE(t *testing.T, dut *ondatra.DUTDevice, bs *cfgplug gnmi.BatchUpdate(batchSet, gnmi.OC().RoutingPolicy().Config(), rp) if deviations.TableConnectionsUnsupported(dut) { - stmt.GetOrCreateConditions().SetInstallProtocolEq(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_DIRECTLY_CONNECTED) + if deviations.RedisConnectedUnderEbgpVrfUnsupported(dut) && dut.Vendor() == ondatra.CISCO { + cliPath, err := schemaless.NewConfig[string]("", "cli") + if err != nil { + t.Fatalf("Failed to create CLI ygnmi query: %v", err) + } + cliCfg := getCiscoCLIRedisConfig("BGP", cfgplugins.DutAS, mgmtVRF) + gnmi.BatchUpdate(batchSet, cliPath, cliCfg) + } else { + stmt.GetOrCreateConditions().SetInstallProtocolEq(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_DIRECTLY_CONNECTED) + } stmt.GetOrCreateActions().PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE for _, neighbor := range []string{bs.ATEPorts[0].IPv6, bs.ATEPorts[1].IPv6} { pathV6 := gnmi.OC().NetworkInstance(mgmtVRF).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().Neighbor(neighbor).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy() @@ -396,3 +418,11 @@ func configureImportExportBGPPolicy(t *testing.T, bs *cfgplugins.BGPSession, dut func lossPct(tx, rx float64) float64 { return (math.Abs(tx-rx) * 100) / tx } + +func getCiscoCLIRedisConfig(instanceName string, as uint32, vrf string) string { + cfg := fmt.Sprintf("router bgp %d instance %s\n", as, instanceName) + cfg = cfg + fmt.Sprintf(" vrf %s\n", vrf) + cfg = cfg + " address-family ipv6 unicast\n" + cfg = cfg + " redistribute connected\n" + return cfg +} diff --git a/feature/system/management/otg_tests/management_ha_test/metadata.textproto b/feature/system/management/otg_tests/management_ha_test/metadata.textproto index e9db4bd8c9fb..bbc70c53bc11 100644 --- a/feature/system/management/otg_tests/management_ha_test/metadata.textproto +++ b/feature/system/management/otg_tests/management_ha_test/metadata.textproto @@ -33,5 +33,17 @@ platform_exceptions: { table_connections_unsupported: true } } +platform_exceptions: { + platform: { + vendor: CISCO + } + deviations: { + explicit_enable_bgp_on_default_vrf: true + peer_group_def_ebgp_vrf_unsupported: true + redis_connected_under_ebgp_vrf_unsupported: true + table_connections_unsupported: true + bgp_afi_safi_in_default_ni_before_other_ni: true + } +} tags: TAGS_TRANSIT tags: TAGS_DATACENTER_EDGE diff --git a/internal/cfgplugins/bgp.go b/internal/cfgplugins/bgp.go index c5ff799f29d3..b1b69e1b0038 100644 --- a/internal/cfgplugins/bgp.go +++ b/internal/cfgplugins/bgp.go @@ -93,7 +93,7 @@ var ( Name: "port4", IPv4: "192.0.2.13", IPv4Len: plenIPv4, - IPv6: "2001:0db8::192:0:2:13", + IPv6: "2001:0db8::192:0:2:d", IPv6Len: plenIPv6, } diff --git a/internal/deviations/deviations.go b/internal/deviations/deviations.go index e2a1ff733ef3..0f250afa0876 100644 --- a/internal/deviations/deviations.go +++ b/internal/deviations/deviations.go @@ -1108,3 +1108,18 @@ func BgpExplicitExtendedCommunityEnable(dut *ondatra.DUTDevice) bool { func MatchTagSetConditionUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetMatchTagSetConditionUnsupported() } + +// PeerGroupDefEbgpVrfUnsupported returns true if peer group definition under ebgp vrf is unsupported +func PeerGroupDefEbgpVrfUnsupported(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetPeerGroupDefEbgpVrfUnsupported() +} + +// RedisConnectedUnderEbgpVrfUnsupported returns true if redistribution of routes under ebgp vrf is unsupported +func RedisConnectedUnderEbgpVrfUnsupported(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetRedisConnectedUnderEbgpVrfUnsupported() +} + +// BgpAfiSafiInDefaultNiBeforeOtherNi returns true if certain AFI SAFIs are configured in default network instance before other network instances +func BgpAfiSafiInDefaultNiBeforeOtherNi(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetBgpAfiSafiInDefaultNiBeforeOtherNi() +} diff --git a/proto/metadata.proto b/proto/metadata.proto index 497bfe67434e..49580f362cca 100644 --- a/proto/metadata.proto +++ b/proto/metadata.proto @@ -598,6 +598,13 @@ message Metadata { bool bgp_explicit_extended_community_enable = 208; // devices that do not support match tag set condition bool match_tag_set_condition_unsupported = 209; + // peer_group_def_bgp_vrf_unsupported is set to true for devices that do not support peer group definition under bgp vrf configuration. + bool peer_group_def_ebgp_vrf_unsupported = 210; + // redis_uconnected_under_ebgp_vrf_unsupported is set to true for devices that do not support redistribution of connected routes under ebgp vrf configuration. + bool redis_connected_under_ebgp_vrf_unsupported = 211; + // bgp_afisafi_in_default_ni_before_other_ni is set to true for devices that require certain afi/safis to be enabled + // in default network instance (ni) before enabling afi/safis for neighbors in default or non-default ni. + bool bgp_afi_safi_in_default_ni_before_other_ni = 212; // Reserved field numbers and identifiers. reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35; diff --git a/proto/metadata_go_proto/metadata.pb.go b/proto/metadata_go_proto/metadata.pb.go index a6e6e9a7546d..5c748e84a7d2 100644 --- a/proto/metadata_go_proto/metadata.pb.go +++ b/proto/metadata_go_proto/metadata.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.25.1 // source: metadata.proto package metadata_go_proto @@ -880,6 +880,13 @@ type Metadata_Deviations struct { BgpExplicitExtendedCommunityEnable bool `protobuf:"varint,208,opt,name=bgp_explicit_extended_community_enable,json=bgpExplicitExtendedCommunityEnable,proto3" json:"bgp_explicit_extended_community_enable,omitempty"` // devices that do not support match tag set condition MatchTagSetConditionUnsupported bool `protobuf:"varint,209,opt,name=match_tag_set_condition_unsupported,json=matchTagSetConditionUnsupported,proto3" json:"match_tag_set_condition_unsupported,omitempty"` + // peer_group_def_bgp_vrf_unsupported is set to true for devices that do not support peer group definition under bgp vrf configuration. + PeerGroupDefEbgpVrfUnsupported bool `protobuf:"varint,210,opt,name=peer_group_def_ebgp_vrf_unsupported,json=peerGroupDefEbgpVrfUnsupported,proto3" json:"peer_group_def_ebgp_vrf_unsupported,omitempty"` + // redis_uconnected_under_ebgp_vrf_unsupported is set to true for devices that do not support redistribution of connected routes under ebgp vrf configuration. + RedisConnectedUnderEbgpVrfUnsupported bool `protobuf:"varint,211,opt,name=redis_connected_under_ebgp_vrf_unsupported,json=redisConnectedUnderEbgpVrfUnsupported,proto3" json:"redis_connected_under_ebgp_vrf_unsupported,omitempty"` + // bgp_afisafi_in_default_ni_before_other_ni is set to true for devices that require certain afi/safis to be enabled + // in default network instance (ni) before enabling afi/safis for neighbors in default or non-default ni. + BgpAfiSafiInDefaultNiBeforeOtherNi bool `protobuf:"varint,212,opt,name=bgp_afi_safi_in_default_ni_before_other_ni,json=bgpAfiSafiInDefaultNiBeforeOtherNi,proto3" json:"bgp_afi_safi_in_default_ni_before_other_ni,omitempty"` } func (x *Metadata_Deviations) Reset() { @@ -2251,6 +2258,27 @@ func (x *Metadata_Deviations) GetMatchTagSetConditionUnsupported() bool { return false } +func (x *Metadata_Deviations) GetPeerGroupDefEbgpVrfUnsupported() bool { + if x != nil { + return x.PeerGroupDefEbgpVrfUnsupported + } + return false +} + +func (x *Metadata_Deviations) GetRedisConnectedUnderEbgpVrfUnsupported() bool { + if x != nil { + return x.RedisConnectedUnderEbgpVrfUnsupported + } + return false +} + +func (x *Metadata_Deviations) GetBgpAfiSafiInDefaultNiBeforeOtherNi() bool { + if x != nil { + return x.BgpAfiSafiInDefaultNiBeforeOtherNi + } + return false +} + type Metadata_PlatformExceptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2314,7 +2342,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x72, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x65, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x76, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x78, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, @@ -2348,7 +2376,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x67, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x0e, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x5f, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xf2, 0x6d, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xf5, 0x6f, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x70, 0x76, 0x34, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x70, 0x76, 0x34, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x45, @@ -3223,45 +3251,61 @@ var file_metadata_proto_rawDesc = []byte{ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0xd1, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x67, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x73, - 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x54, 0x10, 0x55, 0x4a, 0x04, - 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, 0x14, 0x10, 0x15, - 0x4a, 0x04, 0x08, 0x5a, 0x10, 0x5b, 0x4a, 0x04, 0x08, 0x61, 0x10, 0x62, 0x4a, 0x04, 0x08, 0x37, - 0x10, 0x38, 0x4a, 0x04, 0x08, 0x59, 0x10, 0x5a, 0x4a, 0x04, 0x08, 0x13, 0x10, 0x14, 0x4a, 0x04, - 0x08, 0x24, 0x10, 0x25, 0x4a, 0x04, 0x08, 0x23, 0x10, 0x24, 0x1a, 0xa0, 0x01, 0x0a, 0x12, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x41, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x47, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfa, 0x01, - 0x0a, 0x07, 0x54, 0x65, 0x73, 0x74, 0x62, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x53, - 0x54, 0x42, 0x45, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, - 0x54, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, - 0x55, 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x02, 0x12, - 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, - 0x54, 0x45, 0x5f, 0x32, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x54, - 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x34, - 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, - 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x39, 0x4c, 0x49, 0x4e, 0x4b, - 0x53, 0x5f, 0x4c, 0x41, 0x47, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, - 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x32, - 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, - 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x38, 0x4c, 0x49, 0x4e, 0x4b, - 0x53, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, - 0x55, 0x54, 0x5f, 0x34, 0x30, 0x30, 0x5a, 0x52, 0x10, 0x08, 0x22, 0x6d, 0x0a, 0x04, 0x54, 0x61, - 0x67, 0x73, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, - 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x18, - 0x0a, 0x14, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x43, 0x45, 0x4e, 0x54, 0x45, - 0x52, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x41, 0x47, 0x53, - 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x41, 0x47, 0x53, 0x5f, - 0x54, 0x52, 0x41, 0x4e, 0x53, 0x49, 0x54, 0x10, 0x04, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x4c, 0x0a, 0x23, 0x70, 0x65, 0x65, 0x72, + 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x64, 0x65, 0x66, 0x5f, 0x65, 0x62, 0x67, 0x70, 0x5f, + 0x76, 0x72, 0x66, 0x5f, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, + 0xd2, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1e, 0x70, 0x65, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x44, 0x65, 0x66, 0x45, 0x62, 0x67, 0x70, 0x56, 0x72, 0x66, 0x55, 0x6e, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x5a, 0x0a, 0x2a, 0x72, 0x65, 0x64, 0x69, 0x73, 0x5f, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x5f, + 0x65, 0x62, 0x67, 0x70, 0x5f, 0x76, 0x72, 0x66, 0x5f, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x18, 0xd3, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x25, 0x72, 0x65, 0x64, + 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x55, 0x6e, 0x64, 0x65, 0x72, + 0x45, 0x62, 0x67, 0x70, 0x56, 0x72, 0x66, 0x55, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x12, 0x57, 0x0a, 0x2a, 0x62, 0x67, 0x70, 0x5f, 0x61, 0x66, 0x69, 0x5f, 0x73, 0x61, + 0x66, 0x69, 0x5f, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6e, 0x69, + 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x6e, 0x69, + 0x18, 0xd4, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x22, 0x62, 0x67, 0x70, 0x41, 0x66, 0x69, 0x53, + 0x61, 0x66, 0x69, 0x49, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4e, 0x69, 0x42, 0x65, + 0x66, 0x6f, 0x72, 0x65, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x4e, 0x69, 0x4a, 0x04, 0x08, 0x54, 0x10, + 0x55, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, + 0x14, 0x10, 0x15, 0x4a, 0x04, 0x08, 0x5a, 0x10, 0x5b, 0x4a, 0x04, 0x08, 0x61, 0x10, 0x62, 0x4a, + 0x04, 0x08, 0x37, 0x10, 0x38, 0x4a, 0x04, 0x08, 0x59, 0x10, 0x5a, 0x4a, 0x04, 0x08, 0x13, 0x10, + 0x14, 0x4a, 0x04, 0x08, 0x24, 0x10, 0x25, 0x4a, 0x04, 0x08, 0x23, 0x10, 0x24, 0x1a, 0xa0, 0x01, + 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x47, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0xfa, 0x01, 0x0a, 0x07, 0x54, 0x65, 0x73, 0x74, 0x62, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x13, + 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, + 0x5f, 0x44, 0x55, 0x54, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, + 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, 0x4c, 0x49, 0x4e, 0x4b, 0x53, + 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, + 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x32, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x03, 0x12, 0x1a, + 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, + 0x45, 0x5f, 0x34, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, + 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x39, 0x4c, + 0x49, 0x4e, 0x4b, 0x53, 0x5f, 0x4c, 0x41, 0x47, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, + 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, + 0x45, 0x5f, 0x32, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, + 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x38, 0x4c, + 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, + 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, 0x30, 0x30, 0x5a, 0x52, 0x10, 0x08, 0x22, 0x6d, 0x0a, + 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, + 0x41, 0x47, 0x53, 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, + 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x43, 0x45, + 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x54, + 0x41, 0x47, 0x53, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x41, + 0x47, 0x53, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x49, 0x54, 0x10, 0x04, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( From 8510c9825899c7adc2280c6414a276b6a79d6b93 Mon Sep 17 00:00:00 2001 From: ihebboubaker <126072465+ihebboubaker@users.noreply.github.com> Date: Thu, 1 Aug 2024 23:28:09 +0100 Subject: [PATCH 5/5] Create a Readme for DP-1.16: Ingress traffic classification and rewrite (#3020) * Create README DP-1.16: Ingress traffic classification and rewrite --- .../README.md | 154 ++++++++++++++++++ testregistry.textproto | 6 + 2 files changed, 160 insertions(+) create mode 100644 feature/qos/otg_tests/ingress_traffic_classification_and_rewrite_test/README.md diff --git a/feature/qos/otg_tests/ingress_traffic_classification_and_rewrite_test/README.md b/feature/qos/otg_tests/ingress_traffic_classification_and_rewrite_test/README.md new file mode 100644 index 000000000000..ea81528919c1 --- /dev/null +++ b/feature/qos/otg_tests/ingress_traffic_classification_and_rewrite_test/README.md @@ -0,0 +1,154 @@ +# DP-1.16: Ingress traffic classification and rewrite + +## Summary + +This test aims to validate the functionality of ingress traffic classification and subsequent packet remarking (rewrite) on a Device Under Test (DUT). The DUT's configuration will be evaluated against the OpenConfig QOS model, and traffic flows will be analyzed to ensure proper classification, marking, and forwarding. + +## Testbed type + +* [`featureprofiles/topologies/atedut_2.testbed`](https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed) + +## Procedure + +### Test environment setup + +* DUT has an ingress port and 1 egress port. + + ``` + | | + [ ATE Port 1 ] ---- | DUT | ---- [ ATE Port 2 ] + | | + ``` + +* Configure the DUT's ingress and egress interfaces. + +### Configuration + +* Apply QoS classifiers using the OpenConfig QOS model, matching packets based on DSCP/TC/EXP values as per the classification table. +* Configure packet remarking rules based on the marking table. +* QoS Classification and Marking table + + * Classification table + + IPv4 TOS | IPv6 TC | MPLS EXP | Forwarding Group + ------------- | ----------------------- | ----------------------- | --------------------- + 0 | 0-7 | 0 | be1 + 1 | 8-15 | 1 | af1 + 2 | 16-23 | 2 | af2 + 3 | 24-31 | 3 | af3 + 4,5 | 32-47 | 4,5 | af4 + 6,7 | 48-63 | 6,7 | nc1 + + * Marking table + + Forwarding Group | IPv4 TOS | IPv6 TC | MPLS EXP + --------------------|------------- | ----------------------- | ----------------------- + be1 | 0 | 0 | 0 + af1 | 1 | 8 | 1 + af2 | 2 | 16 | 2 + af3 | 3 | 24 | 3 + af4 | 4 | 32 | 4 + nc1 | 6 | 48 | 6 + +### DP-1.16.1 Ingress Classification and rewrite of IPv4 packets with various DSCP values + +* Traffic: + * Generate IPv4 traffic from ATE Port 1 with various DSCP values +* Verfication: + * Monitor telemetry on the DUT to verify that packets are being matched to the correct classifier terms. + * Capture packets on the ATE's ingress interface to verify packet marking according to the marking table. + * Analyze traffic flows to confirm that no packets are dropped on the DUT. +### DP-1.16.2 Ingress Classification and rewrite of IPv6 packets with various TC values + +* Traffic: + * Generate IPv6 traffic from ATE Port 1 with various TC values +* Verfication: + * Monitor telemetry on the DUT to verify that packets are being matched to the correct classifier terms. + * Capture packets on the ATE's ingress interface to verify packet marking according to the marking table. + * Analyze traffic flows to confirm that no packets are dropped on the DUT. +### DP-1.16.3 Ingress Classification and rewrite of MPLS traffic with swap action + +* Configuration: + * Configure Static MPLS LSP MPLS swap/forward actions for a specific labels range (100101-100200). +* Traffic: + * Generate MPLS traffic from ATE Port 1 with labels between 1000101 and 1000200 +* Verfication: + * Monitor telemetry on the DUT to verify that packets are being matched to the correct classifier terms. + * Capture packets on the ATE's ingress interface to verify packet marking according to the marking table. + * Analyze traffic flows to confirm that no packets are dropped on the DUT. +### DP-1.16.4 Ingress Classification and rewrite of IPv4-over-MPLS traffic with pop action + +* Configuration: + * Configure Static MPLS LSP with MPLS pop and IPv4/IPv6 forward actions for a specific labels range (100020-100100). +* Traffic: + * Generate MPLS traffic from ATE Port 1 with labels between 100020 and 1000100 +* Verfication: + * Monitor telemetry on the DUT to verify that packets are being matched to the correct classifier terms. + * Capture packets on the ATE's ingress interface to verify packet marking according to the marking table. + * Analyze traffic flows to confirm that no packets are dropped on the DUT. +### DP-1.16.5 Ingress Classification and rewrite of IPv6-over-MPLS traffic with pop action + +* Configuration: + * Configure Static MPLS LSP with MPLS pop and IPv4/IPv6 forward actions for a specific labels range (100020-100100). +* Traffic: + * Generate MPLS traffic from ATE Port 1 with labels between 100020 and 1000100 +* Verfication: + * Monitor telemetry on the DUT to verify that packets are being matched to the correct classifier terms. + * Capture packets on the ATE's ingress interface to verify packet marking according to the marking table. + * Analyze traffic flows to confirm that no packets are dropped on the DUT. +### DP-1.16.6 Ingress Classification and rewrite of IPv4 packets traffic with label push action + +* Configuration: + * Configure Static MPLS LSP with MPLS label (=100201) push action to a IPv4 subnet destination DST1. +* Traffic: + * Generate IPv4 traffic from ATE Port 1 with destinations matching DST1. +* Verfication: + * Monitor telemetry on the DUT to verify that packets are being matched to the correct classifier terms. + * Capture packets on the ATE's ingress interface to verify packet marking according to the marking table. + * Analyze traffic flows to confirm that no packets are dropped on the DUT. +### DP-1.16.7 Ingress Classification and rewrite of IPv6 packets traffic with label push action + +* Configuration: + * Configure Static MPLS LSP with MPLS label (=100202) push action to a IPv6 subnet destination DST2. +* Traffic: + * Generate IPv6 traffic from ATE Port 1 with destinations matching DST2. +* Verfication: + * Monitor telemetry on the DUT to verify that packets are being matched to the correct classifier terms. + * Capture packets on the ATE's ingress interface to verify packet marking according to the marking table. + * Analyze traffic flows to confirm that no packets are dropped on the DUT. + +## OpenConfig Path and RPC Coverage + +The below yaml defines the OC paths intended to be covered by this test. + +```yaml +paths: + ## Config paths + /qos/classifiers/classifier/config/name: + /qos/classifiers/classifier/config/type: + /qos/classifiers/classifier/terms/term/config/id: + /qos/classifiers/classifier/terms/term/actions/config/target-group: + /qos/classifiers/classifier/terms/term/conditions/ipv4/config/dscp: + /qos/classifiers/classifier/terms/term/conditions/ipv4/config/dscp-set: + /qos/classifiers/classifier/terms/term/conditions/ipv6/config/dscp: + /qos/classifiers/classifier/terms/term/conditions/ipv6/config/dscp-set: + /qos/classifiers/classifier/terms/term/conditions/mpls/config/traffic-class: + /qos/classifiers/classifier/terms/term/actions/remark/config/set-dscp: + /qos/classifiers/classifier/terms/term/actions/remark/config/set-mpls-tc: + /qos/interfaces/interface/input/classifiers/classifier/config/name: + /qos/interfaces/interface/input/classifiers/classifier/config/type: + + ## State paths + /qos/interfaces/interface/input/classifiers/classifier/terms/term/state/matched-packets: + /qos/interfaces/interface/input/classifiers/classifier/terms/term/state/matched-octets: + +rpcs: + gnmi: + gNMI.Set: + gNMI.Subscribe: +``` + +## Minimum DUT platform requirement + +* MFF - A modular form factor device containing LINECARDs, FABRIC and redundant CONTROLLER_CARD components +* FFF - fixed form factor diff --git a/testregistry.textproto b/testregistry.textproto index 936cf7dccca9..c828b1105790 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -202,6 +202,12 @@ test: { readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/qos/ecn/otg_tests/DSCP-transparency/README.md" exec: " " } +test: { + id: "DP-1.16" + description: "Ingress traffic classification and rewrite" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/qos/otg_tests/ingress_traffic_classification_and_rewrite_test/README.md" + exec: " " +} test: { id: "DP-1.2" description: "QoS policy feature config"