Mutualise RebootNow() method on Client

This commit is contained in:
wpetit 2019-02-12 11:12:50 +01:00
parent a1a417b05b
commit e63d7b6f97
4 changed files with 15 additions and 16 deletions

View File

@ -1,4 +1,4 @@
package updater
package emlid
import (
"context"

View File

@ -1,26 +1,20 @@
package updater
package emlid
import (
"context"
"testing"
"time"
"forge.cadoles.com/Pyxis/orion/emlid"
)
func TestClientRebootNow(t *testing.T) {
if !*runUpdaterIntegrationTests {
t.Skip("To run this test, use: go test -updater-integration")
}
if !*runRebootTest {
t.Skip("To run this test, use: go test -updater-reboot-test")
t.Skip("To run this test, use: go test -reboot-test")
}
client := NewClient(
emlid.WithStandardLogger(),
emlid.WithEndpoint(*reachHost, 80),
WithStandardLogger(),
WithEndpoint(*reachHost, 80),
)
if err := client.Connect(); err != nil {
t.Fatal(err)

View File

@ -7,11 +7,6 @@ var runUpdaterIntegrationTests = flag.Bool(
"Run the 'Updater' integration tests (in addition to the unit tests)",
)
var runRebootTest = flag.Bool(
"updater-reboot-test", false,
"Run the updater 'Reboot' test (in addition to the unit tests)",
)
var runJoinNetworkTest = flag.Bool(
"updater-join-network-test", false,
"Run the updater 'JoinWiFiNetwork' test (in addition to the unit tests)",

View File

@ -6,3 +6,13 @@ var runDiscoveryIntegrationTests = flag.Bool(
"discovery-integration", false,
"Run the 'Discovery' integration tests (in addition to the unit tests)",
)
var runRebootTest = flag.Bool(
"reboot-test", false,
"Run the updater 'Reboot' test (in addition to the unit tests)",
)
var reachHost = flag.String(
"reach-host", "192.168.42.1",
"The Reach module host to use in integration tests",
)