Skip to content

Commit

Permalink
Added defer function to cleanup fib table (#3561)
Browse files Browse the repository at this point in the history
currently after test is complete OTG retains its config and due to which
following tests are failing as fib is full and not able to install any
more routes.  added defer function to stop BGP protocol that will clear
all routes injecected .

"This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind."
  • Loading branch information
bkreddy143 authored Nov 6, 2024
1 parent 55b08c4 commit 41f39ba
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func TestFibFailDueToHwResExhaust(t *testing.T) {
WithFIBACK().WithRedundancyMode(fluent.ElectedPrimaryClient)
client.Start(ctx, t)
defer client.Stop(t)

gribi.FlushAll(client)
defer func() {
// Flush all entries after test.
if err := gribi.FlushAll(client); err != nil {
Expand Down Expand Up @@ -334,6 +334,12 @@ func TestFibFailDueToHwResExhaust(t *testing.T) {
otg: otg,
}
start := time.Now()
// cleanup fib table
defer func() {
ate.OTG().StopProtocols(t)
time.Sleep(5 * time.Minute)
}()

injectEntry(ctx, t, args, dstIPList, vipList)
t.Logf("Main Function: Time elapsed %.2f seconds since start", time.Since(start).Seconds())

Expand Down

0 comments on commit 41f39ba

Please sign in to comment.