Skip to content

Commit

Permalink
Merge branch 'main' into sachendras-patch-23
Browse files Browse the repository at this point in the history
  • Loading branch information
sachendras authored Aug 16, 2024
2 parents e29b64e + 75df272 commit 119c6a4
Show file tree
Hide file tree
Showing 30 changed files with 2,319 additions and 451 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ import (
"github.com/openconfig/featureprofiles/internal/attrs"
"github.com/openconfig/featureprofiles/internal/deviations"
"github.com/openconfig/featureprofiles/internal/fptest"
"github.com/openconfig/featureprofiles/internal/gnoi"
gpb "github.com/openconfig/gnmi/proto/gnmi"
gnps "github.com/openconfig/gnoi/system"
"github.com/openconfig/gnoigo/system"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/gnmi"
"github.com/openconfig/ondatra/gnmi/oc"
"github.com/openconfig/ondatra/gnmi/oc/acl"
"github.com/openconfig/ondatra/gnoi"
"github.com/openconfig/ondatra/ixnet"
"github.com/openconfig/ygnmi/ygnmi"
"github.com/openconfig/ygot/ygot"
Expand Down Expand Up @@ -192,12 +190,6 @@ var (
IPv4Len: plenIPv4,
IPv6Len: plenIPv6,
}
routingDaemon = map[ondatra.Vendor]string{
ondatra.JUNIPER: "rpd",
ondatra.ARISTA: "Bgp-main",
ondatra.CISCO: "emsd",
ondatra.NOKIA: "sr_bgp_mgr",
}
)

func configureRoutePolicy(t *testing.T, dut *ondatra.DUTDevice, name string, pr oc.E_RoutingPolicy_PolicyResultType) {
Expand Down Expand Up @@ -652,56 +644,6 @@ func removeNewPeers(t *testing.T, dut *ondatra.DUTDevice, nbrs []*bgpNeighbor) {
fptest.LogQuery(t, "DUT BGP Config", dutConfPath.Config(), gnmi.Get(t, dut, dutConfPath.Config()))
}

func restartRoutingProcess(t *testing.T, dut *ondatra.DUTDevice) {
t.Helper()
if _, ok := routingDaemon[dut.Vendor()]; !ok {
t.Fatalf("Please add support for vendor %v in var routingDaemon", dut.Vendor())
}
t.Run("KillGRIBIDaemon", func(t *testing.T) {
// Find the PID of routing Daemon.
var pId uint64
pName := routingDaemon[dut.Vendor()]
t.Run("FindroutingDaemonPid", func(t *testing.T) {
pId = findProcessByName(t, dut, pName)
if pId == 0 {
t.Fatalf("Couldn't find pid of routing daemon '%s'", pName)
} else {
t.Logf("Pid of routing daemon '%s' is '%d'", pName, pId)
}
})

// Kill routing daemon through gNOI Kill Request.
t.Run("ExecuteGnoiKill", func(t *testing.T) {
// TODO - pid type is uint64 in oc-system model, but uint32 in gNOI Kill Request proto.
// Until the models are brought in line, typecasting the uint64 to uint32.
gNOIKillProcess(t, dut, pName, uint32(pId))
// Wait for a bit for routing daemon on the DUT to restart.
time.Sleep(30 * time.Second)
})
})
}

// findProcessByName uses telemetry to find out the PID of a process
func findProcessByName(t *testing.T, dut *ondatra.DUTDevice, pName string) uint64 {
t.Helper()
pList := gnmi.GetAll(t, dut, gnmi.OC().System().ProcessAny().State())
var pID uint64
for _, proc := range pList {
if proc.GetName() == pName {
pID = proc.GetPid()
t.Logf("Pid of daemon '%s' is '%d'", pName, pID)
}
}
return pID
}

// gNOIKillProcess kills a daemon on the DUT, given its name and pid.
func gNOIKillProcess(t *testing.T, dut *ondatra.DUTDevice, pName string, pID uint32) {
t.Helper()
killResponse := gnoi.Execute(t, dut, system.NewKillProcessOperation().Name(pName).PID(pID).Signal(gnps.KillProcessRequest_SIGNAL_TERM).Restart(true))
t.Logf("Got kill process response: %v\n\n", killResponse)
}

// setBgpPolicy is used to configure routing policy on DUT.
func setBgpPolicy(t *testing.T, dut *ondatra.DUTDevice, d *oc.Root) {
t.Helper()
Expand Down Expand Up @@ -943,7 +885,7 @@ func TestTrafficWithGracefulRestartLLGR(t *testing.T) {
})

t.Run("Restart routing", func(t *testing.T) {
restartRoutingProcess(t, dut)
gnoi.KillProcess(t, dut, gnoi.ROUTING, true)
})

var bgpIxPeer []*ixnet.BGP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ Ensure that gRIBI entries are persisted over daemon failure.

* Issuing a gRIBI Get RPC results in 203.0.113.0/24 being returned.

## Protocol/RPC Parameter Coverage

* gRIBI
* ModifyRequest
* GetRequest
## OpenConfig Path and RPC Coverage
```yaml
rpcs:
gribi:
gRIBI.Get:
gRIBI.Modify:
gRIBI.Flush:
```
## Telemetry Parameter Coverage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ import (
"github.com/openconfig/featureprofiles/internal/attrs"
"github.com/openconfig/featureprofiles/internal/deviations"
"github.com/openconfig/featureprofiles/internal/fptest"
"github.com/openconfig/featureprofiles/internal/gnoi"
"github.com/openconfig/featureprofiles/internal/gribi"
"github.com/openconfig/featureprofiles/internal/otgutils"
gnps "github.com/openconfig/gnoi/system"
"github.com/openconfig/gnoigo/system"
grps "github.com/openconfig/gribi/v1/proto/service"
grpb "github.com/openconfig/gribi/v1/proto/service"
"github.com/openconfig/gribigo/fluent"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/gnmi"
"github.com/openconfig/ondatra/gnmi/oc"
"github.com/openconfig/ondatra/gnoi"
"github.com/openconfig/ygnmi/ygnmi"
"github.com/openconfig/ygot/ygot"
)
Expand Down Expand Up @@ -88,13 +86,6 @@ var (
IPv4: "192.0.2.6",
IPv4Len: ipv4PrefixLen,
}

gRIBIDaemons = map[ondatra.Vendor]string{
ondatra.ARISTA: "Gribi",
ondatra.CISCO: "emsd",
ondatra.JUNIPER: "rpd",
ondatra.NOKIA: "sr_grpc_server",
}
)

// configInterfaceDUT configures the DUT interfaces.
Expand Down Expand Up @@ -235,7 +226,7 @@ func verifyGRIBIGet(ctx context.Context, t *testing.T, clientA *gribi.Client, du
entries := getResponse.GetEntry()
var found bool
for _, entry := range entries {
v := entry.Entry.(*grps.AFTEntry_Ipv4)
v := entry.Entry.(*grpb.AFTEntry_Ipv4)
if prefix := v.Ipv4.GetPrefix(); prefix != "" {
if prefix == ateDstNetCIDR {
found = true
Expand All @@ -249,36 +240,12 @@ func verifyGRIBIGet(ctx context.Context, t *testing.T, clientA *gribi.Client, du
}
}

// gNOIKillProcess kills a daemon on the DUT, given its name and pid.
func gNOIKillProcess(ctx context.Context, t *testing.T, args *testArgs, pName string, pID uint32) {
killResponse := gnoi.Execute(t, args.dut, system.NewKillProcessOperation().Name(pName).PID(pID).Signal(gnps.KillProcessRequest_SIGNAL_TERM).Restart(true))
t.Logf("Got kill process response: %v\n\n", killResponse)
}

// findProcessByName uses telemetry to find out the PID of a process
func findProcessByName(ctx context.Context, t *testing.T, dut *ondatra.DUTDevice, pName string) uint64 {
pList := gnmi.GetAll(t, dut, gnmi.OC().System().ProcessAny().State())
var pID uint64
for _, proc := range pList {
if proc.GetName() == pName {
pID = proc.GetPid()
t.Logf("Pid of daemon '%s' is '%d'", pName, pID)
}
}
return pID
}

func TestDUTDaemonFailure(t *testing.T) {

start := time.Now()
dut := ondatra.DUT(t, "dut")
ctx := context.Background()

// Check if vendor specific gRIBI daemon name has been added to gRIBIDaemons var
if _, ok := gRIBIDaemons[dut.Vendor()]; !ok {
t.Fatalf("Please add support for vendor %v in var gRIBIDaemons", dut.Vendor())
}

// Configure the DUT.
t.Logf("Configure DUT")
configureDUT(t, dut)
Expand Down Expand Up @@ -343,30 +310,7 @@ func TestDUTDaemonFailure(t *testing.T) {
})

t.Run("KillGRIBIDaemon", func(t *testing.T) {

// Find the PID of gRIBI Daemon.
var pId uint64
pName := gRIBIDaemons[dut.Vendor()]
t.Run("FindGRIBIDaemonPid", func(t *testing.T) {

pId = findProcessByName(ctx, t, dut, pName)
if pId == 0 {
t.Fatalf("Couldn't find pid of gRIBI daemon '%s'", pName)
} else {
t.Logf("Pid of gRIBI daemon '%s' is '%d'", pName, pId)
}
})

// Kill gRIBI daemon through gNOI Kill Request.
t.Run("ExecuteGnoiKill", func(t *testing.T) {
// TODO - pid type is uint64 in oc-system model, but uint32 in gNOI Kill Request proto.
// Until the models are brought in line, typecasting the uint64 to uint32.
gNOIKillProcess(ctx, t, args, pName, uint32(pId))

// Wait for a bit for gRIBI daemon on the DUT to restart.
time.Sleep(30 * time.Second)

})
gnoi.KillProcess(t, dut, gnoi.GRIBI, true)

t.Logf("Time check: %s", time.Since(start))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,83 +14,78 @@
* Ensure that IS-IS adjacency is not coming up on the passive interface.
* TODO-Verify the output of ST path displaying the interface as passive in ISIS database/adj table

## Config Parameter coverage
# OpenConfig Path and RPC Coverage
```yaml
paths:
# config
/network-instances/network-instance/protocols/protocol/isis/global/config/authentication-check:
/network-instances/network-instance/protocols/protocol/isis/global/config/net:
/network-instances/network-instance/protocols/protocol/isis/global/config/level-capability:
/network-instances/network-instance/protocols/protocol/isis/global/config/hello-padding:
/network-instances/network-instance/protocols/protocol/isis/global/afi-safi/af/config/enabled:
/network-instances/network-instance/protocols/protocol/isis/levels/level/config/level-number:
/network-instances/network-instance/protocols/protocol/isis/levels/level/config/enabled:
/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/enabled:
/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-mode:
/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-password:
/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-type:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/config/interface-id:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/config/enabled:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/config/circuit-type:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/config/passive:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/timers/config/csnp-interval:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/timers/config/lsp-pacing-interval:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/config/level-number:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/config/passive:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/timers/config/hello-interval:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/timers/config/hello-multiplier:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/hello-authentication/config/auth-mode:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/hello-authentication/config/auth-password:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/hello-authentication/config/auth-type:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/hello-authentication/config/enabled:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/afi-safi/af/config/afi-name:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/afi-safi/af/config/safi-name:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/afi-safi/af/config/enabled:

* For prefix:
# isis telemetry
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/state/passive:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/state/passive:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/adjacency-state:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-ipv4-address:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-ipv6-address:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/system-id:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/area-address:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/dis-system-id:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/local-extended-circuit-id:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/multi-topology:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-circuit-type:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-extended-circuit-id:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-snpa:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/nlpid:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/priority:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/restart-status:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/restart-support:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state/restart-suppress:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/afi-safi/af/state/afi-name:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/afi-safi/af/state/metric:
/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/afi-safi/af/state/safi-name:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/auth-fails:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/auth-type-fails:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/corrupted-lsps:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/database-overloads:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/exceed-max-seq-nums:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/id-len-mismatch:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/lsp-errors:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/manual-address-drop-from-area :
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/max-area-address-mismatches:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/own-lsp-purges:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/part-changes :
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/seq-num-skips:
/network-instances/network-instance/protocols/protocol/isis/levels/level/system-level-counters/state/spf-runs:

* /network-instances/network-instance/protocols/protocol/isis/

* Parameters:

* global/config/authentication-check
* global/config/net
* global/config/level-capability
* global/config/hello-padding
* global/afi-safi/af/config/enabled
* levels/level/config/level-number
* levels/level/config/enabled
* levels/level/authentication/config/enabled
* levels/level/authentication/config/auth-mode
* levels/level/authentication/config/auth-password
* levels/level/authentication/config/auth-type
* interfaces/interface/config/interface-id
* interfaces/interface/config/enabled
* interfaces/interface/config/circuit-type
* interfaces/interface/config/passive
* interfaces/interface/timers/config/csnp-interval
* interfaces/interface/timers/config/lsp-pacing-interval
* interfaces/interface/levels/level/config/level-number
* interfaces/interface/levels/level/config/passive
* interfaces/interface/levels/level/timers/config/hello-interval
* interfaces/interface/levels/level/timers/config/hello-multiplier
* interfaces/interface/levels/level/hello-authentication/config/auth-mode
* interfaces/interface/levels/level/hello-authentication/config/auth-password
* interfaces/interface/levels/level/hello-authentication/config/auth-type
* interfaces/interface/levels/level/hello-authentication/config/enabled
* interfaces/interface/afi-safi/af/config/afi-name
* interfaces/interface/afi-safi/af/config/safi-name
* interfaces/interface/afi-safi/af/config/enabled

## Telemetry Parameter coverage

* For prefix:

* /network-instances/network-instance/protocols/protocol/isis/

* Parameters:

* interfaces/interface/state/passive
* interfaces/interface/levels/level/state/passive
* interfaces/interface/levels/level/adjacencies/adjacency/state/adjacency-state
* interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-ipv4-address
* interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-ipv6-address
* interfaces/interface/levels/level/adjacencies/adjacency/state/system-id
* interfaces/interface/levels/level/adjacencies/adjacency/state/area-address
* interfaces/interface/levels/level/adjacencies/adjacency/state/dis-system-id
* interfaces/interface/levels/level/adjacencies/adjacency/state/local-extended-circuit-id
* interfaces/interface/levels/level/adjacencies/adjacency/state/multi-topology
* interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-circuit-type
* interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-extended-circuit-id
* interfaces/interface/levels/level/adjacencies/adjacency/state/neighbor-snpa
* interfaces/interface/levels/level/adjacencies/adjacency/state/nlpid
* interfaces/interface/levels/level/adjacencies/adjacency/state/priority
* interfaces/interface/levels/level/adjacencies/adjacency/state/restart-status
* interfaces/interface/levels/level/adjacencies/adjacency/state/restart-support
* interfaces/interface/levels/level/adjacencies/adjacency/state/restart-suppress
* interfaces/interface/levels/level/afi-safi/af/state/afi-name
* interfaces/interface/levels/level/afi-safi/af/state/metric
* interfaces/interface/levels/level/afi-safi/af/state/safi-name
* interfaces/interface/levels/level/afi-safi/af/state/metric
* levels/level/system-level-counters/state/auth-fails
* levels/level/system-level-counters/state/auth-type-fails
* levels/level/system-level-counters/state/corrupted-lsps
* levels/level/system-level-counters/state/database-overloads
* levels/level/system-level-counters/state/exceed-max-seq-nums
* levels/level/system-level-counters/state/id-len-mismatch
* levels/level/system-level-counters/state/lsp-errors
* levels/level/system-level-counters/state/manual-address-drop-from-area
* levels/level/system-level-counters/state/max-area-address-mismatches
* levels/level/system-level-counters/state/own-lsp-purges
* levels/level/system-level-counters/state/part-changes
* levels/level/system-level-counters/state/seq-num-skips
* levels/level/system-level-counters/state/spf-runs
rpcs:
gnmi:
gNMI.Get:
gNMI.Set:
gNMI.Subscribe:
```
Loading

0 comments on commit 119c6a4

Please sign in to comment.