Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CISCO deviation for RT-1.26 #3639

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,66 +228,70 @@ func TestBasicStaticRouteSupport(t *testing.T) {

func TestStaticRouteAddRemove(t *testing.T) {
dut := ondatra.DUT(t, "dut")
configureDUT(t, dut)

ate := ondatra.ATE(t, "ate")
top := gosnappi.NewConfig()
configureOTG(t, ate, top)

ate.OTG().PushConfig(t, top)
ate.OTG().StartProtocols(t)
defer ate.OTG().StopProtocols(t)
otgutils.WaitForARP(t, ate.OTG(), top, "IPv4")

prefix := ipAddr{address: v4Route, prefix: v4RoutePrefix}
b := &gnmi.SetBatch{}
sV4 := &cfgplugins.StaticRouteCfg{
NetworkInstance: deviations.DefaultNetworkInstance(dut),
Prefix: prefix.cidr(t),
NextHops: map[string]oc.NetworkInstance_Protocol_Static_NextHop_NextHop_Union{
"0": oc.UnionString(atePort2.IPv4),
"1": oc.UnionString(atePort3.IPv4),
},
}
if _, err := cfgplugins.NewStaticRouteCfg(b, sV4, dut); err != nil {
t.Fatalf("Failed to configure IPv4 static route: %v", err)
}
b.Set(t, dut)
validateStaticRoute(t, dut, prefix.cidr(t), sV4)
if deviations.StaticRouteAddRemoveUnsupported(dut) {
t.Skip("StaticRouteAddRemove is unsupported")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test case cannot be skipped . A alternate functionality via cli or alternate path has to be added here.
Please refer to 'https://github.com/openconfig/featureprofiles/blob/main/internal/deviations/README.md'

} else {
configureDUT(t, dut)

ate := ondatra.ATE(t, "ate")
top := gosnappi.NewConfig()
configureOTG(t, ate, top)

ate.OTG().PushConfig(t, top)
ate.OTG().StartProtocols(t)
defer ate.OTG().StopProtocols(t)
otgutils.WaitForARP(t, ate.OTG(), top, "IPv4")

prefix := ipAddr{address: v4Route, prefix: v4RoutePrefix}
b := &gnmi.SetBatch{}
sV4 := &cfgplugins.StaticRouteCfg{
NetworkInstance: deviations.DefaultNetworkInstance(dut),
Prefix: prefix.cidr(t),
NextHops: map[string]oc.NetworkInstance_Protocol_Static_NextHop_NextHop_Union{
"0": oc.UnionString(atePort2.IPv4),
"1": oc.UnionString(atePort3.IPv4),
},
}
if _, err := cfgplugins.NewStaticRouteCfg(b, sV4, dut); err != nil {
t.Fatalf("Failed to configure IPv4 static route: %v", err)
}
b.Set(t, dut)
validateStaticRoute(t, dut, prefix.cidr(t), sV4)

// add 2 new nextHops, one at 0 index and another at 3 index
b = &gnmi.SetBatch{}
sV4 = &cfgplugins.StaticRouteCfg{
NetworkInstance: deviations.DefaultNetworkInstance(dut),
Prefix: prefix.cidr(t),
NextHops: map[string]oc.NetworkInstance_Protocol_Static_NextHop_NextHop_Union{
"0": oc.UnionString(atePort1.IPv4),
"1": oc.UnionString(atePort2.IPv4),
"2": oc.UnionString(atePort3.IPv4),
"3": oc.UnionString(atePort4.IPv4),
},
}
if _, err := cfgplugins.NewStaticRouteCfg(b, sV4, dut); err != nil {
t.Fatalf("Failed to configure IPv4 static route: %v", err)
}
b.Set(t, dut)
validateStaticRoute(t, dut, prefix.cidr(t), sV4)
// add 2 new nextHops, one at 0 index and another at 3 index
b = &gnmi.SetBatch{}
sV4 = &cfgplugins.StaticRouteCfg{
NetworkInstance: deviations.DefaultNetworkInstance(dut),
Prefix: prefix.cidr(t),
NextHops: map[string]oc.NetworkInstance_Protocol_Static_NextHop_NextHop_Union{
"0": oc.UnionString(atePort1.IPv4),
"1": oc.UnionString(atePort2.IPv4),
"2": oc.UnionString(atePort3.IPv4),
"3": oc.UnionString(atePort4.IPv4),
},
}
if _, err := cfgplugins.NewStaticRouteCfg(b, sV4, dut); err != nil {
t.Fatalf("Failed to configure IPv4 static route: %v", err)
}
b.Set(t, dut)
validateStaticRoute(t, dut, prefix.cidr(t), sV4)

// remove previously added indexes
b = &gnmi.SetBatch{}
sV4 = &cfgplugins.StaticRouteCfg{
NetworkInstance: deviations.DefaultNetworkInstance(dut),
Prefix: prefix.cidr(t),
NextHops: map[string]oc.NetworkInstance_Protocol_Static_NextHop_NextHop_Union{
"0": oc.UnionString(atePort2.IPv4),
"1": oc.UnionString(atePort3.IPv4),
},
}
if _, err := cfgplugins.NewStaticRouteCfg(b, sV4, dut); err != nil {
t.Fatalf("Failed to configure IPv4 static route: %v", err)
// remove previously added indexes
b = &gnmi.SetBatch{}
sV4 = &cfgplugins.StaticRouteCfg{
NetworkInstance: deviations.DefaultNetworkInstance(dut),
Prefix: prefix.cidr(t),
NextHops: map[string]oc.NetworkInstance_Protocol_Static_NextHop_NextHop_Union{
"0": oc.UnionString(atePort2.IPv4),
"1": oc.UnionString(atePort3.IPv4),
},
}
if _, err := cfgplugins.NewStaticRouteCfg(b, sV4, dut); err != nil {
t.Fatalf("Failed to configure IPv4 static route: %v", err)
}
b.Set(t, dut)
validateStaticRoute(t, dut, prefix.cidr(t), sV4)
}
b.Set(t, dut)
validateStaticRoute(t, dut, prefix.cidr(t), sV4)
}

func validateStaticRoute(t *testing.T, dut *ondatra.DUTDevice, prefix string, sV4 *cfgplugins.StaticRouteCfg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ platform_exceptions: {
unsupported_static_route_next_hop_recurse: true
static_route_with_explicit_metric: true
interface_ref_config_unsupported: true
static_route_add_remove_unsupported: true
}
}
platform_exceptions: {
Expand Down
5 changes: 5 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@
return lookupDUTDeviations(dut).GetBgpAfiSafiWildcardNotSupported()
}

// Admin Enable Table Connections in SRL native

Check failure on line 1237 in internal/deviations/deviations.go

View workflow job for this annotation

GitHub Actions / Static Analysis

comment on exported function EnableTableConnections should be of the form "EnableTableConnections ..."
func EnableTableConnections(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetEnableTableConnections()
}
Expand All @@ -1243,3 +1243,8 @@
func NoZeroSuppression(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetNoZeroSuppression()
}

// StaticRouteAddRemoveUnsupported returns true if adding/removing static route (static route ECMP feature) is not supported
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kindly add the reference bug here

func StaticRouteAddRemoveUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetStaticRouteAddRemoveUnsupported()
}
2 changes: 2 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@ message Metadata {
// Device has default zero suppression.
// Juniper : b/378646018
bool no_zero_suppression = 237;
// Static route add & remove not supported
bool static_route_add_remove_unsupported = 238;
// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
}
Expand Down
98 changes: 56 additions & 42 deletions proto/metadata_go_proto/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading