Skip to content

Commit

Permalink
RT-1.1 | Remove SkipBGPTestPasswordMismatch deviation (openconfig#2143)
Browse files Browse the repository at this point in the history
* Remove SkipBGPTestPasswordMismatch deviation

* Generate metadata.pb.go

* Resolve conflicts

---------

Co-authored-by: prinikasn <[email protected]>
  • Loading branch information
arvbaska1 and prinikasn authored Dec 5, 2023
1 parent 1aab0fc commit e109089
Show file tree
Hide file tree
Showing 5 changed files with 448 additions and 473 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,35 +386,33 @@ func TestPassword(t *testing.T) {
// Verify BGP status
t.Log("Check BGP parameters")
verifyBgpTelemetry(t, dut)
if !deviations.SkipBGPTestPasswordMismatch(dut) {
t.Log("Configure mismatching md5 auth password on DUT")
gnmi.Replace(t, dut, dutConfPath.Bgp().Neighbor(ateAttrs.IPv4).AuthPassword().Config(), "PASSWORDNEGSCENARIO")

// If the DUT will not fail a BGP session when the BGP MD5 key configuration changes,
// change the key from the ATE side to time out the session.
if deviations.BGPMD5RequiresReset(dut) {
bgpPeer.WithMD5Key("PASSWORDNEGSCENARIO-ATE")
topo.UpdateBGPPeerStates(t)
}
t.Log("Wait till hold time expires: BGP should not be in ESTABLISHED state when passwords do not match.")
_, ok := gnmi.Watch(t, dut, nbrPath.SessionState().State(), (dutHoldTime+10)*time.Second, func(val *ygnmi.Value[oc.E_Bgp_Neighbor_SessionState]) bool {
state, ok := val.Val()
return ok && state != oc.Bgp_Neighbor_SessionState_ESTABLISHED
}).Await(t)
if !ok {
fptest.LogQuery(t, "BGP reported state", nbrPath.State(), gnmi.Get(t, dut, nbrPath.State()))
t.Error("BGP Adjacency is ESTABLISHED when passwords are not matching")
}
t.Log("Configure mismatching md5 auth password on DUT")
gnmi.Replace(t, dut, dutConfPath.Bgp().Neighbor(ateAttrs.IPv4).AuthPassword().Config(), "PASSWORDNEGSCENARIO")

// If the DUT will not fail a BGP session when the BGP MD5 key configuration changes,
// change the key from the ATE side to time out the session.
if deviations.BGPMD5RequiresReset(dut) {
bgpPeer.WithMD5Key("PASSWORDNEGSCENARIO-ATE")
topo.UpdateBGPPeerStates(t)
}
t.Log("Wait till hold time expires: BGP should not be in ESTABLISHED state when passwords do not match.")
_, ok := gnmi.Watch(t, dut, nbrPath.SessionState().State(), (dutHoldTime+10)*time.Second, func(val *ygnmi.Value[oc.E_Bgp_Neighbor_SessionState]) bool {
state, ok := val.Val()
return ok && state != oc.Bgp_Neighbor_SessionState_ESTABLISHED
}).Await(t)
if !ok {
fptest.LogQuery(t, "BGP reported state", nbrPath.State(), gnmi.Get(t, dut, nbrPath.State()))
t.Error("BGP Adjacency is ESTABLISHED when passwords are not matching")
}

t.Log("Revert md5 auth password on DUT to match with ATE.")
gnmi.Replace(t, dut, dutConfPath.Bgp().Neighbor(ateAttrs.IPv4).AuthPassword().Config(), authPassword)
if deviations.BGPMD5RequiresReset(dut) {
bgpPeer.WithMD5Key(authPassword)
topo.UpdateBGPPeerStates(t)
}
t.Log("Verify BGP session state : Should be ESTABLISHED")
gnmi.Await(t, dut, nbrPath.SessionState().State(), time.Second*50, oc.Bgp_Neighbor_SessionState_ESTABLISHED)
t.Log("Revert md5 auth password on DUT to match with ATE.")
gnmi.Replace(t, dut, dutConfPath.Bgp().Neighbor(ateAttrs.IPv4).AuthPassword().Config(), authPassword)
if deviations.BGPMD5RequiresReset(dut) {
bgpPeer.WithMD5Key(authPassword)
topo.UpdateBGPPeerStates(t)
}
t.Log("Verify BGP session state : Should be ESTABLISHED")
gnmi.Await(t, dut, nbrPath.SessionState().State(), time.Second*50, oc.Bgp_Neighbor_SessionState_ESTABLISHED)
// Clear config on DUT and ATE
topo.StopProtocols(t)
bgpClearConfig(t, dut)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ platform_exceptions: {
}
deviations: {
ipv4_missing_enabled: true
skip_bgp_test_password_mismatch: true
connect_retry: true
}
}
Expand Down
5 changes: 0 additions & 5 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,6 @@ func ExplicitGRIBIUnderNetworkInstance(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetExplicitGribiUnderNetworkInstance()
}

// SkipBGPTestPasswordMismatch retuns if BGP TestPassword mismatch subtest should be skipped.
func SkipBGPTestPasswordMismatch(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetSkipBgpTestPasswordMismatch()
}

// BGPMD5RequiresReset returns if device requires a BGP session reset to utilize a new MD5 key.
func BGPMD5RequiresReset(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetBgpMd5RequiresReset()
Expand Down
5 changes: 1 addition & 4 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ message Metadata {
bool osinstall_for_standby_rp = 17;
// Set this flag for LLDP interface config to override the global config.
bool lldp_interface_config_override_global = 18;
// Skip BGP TestPassword mismatch subtest if value is true.
// Cisco: partnerissuetracker.corp.google.com/273285907
bool skip_bgp_test_password_mismatch = 19;
// Skip check for
// bgp/neighbors/neighbor/state/messages/received/last-notification-error-code
// leaf missing case.
Expand Down Expand Up @@ -368,7 +365,7 @@ message Metadata {
bool bgp_explicit_prefix_limit_received = 127;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89;
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19;
}

message PlatformExceptions {
Expand Down
Loading

0 comments on commit e109089

Please sign in to comment.