Skip to content

Commit

Permalink
Adding changes to the complete chassis reboot test
Browse files Browse the repository at this point in the history
  • Loading branch information
hattikals committed Dec 4, 2024
1 parent e394152 commit 4053a09
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,18 @@ func TestChassisReboot(t *testing.T) {
t.Logf("Time elapsed %.2f seconds > %d reboot delay", time.Since(start).Seconds(), rebootDelay)
break
}
latestTime, err := time.Parse(time.RFC3339, gnmi.Get(t, dut, gnmi.OC().System().CurrentDatetime().State()))
if err != nil {
var latestTime time.Time
var err error
if errMsg := testt.CaptureFatal(t, func(t testing.TB) {
latestTime, err = time.Parse(time.RFC3339, gnmi.Get(t, dut, gnmi.OC().System().CurrentDatetime().State()))
if err != nil {
t.Fatalf("Failed parsing current-datetime: %s", err)
}
}); errMsg != nil && time.Since(start).Seconds() < rebootDelay {
t.Fatalf("Get request failed before reboot delay, %s", *errMsg)
}

if err != nil && time.Since(start).Seconds() < rebootDelay {
t.Fatalf("Failed parsing current-datetime: %s", err)
}
if latestTime.Before(prevTime) || latestTime.Equal(prevTime) {
Expand Down

0 comments on commit 4053a09

Please sign in to comment.