Skip to content

Commit

Permalink
Merge branch 'main' into rt154
Browse files Browse the repository at this point in the history
  • Loading branch information
ram-mac authored Nov 15, 2024
2 parents 58ed1dc + 5bdab86 commit 2c53f6d
Show file tree
Hide file tree
Showing 16 changed files with 283 additions and 303 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ var (
extCommunitySet = map[string]string{
"linkbw_1M": "link-bandwidth:23456:1M",
"linkbw_2G": "link-bandwidth:23456:2G",
"linkbw_any": "^link-bandwidth:.*:.$",
"linkbw_any": "^link-bandwidth:.*:.*$",
}

extCommunitySetCisco = map[string]string{
"linkbw_1M": "23456:1000000",
"linkbw_2G": "23456:2000000000",
"linkbw_any": "^.*:.$",
"linkbw_any": "^.*:.*$",
}

CommunitySet = map[string]string{
Expand Down
49 changes: 21 additions & 28 deletions feature/isis/otg_tests/weighted_ecmp_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,25 @@ G[DUT:LAG4] <-- IBGP+IS-IS --> H[LAG3:ATE2];

## Procedure

In the topology above,

* Configure 1xLAG interface between ATE1<->DUT and 3xLAG interfaces between
DUT and ATE2. Each LAG interface is expected to be of 2x100Gbps

* Configure IPv4 and IPv6 L2 adjacencies between DUT and ATE LAG bundles.
Therefore, DUT will have 1xIS-IS adjacency with ATE1 i.e.
DUT:LAG1<->ATE1:LAG1, and 3xIS-IS adjacencies with ATE2 i.e.
DUT:LAG2<->ATE2:LAG1, DUT:LAG3<->ATE2:LAG2 and DUT:LAG4<->ATE2:LAG3

* /network-instances/network-instance/protocols/protocol/isis/global/afi-safi

* /network-instances/network-instance/protocols/protocol/isis/global/config/level-capability,
set to LEVEL_2

* /network-instances/network-instance/protocols/protocol/isis/levels/level/config/metric-style
set to WIDE_METRIC
### Test environment setup

* Configure 1 aggregate interface with 2 100GE ports between DUT and ATE1
* Configure 3 aggregate interfaces, each with 2 100GE ports between DUT and ATE2.
* Configure IPv4 and IPv6 L2 adjacencies between DUT and ATE aggregate interfaces.
Therefore, DUT will have
* 1xIS-IS adjacency with ATE1 DUT:LAG1<->ATE1:LAG1,
* 3xIS-IS adjacencies between DUT and ATE2
* DUT:LAG2<->ATE2:LAG1
* DUT:LAG3<->ATE2:LAG2
* DUT:LAG4<->ATE2:LAG3

* Set ISIS parameters as
* /network-instances/network-instance/protocols/protocol/isis/global/
* afi-safi/af/config/afi-name: IPV4, IPV6
* afi-safi/af/config/safi-name: UNICAST
* afi-safi/af/config/enabled: true
* config/level-capability = LEVEL_2
* /network-instances/network-instance/protocols/protocol/isis/levels/level/config/metric-style = WIDE_METRIC

* Configure IPv4 and IPv6 IBGP peering between both ATEs and the DUT using
their loopback addresses for both IPv4 and IPv6 address families.
Expand Down Expand Up @@ -74,7 +76,7 @@ In the topology above,
* /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/weighted-ecmp/config/load-balancing-weight
set to Auto

## RT-9.1: Equal distribution of traffic
## RT-2.13.1: Equal distribution of traffic

* Start 1024 flows from IPv4 addresses in 100.0.2.0/24 to 100.0.1.0/24

Expand Down Expand Up @@ -114,7 +116,7 @@ In the topology above,

* /interfaces/interface/state/counters/in-pkts

## RT-9.2: Unequal distribution of traffic
## RT-2.13.2: Unequal distribution of traffic

* Stop traffic from RT-9.1 and introduce a failure by disabling one of the
member interfaces in ATE2:LAG1.
Expand Down Expand Up @@ -142,17 +144,8 @@ In the topology above,

* /interfaces/interface/state/counters/in-pkts

### Config paths

### Telemetry Parameter Coverage

## 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.

TODO(OCPATH): Container path originally part of spec that needs to be separated
into leaves: /routing-policy/defined-sets/prefix-sets/prefix-set:

```yaml
paths:
## Config Paths ##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"time"

"github.com/openconfig/featureprofiles/internal/fptest"
"github.com/openconfig/gnsi/acctz"
acctzpb "github.com/openconfig/gnsi/acctz"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/gnmi"
"google.golang.org/protobuf/types/known/timestamppb"
Expand All @@ -47,7 +47,7 @@ func TestAccountzRecordHistoryTruncation(t *testing.T) {
t.Fatalf("Failed getting accountz record subscribe client, error: %s", err)
}

err = acctzSubClient.Send(&acctz.RecordRequest{
err = acctzSubClient.Send(&acctzpb.RecordRequest{
Timestamp: timestamppb.New(recordStartTime),
})
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"time"

"github.com/openconfig/featureprofiles/internal/fptest"
"github.com/openconfig/gnsi/acctz"
acctzpb "github.com/openconfig/gnsi/acctz"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/gnmi"
"github.com/openconfig/ondatra/gnmi/oc"
Expand All @@ -33,7 +33,7 @@ func TestMain(m *testing.M) {
}

type recordRequestResult struct {
record *acctz.RecordResponse
record *acctzpb.RecordResponse
err error
}

Expand Down Expand Up @@ -66,7 +66,7 @@ func TestAccountzRecordPayloadTruncation(t *testing.T) {
t.Fatalf("Failed getting accountz record subscribe client, error: %s", err)
}

err = acctzSubClient.Send(&acctz.RecordRequest{
err = acctzSubClient.Send(&acctzpb.RecordRequest{
Timestamp: timestamppb.New(startTime),
})
if err != nil {
Expand All @@ -77,7 +77,7 @@ func TestAccountzRecordPayloadTruncation(t *testing.T) {
r := make(chan recordRequestResult)

go func(r chan recordRequestResult) {
var response *acctz.RecordResponse
var response *acctzpb.RecordResponse
response, err = acctzSubClient.Recv()
r <- recordRequestResult{
record: response,
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestAccountzRecordPayloadTruncation(t *testing.T) {

grpcServiceRecord := resp.record.GetGrpcService()

if grpcServiceRecord.GetServiceType() != acctz.GrpcService_GRPC_SERVICE_TYPE_GNMI {
if grpcServiceRecord.GetServiceType() != acctzpb.GrpcService_GRPC_SERVICE_TYPE_GNMI {
// Not our gnmi set, nothing to see here.
continue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestMain(m *testing.M) {
fptest.RunTests(m)
}

func prettyPrint(i interface{}) string {
func prettyPrint(i any) string {
s, _ := json.MarshalIndent(i, "", "\t")
return string(s)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestMain(m *testing.M) {
fptest.RunTests(m)
}

func prettyPrint(i interface{}) string {
func prettyPrint(i any) string {
s, _ := json.MarshalIndent(i, "", "\t")
return string(s)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestMain(m *testing.M) {
fptest.RunTests(m)
}

func prettyPrint(i interface{}) string {
func prettyPrint(i any) string {
s, _ := json.MarshalIndent(i, "", "\t")
return string(s)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ dut.testbed

## Minimum DUT platform
FFF

## OpenConfig Path and RPC Coverage

```yaml
rpcs:
gnmi:
gNMI.Get:
gNMI.Subscribe:

```
Original file line number Diff line number Diff line change
Expand Up @@ -49,57 +49,6 @@ func TestMain(m *testing.M) {
fptest.RunTests(m)
}

// getDeviceConfig gets a full config from a device but refurbishes it enough so it can be
// pushed out again
func getDeviceConfig(t testing.TB, dev gnmi.DeviceOrOpts) *oc.Root {
config := gnmi.Get[*oc.Root](t, dev, gnmi.OC().Config())
fptest.WriteQuery(t, "Untouched", gnmi.OC().Config(), config)

for cname, component := range config.Component {
// Keep the port components in order to preserve the breakout-mode config.
if component.GetPort() == nil {
delete(config.Component, cname)
continue
}
// Need to prune subcomponents that may have a leafref to a component that was
// pruned.
component.Subcomponent = nil
}

for iname, iface := range config.Interface {
if iface.GetEthernet() == nil {
continue
}
// Ethernet config may not contain meaningful values if it wasn't explicitly
// configured, so use its current state for the config, but prune non-config leaves.
intf := gnmi.Get(t, dev, gnmi.OC().Interface(iname).State())
breakout := config.GetComponent(intf.GetHardwarePort()).GetPort().GetBreakoutMode()
e := intf.GetEthernet()
// Set port speed to unknown for non breakout interfaces
if breakout.GetGroup(1) == nil && e != nil {
e.SetPortSpeed(oc.IfEthernet_ETHERNET_SPEED_SPEED_UNKNOWN)
}
ygot.PruneConfigFalse(oc.SchemaTree["Interface_Ethernet"], e)
if e.PortSpeed != 0 && e.PortSpeed != oc.IfEthernet_ETHERNET_SPEED_SPEED_UNKNOWN {
iface.Ethernet = e
}
}

if config.Lldp != nil {
config.Lldp.ChassisId = nil
config.Lldp.ChassisIdType = oc.Lldp_ChassisIdType_UNSET
}

config.Qos = nil

for _, ni := range config.NetworkInstance {
ni.Fdb = nil
}

fptest.WriteQuery(t, "Touched", gnmi.OC().Config(), config)
return config
}

// setEthernetFromBase merges the ethernet config from the interfaces in base config into
// the destination config.
func setEthernetFromBase(t testing.TB, config *oc.Root) {
Expand Down Expand Up @@ -244,8 +193,7 @@ func checkMetadata1(t *testing.T, gnmiClient gpb.GNMIClient, dut *ondatra.DUTDev
t.Helper()
got, getRespTimeStamp := extractMetadataAnnotation(t, gnmiClient, dut)
want := metadata1
t.Logf("getResp: %v ", getRespTimeStamp)
if got != want && done.Load() == 0 {
if got != want && getRespTimeStamp < done.Load() {
t.Errorf("extractMetadataAnnotation: got %v, want %v", got, want)
}
}
Expand All @@ -268,13 +216,15 @@ func TestLargeSetConsistency(t *testing.T) {
p1 := dut.Port(t, "port1")
p2 := dut.Port(t, "port2")

fptest.ConfigureDefaultNetworkInstance(t, dut)

// Configuring basic interface and network instance as some devices only populate OC after configuration.
gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Config(), dutPort1.NewOCInterface(p1.Name(), dut))
gnmi.Replace(t, dut, gnmi.OC().Interface(p2.Name()).Config(), dutPort2.NewOCInterface(p2.Name(), dut))
gnmi.Replace(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Type().Config(),
oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE)

baselineConfig := getDeviceConfig(t, dut)
baselineConfig := fptest.GetDeviceConfig(t, dut)
setEthernetFromBase(t, baselineConfig)
gnmiClient := dut.RawAPIs().GNMI(t)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ platform_exceptions: {
default_network_instance: "default"
}
}
platform_exceptions: {
platform: {
vendor: CISCO
}
deviations: {
skip_macaddress_check: true
}
}

Loading

0 comments on commit 2c53f6d

Please sign in to comment.