openconfig / featureprofiles

Feature Profiles are groups of OpenConfig paths and tests which verify their behavior
Apache License 2.0
48 stars 138 forks source link

Error while running the FP Nokia SR-Linux README example #344

Closed octpetre closed 1 year ago

octpetre commented 2 years ago

I'm trying to run the example provided in the README file with a Nokia SRL, with the following minor changes to topologies/kne/nokia_srl.textproto file

go test -v feature/system/tests/*.go -kne-config $PWD/topologies/kne/testbed.kne.yml -testbed $PWD/topologies/dut.testbed

*** Reserving the testbed...

F0726 17:17:17.165291 2470725 ondatra.go:53] error executing command /home/opetre/go/bin/kne_cli topology reset /home/opetre/featureprofiles/topologies/kne/nokia_srl.textproto dut --push: time="2022-07-26T17:17:17Z" level=info msg="Creating manager for: nokia-srl" time="2022-07-26T17:17:17Z" level=info msg="Trying in-cluster configuration" time="2022-07-26T17:17:17Z" level=info msg="Falling back to kubeconfig: \"/home/opetre/.kube/config\"" time="2022-07-26T17:17:17Z" level=info msg="Adding Node: dut:NOKIA:NOKIA_SRL" Error: node dut is not resettable and --skip not set : exit status 1 FAIL command-line-arguments 0.417s FAIL

Hobbydos commented 2 years ago

Hi @octpetre It seems like ondatra framework is expecting to reset the dut but the dut does not allow this. As the message suggest, you can set the --skip flag to the function. I've done so by editing the file in my go/mod, usually found in $HOME/go/pkg/mod/github.com/openconfig/ondatra@v0.0.0-20220629205534-35d4f8159d8f/knebind/knebind.go (be mindful that you may not have the same version of ondatra as I do, usually the latest one pulled should be OK). Efforts need to be added to the kne/topo/node/srl/srl.go to implement the reset interface

A potential workaround is that you can then change the reset config Line to include "--skip". Example post-change below. _, err := kneCmdFn(d.cfg, "topology", "reset", d.cfg.TopoPath, d.Name(), "--push", "--skip")

Or the be a more inclusive:

+        if d.Vendor() != opb.Device_NOKIA {
+                _, err := kneCmdFn(d.cfg, "topology", "reset", d.cfg.TopoPath, d.Name(), "--push")
+                return err
+        } else {
+                _, err := kneCmdFn(d.cfg, "topology", "reset", d.cfg.TopoPath, d.Name(), "--push", "--skip")
+                return err
+        }

That being said, you might still get stuck running the test around this part:

go test -v feature/system/tests/*.go -kne-config /home/user/openconfig/featureprofiles/topologies/kne/testbed.kne.yml -testbed /home/user/openconfig/featureprofiles/topologies/dut.testbed

*** Reserving the testbed...

********************************************************************************

  Testbed Reservation Complete
  ID: 4e5e8447-2256-4b92-a0b4-1f7e4eebfd87

    dut:              dut

********************************************************************************

=== RUN   TestMotdBanner
    banner_test.go:31: Need working implementation to validate against
--- SKIP: TestMotdBanner (0.00s)
=== RUN   TestLoginBanner
    banner_test.go:82: Need working implementation to validate against
--- SKIP: TestLoginBanner (0.00s)
=== RUN   TestHostname
=== RUN   TestHostname/15_Letters
<Stuck here>
bortok commented 2 years ago

Hi @Hobbydos What would be the SRL Cli command(s) to reset the config manually?

Hobbydos commented 2 years ago

@bortok I think you might be looking for load factory / commit now or load factory auto-commit

Hobbydos commented 2 years ago

Hi @bortok,

I've raised PR-182/KNE to implement the resetter in SRL.

octpetre commented 2 years ago

Hello all,

I tried @Hobbydos suggested workaround with changing the ondatra knebind.go file and also the kne version from the PR-182/KNE source forked repo. In both cases the ondatra reservation did go through, however the test got stuck at the exact "TestHostname/15_Letters" function. Further troubleshooting...the config on the cli before and after reset is the same. The issue also happens when running these OTG tests _feature/interface/staticarp/otg_tests/static_arptest and _feature/bgp/policybase/otg_tests/route_installationtest/ as they get stuck whenever oc DUT interaction phase.

hellt commented 2 years ago

Hi all SR Linux Resetter has been added in https://github.com/openconfig/kne/pull/187 so this issue is hopefully resolved