Skip to content

Commit

Permalink
Merge branch 'main' into fixc
Browse files Browse the repository at this point in the history
  • Loading branch information
robshakir authored Dec 18, 2024
2 parents 3ea91ad + 5e6ecb8 commit 0cca529
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 83 deletions.
7 changes: 4 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

# 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
# @openconfig/featureprofiles-approvers will be requested for
# review when someone opens a pull request.
* @openconfig/featureprofiles-maintainers
* @openconfig/featureprofiles-approvers

# /feature folders each have owners who are auto requested for review and may merge PR's
/feature/acl/ @alokmtri-g
Expand All @@ -24,10 +24,11 @@
/feature/mtu/ @swetha-haridasula
/feature/networkinstance/ @swetha-haridasula
/feature/platform/ @amrindrr
/feature/platform/transceiver @jianchen-g @yiwenhu-g @ahsaanyousaf @ejbrever @rezachit
/feature/qos @sezhang2
/feature/routing_policy/ @swetha-haridasula
/feature/sampling/ @sudhinj
/feature/security @mihirpitale-googler
/feature/security @mihirpitale-googler @morrowc
/feature/staticroute/ @swetha-haridasula
/feature/stp/ @alokmtri-g
/feature/system @swetha-haridasula
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) {
// Level configs.
level := isis.GetOrCreateLevel(2)
level.LevelNumber = ygot.Uint8(2)
level.MetricStyle = oc.Isis_MetricStyle_WIDE_METRIC

// Authentication configs.
auth := level.GetOrCreateAuthentication()
Expand All @@ -88,7 +89,6 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) {
intfName += ".0"
}
intf := isis.GetOrCreateInterface(intfName)
intf.HelloPadding = oc.Isis_HelloPaddingType_ADAPTIVE

// Interface timers.
isisIntfTimers := intf.GetOrCreateTimers()
Expand All @@ -101,6 +101,8 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) {
// Interface level configs.
isisIntfLevel := intf.GetOrCreateLevel(2)
isisIntfLevel.LevelNumber = ygot.Uint8(2)
isisIntfLevel.SetEnabled(true)
isisIntfLevel.Enabled = ygot.Bool(true)
isisIntfLevel.GetOrCreateHelloAuthentication().Enabled = ygot.Bool(true)
isisIntfLevel.GetHelloAuthentication().AuthPassword = ygot.String(password)
isisIntfLevel.GetHelloAuthentication().AuthType = oc.KeychainTypes_AUTH_TYPE_SIMPLE_KEY
Expand All @@ -110,12 +112,14 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) {
isisIntfLevelTimers.HelloInterval = ygot.Uint32(5)
isisIntfLevelTimers.HelloMultiplier = ygot.Uint8(3)

if !deviations.ISISInterfaceAfiUnsupported(ts.DUT) {
isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = ygot.Bool(true)
isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV6, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = ygot.Bool(true)
}
isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = ygot.Bool(true)
isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST).Metric = ygot.Uint32(v4Metric)
isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV6, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = ygot.Bool(true)
isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV6, oc.IsisTypes_SAFI_TYPE_UNICAST).Metric = ygot.Uint32(v6Metric)
if deviations.MissingIsisInterfaceAfiSafiEnable(ts.DUT) {
isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = nil
isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV6, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = nil
}
}

// configureOTG configures isis and traffic on OTG.
Expand Down Expand Up @@ -222,7 +226,7 @@ func TestIsisInterfaceHelloPaddingEnable(t *testing.T) {
// Adjacency check.
_, found := gnmi.Watch(t, ts.DUT, statePath.Interface(intfName).Level(2).Adjacency(ateSysID).AdjacencyState().State(), time.Minute, func(val *ygnmi.Value[oc.E_Isis_IsisInterfaceAdjState]) bool {
state, present := val.Val()
return present && state == oc.Isis_IsisInterfaceAdjState_DOWN
return present && (state == oc.Isis_IsisInterfaceAdjState_DOWN || state == oc.Isis_IsisInterfaceAdjState_INIT)
}).Await(t)
if !found {
t.Errorf("Isis adjacency is not down on interface %v when MTU is changed", intfName)
Expand Down Expand Up @@ -274,8 +278,10 @@ func TestIsisInterfaceHelloPaddingEnable(t *testing.T) {
if got := gnmi.Get(t, ts.DUT, adjPath.AreaAddress().State()); !cmp.Equal(got, want, cmpopts.SortSlices(func(a, b string) bool { return a < b })) {
t.Errorf("FAIL- Expected area address not found, got %s, want %s", got, want)
}
if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" {
t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000")
if !deviations.IsisDisSysidUnsupported(ts.DUT) {
if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" {
t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000")
}
}
if got := gnmi.Get(t, ts.DUT, adjPath.LocalExtendedCircuitId().State()); got == 0 {
t.Errorf("FAIL- Expected local extended circuit id not found,expected non-zero value, got %d", got)
Expand Down Expand Up @@ -328,8 +334,10 @@ func TestIsisInterfaceHelloPaddingEnable(t *testing.T) {
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().CorruptedLsps().State()); got != 0 {
t.Errorf("FAIL- Not expecting any corrupted lsps, got %d, want %d", got, 0)
}
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 {
t.Errorf("FAIL- Not expecting non zero database_overloads, got %d, want %d", got, 0)
if !deviations.IsisDatabaseOverloadsUnsupported(ts.DUT) {
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 {
t.Errorf("FAIL- Not expecting pre isis config database_overloads value to change, got %d, want %d", got, 0)
}
}
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().ExceedMaxSeqNums().State()); got != 0 {
t.Errorf("FAIL- Not expecting non zero max_seqnum counter, got %d, want %d", got, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ platform_exceptions: {
deviations: {
ipv4_missing_enabled: true
isis_interface_level1_disable_required: true
isis_dis_sysid_unsupported: true
isis_database_overloads_unsupported: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package isis_interface_level_passive_test

import (
"fmt"
"net"
"testing"
"time"
Expand All @@ -23,8 +24,10 @@ import (
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/openconfig/featureprofiles/internal/deviations"
"github.com/openconfig/featureprofiles/internal/fptest"
"github.com/openconfig/featureprofiles/internal/helpers"
"github.com/openconfig/featureprofiles/internal/isissession"
"github.com/openconfig/featureprofiles/internal/otgutils"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/gnmi"
"github.com/openconfig/ondatra/gnmi/oc"
"github.com/openconfig/ygot/ygot"
Expand Down Expand Up @@ -99,8 +102,8 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) {
// Interface level configs.
isisIntfLevel2 := intf.GetOrCreateLevel(2)
isisIntfLevel2.LevelNumber = ygot.Uint8(2)
isisIntfLevel2.SetEnabled(true)
isisIntfLevel2.Enabled = ygot.Bool(true)
isisIntfLevel2.Passive = ygot.Bool(true)

isisIntfLevel2.GetOrCreateHelloAuthentication().Enabled = ygot.Bool(true)
isisIntfLevel2.GetHelloAuthentication().AuthPassword = ygot.String(password)
Expand Down Expand Up @@ -170,39 +173,67 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) {
func TestISISLevelPassive(t *testing.T) {
ts := isissession.MustNew(t).WithISIS()
configureISIS(t, ts)

dut := ts.DUT
configureOTG(t, ts)
otg := ts.ATE.OTG()

pcl := ts.DUTConf.GetNetworkInstance(deviations.DefaultNetworkInstance(ts.DUT)).GetProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, isissession.ISISName)
fptest.LogQuery(t, "Protocol ISIS", isissession.ProtocolPath(ts.DUT).Config(), pcl)

ts.PushAndStart(t)
time.Sleep(time.Minute * 2)

statePath := isissession.ISISPath(ts.DUT)
intfName := ts.DUTPort1.Name()
if deviations.ExplicitInterfaceInDefaultVRF(ts.DUT) {
intfName += ".0"
}
t.Run("Isis telemetry", func(t *testing.T) {
time.Sleep(time.Minute * 1)
var isispassiveconfig string
t.Run("Passive checks", func(t *testing.T) {
// Passive should be true.
if got := gnmi.Get(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().State()); got != true {
t.Errorf("FAIL- Expected level 2 passive state not found, got %t, want %t", got, true)
if deviations.IsisInterfaceLevelPassiveUnsupported(ts.DUT) {
switch dut.Vendor() {
case ondatra.CISCO:
isispassiveconfig = fmt.Sprintf("router isis DEFAULT\n interface %s\n passive\n", intfName)
default:
t.Fatalf("Unsupported vendor %s for deviation 'IsisInterfaceLevelPassiveUnsupported'", dut.Vendor())
}
helpers.GnmiCLIConfig(t, dut, isispassiveconfig)
} else {
gnmi.Update(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().Config(), true)
}
if !deviations.IsisInterfaceLevelPassiveUnsupported(ts.DUT) {
// Passive should be true.
if got := gnmi.Get(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().State()); got != true {
t.Errorf("FAIL- Expected level 2 passive state not found, got %t, want %t", got, true)
}
}
t.Logf("Adjacency state after passive update is %s", statePath.Interface(intfName).Level(2).AdjacencyAny().AdjacencyState().State())
// Adjacency should be down.
for _, val := range gnmi.LookupAll(t, ts.DUT, statePath.Interface(intfName).LevelAny().AdjacencyAny().AdjacencyState().State()) {
if v, _ := val.Val(); v == oc.Isis_IsisInterfaceAdjState_UP {
t.Fatalf("Adjacency should not be up as level 2 is passive")
}
}
// Updating passive config to false on dut.
gnmi.Update(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().Config(), false)
time.Sleep(time.Second * 5)

if got := gnmi.Get(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().State()); got != false {
t.Errorf("FAIL- Expected level 2 passive state not found, got %t, want %t", got, true)
if deviations.IsisInterfaceLevelPassiveUnsupported(ts.DUT) {
switch dut.Vendor() {
case ondatra.CISCO:
isispassiveconfig = fmt.Sprintf("router isis DEFAULT\n interface %s\n no passive\n", intfName)
default:
t.Fatalf("Unsupported vendor %s for deviation 'IsisInterfaceLevelPassiveUnsupported'", dut.Vendor())
}
helpers.GnmiCLIConfig(t, dut, isispassiveconfig)
} else {
gnmi.Update(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().Config(), false)
}
if !deviations.IsisInterfaceLevelPassiveUnsupported(ts.DUT) {
if got := gnmi.Get(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().State()); got != false {
t.Errorf("FAIL- Expected level 2 passive state not found, got %t, want %t", got, true)
}
}
t.Logf("Adjacency state after passive update is %s", statePath.Interface(intfName).LevelAny().AdjacencyAny().AdjacencyState().State())
// Level 2 adjacency should be up.
_, err := ts.AwaitAdjacency()
if err != nil {
Expand Down Expand Up @@ -244,8 +275,10 @@ func TestISISLevelPassive(t *testing.T) {
if got := gnmi.Get(t, ts.DUT, adjPath.AreaAddress().State()); !cmp.Equal(got, want, cmpopts.SortSlices(func(a, b string) bool { return a < b })) {
t.Errorf("FAIL- Expected area address not found, got %s, want %s", got, want)
}
if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" {
t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000")
if !deviations.IsisDisSysidUnsupported(ts.DUT) {
if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" {
t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000")
}
}
if got := gnmi.Get(t, ts.DUT, adjPath.LocalExtendedCircuitId().State()); got == 0 {
t.Errorf("FAIL- Expected local extended circuit id not found,expected non-zero value, got %d", got)
Expand Down Expand Up @@ -298,8 +331,10 @@ func TestISISLevelPassive(t *testing.T) {
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().CorruptedLsps().State()); got != 0 {
t.Errorf("FAIL- Not expecting any corrupted lsps, got %d, want %d", got, 0)
}
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 {
t.Errorf("FAIL- Not expecting non zero database_overloads, got %d, want %d", got, 0)
if !deviations.IsisDatabaseOverloadsUnsupported(ts.DUT) {
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 {
t.Errorf("FAIL- Not expecting non zero database_overloads, got %d, want %d", got, 0)
}
}
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().ExceedMaxSeqNums().State()); got != 0 {
t.Errorf("FAIL- Not expecting non zero max_seqnum counter, got %d, want %d", got, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ platform_exceptions: {
deviations: {
ipv4_missing_enabled: true
isis_interface_level1_disable_required: true
isis_dis_sysid_unsupported: true
isis_database_overloads_unsupported: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ func TestISISWideMetricEnabled(t *testing.T) {
if got := gnmi.Get(t, ts.DUT, adjPath.AreaAddress().State()); !cmp.Equal(got, want, cmpopts.SortSlices(func(a, b string) bool { return a < b })) {
t.Errorf("FAIL- Expected area address not found, got %s, want %s", got, want)
}
if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" {
t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000")
if !deviations.IsisDisSysidUnsupported(ts.DUT) {
if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" {
t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000")
}
}
if got := gnmi.Get(t, ts.DUT, adjPath.LocalExtendedCircuitId().State()); got == 0 {
t.Errorf("FAIL- Expected local extended circuit id not found,expected non-zero value, got %d", got)
Expand Down Expand Up @@ -295,8 +297,10 @@ func TestISISWideMetricEnabled(t *testing.T) {
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().CorruptedLsps().State()); got != 0 {
t.Errorf("FAIL- Not expecting any corrupted lsps, got %d, want %d", got, 0)
}
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 {
t.Errorf("FAIL- Not expecting non zero database_overloads, got %d, want %d", got, 0)
if !deviations.IsisDatabaseOverloadsUnsupported(ts.DUT) {
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 {
t.Errorf("FAIL- Not expecting pre isis config database_overloads value to change, got %d, want %d", got, 0)
}
}
if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().ExceedMaxSeqNums().State()); got != 0 {
t.Errorf("FAIL- Not expecting non zero max_seqnum counter, got %d, want %d", got, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ platform_exceptions: {
deviations: {
ipv4_missing_enabled: true
isis_interface_level1_disable_required: true
isis_dis_sysid_unsupported: true
isis_database_overloads_unsupported: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,23 +1055,23 @@ func TestDefaultPowerAdminState(t *testing.T) {
t.Logf("Supervisors: %v", supervisors)

if len(fabrics) != 0 {
pas := gnmi.Get(t, dut, gnmi.OC().Component(fabrics[0].GetName()).Fabric().PowerAdminState().Config())
pas := gnmi.Get(t, dut, gnmi.OC().Component(fabrics[0].GetName()).Fabric().PowerAdminState().State())
t.Logf("Component %s PowerAdminState: %v", fabrics[0].GetName(), pas)
if pas == oc.Platform_ComponentPowerType_UNSET {
t.Errorf("Component %s PowerAdminState is unset", fabrics[0].GetName())
}
}

if len(linecards) != 0 {
pas := gnmi.Get(t, dut, gnmi.OC().Component(linecards[0].GetName()).Linecard().PowerAdminState().Config())
pas := gnmi.Get(t, dut, gnmi.OC().Component(linecards[0].GetName()).Linecard().PowerAdminState().State())
t.Logf("Component %s PowerAdminState: %v", linecards[0].GetName(), pas)
if pas == oc.Platform_ComponentPowerType_UNSET {
t.Errorf("Component %s PowerAdminState is unset", linecards[0].GetName())
}
}
if !deviations.SkipControllerCardPowerAdmin(dut) {
if len(supervisors) != 0 {
pas := gnmi.Get(t, dut, gnmi.OC().Component(supervisors[0].GetName()).ControllerCard().PowerAdminState().Config())
pas := gnmi.Get(t, dut, gnmi.OC().Component(supervisors[0].GetName()).ControllerCard().PowerAdminState().State())
t.Logf("Component %s PowerAdminState: %v", supervisors[0].GetName(), pas)
if pas == oc.Platform_ComponentPowerType_UNSET {
t.Errorf("Component %s PowerAdminState is unset", supervisors[0].GetName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ func TestManagementHA1(t *testing.T) {
})

t.Run("traffic received by port1", func(t *testing.T) {
createFlowV6(t, bs)
gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().Config(), true)
gnmi.Await(t, dut, gnmi.OC().Interface(p1.Name()).AdminStatus().State(), 30*time.Second, oc.Interface_AdminStatus_UP)
createFlowV6(t, bs)
time.Sleep(30 * time.Second)
bs.ATE.OTG().StartTraffic(t)
time.Sleep(30 * time.Second)
Expand Down
15 changes: 15 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1243,3 +1243,18 @@ func EnableTableConnections(dut *ondatra.DUTDevice) bool {
func NoZeroSuppression(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetNoZeroSuppression()
}

// IsisInterfaceLevelPassiveUnsupported returns true for devices that do not support passive leaf
func IsisInterfaceLevelPassiveUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetIsisInterfaceLevelPassiveUnsupported()
}

// IsisDisSysidUnsupported returns true for devices that do not support dis-system-id leaf
func IsisDisSysidUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetIsisDisSysidUnsupported()
}

// IsisDatabaseOverloadsUnsupported returns true for devices that do not support database-overloads leaf
func IsisDatabaseOverloadsUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetIsisDatabaseOverloadsUnsupported()
}
6 changes: 6 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ message Metadata {
// Device has default zero suppression.
// Juniper : b/378646018
bool no_zero_suppression = 237;
// Cisco: b/378801305
bool isis_interface_level_passive_unsupported = 238;
// Cisco: b/378616912
bool isis_dis_sysid_unsupported = 239;
// Cisco: b/378616912
bool isis_database_overloads_unsupported = 240;
// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
}
Expand Down
Loading

0 comments on commit 0cca529

Please sign in to comment.