Describe the bug
CNTR-3 test 'TestContainerPersistenceAfterColdReboot' is starting the container with default restart policy(none) because of which the container is not persistent after reboot.
To Reproduce
Steps to reproduce the behavior:
- Setup device for CNTR-3 featureprofile test
- Run the test TestContainerPersistenceAfterColdReboot in failover_test.go
- Test will fail with current code
Expected behavior
As per the test, the container is expected to be in RUNNING state after cold reboot of the device. But the container is not in RUNNING state as it was not started with restart policy set to 'always' or 'on-failure' before reboot.
Logs
=== RUN TestContainerPersistenceAfterColdReboot/VerifyPersistence
failover_test.go:485: Waiting for DUT to reboot and reconnect...
failover_test.go:490:
*** Fetching gNOI clients for scapa-ptx10008-a...
failover_test.go:495: Container persistence failed: timed out after 5m0s waiting for container cntrsrv to be in state RUNNING
=== NAME TestContainerPersistenceAfterColdReboot
failover_test.go:415: Starting cleanup...
failover_test.go:417:
*** Fetching gNOI clients for scapa-ptx10008-a...
failover_test.go:427: Cleanup finished.
Network device platform (please complete the following information):
Additional context
The issue is not seen when I make following changes to line number 445-448 of failover_test.go to include restart-policy while starting container:
Original code:
startOpts := []client.StartOption{
client.WithPorts([]string{"60061:60061"}),
client.WithVolumes([]string{fmt.Sprintf("%s:%s", volName, "/data")}),
}
Modified code:
startOpts := []client.StartOption{
client.WithPorts([]string{"60061:60061"}),
client.WithVolumes([]string{fmt.Sprintf("%s:%s", volName, "/data")}),
client.WithRestartPolicy("always"),
}
Describe the bug
CNTR-3 test 'TestContainerPersistenceAfterColdReboot' is starting the container with default restart policy(none) because of which the container is not persistent after reboot.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
As per the test, the container is expected to be in RUNNING state after cold reboot of the device. But the container is not in RUNNING state as it was not started with restart policy set to 'always' or 'on-failure' before reboot.
Logs
=== RUN TestContainerPersistenceAfterColdReboot/VerifyPersistence
failover_test.go:485: Waiting for DUT to reboot and reconnect...
failover_test.go:490:
*** Fetching gNOI clients for scapa-ptx10008-a...
=== NAME TestContainerPersistenceAfterColdReboot
failover_test.go:415: Starting cleanup...
failover_test.go:417:
*** Fetching gNOI clients for scapa-ptx10008-a...
Network device platform (please complete the following information):
Additional context
The issue is not seen when I make following changes to line number 445-448 of failover_test.go to include restart-policy while starting container:
Original code:
Modified code: