Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Update device-gpio's config_test #50

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions test/suites/device-gpio/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,18 @@ import (

// Deprecated
func TestEnvConfig(t *testing.T) {
// start clean
utils.SnapStop(t, deviceGpioService)

t.Run("change service port", func(t *testing.T) {
t.Cleanup(func() {
utils.SnapStop(t, deviceGpioService)
utils.SnapUnset(t, deviceGpioSnap, "env.service.port")
})

const newPort = "56789"
utils.SetEnvConfig(t, deviceGpioSnap, deviceGpioService, defaultServicePort)
}

// make sure the port is available before using it
utils.RequirePortAvailable(t, newPort)
func TestAppConfig(t *testing.T) {
utils.SetAppConfig(t, deviceGpioSnap, deviceGpioService, appName, defaultServicePort)
}

utils.SnapSet(t, deviceGpioSnap, "env.service.port", newPort)
utils.SnapStart(t, deviceGpioSnap)
utils.WaitServiceOnline(t, 60, newPort)
})
func TestGlobalConfig(t *testing.T) {
// start clean
utils.SetGlobalConfig(t, deviceGpioSnap, deviceGpioService, defaultServicePort)
}

func TestAppConfig(t *testing.T) {
t.Skip("TODO")
func TestMixedConfig(t *testing.T) {
utils.SetMixedConfig(t, deviceGpioSnap, deviceGpioService, appName, defaultServicePort)
}
7 changes: 5 additions & 2 deletions test/suites/device-gpio/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import (
"time"
)

const deviceGpioSnap = "edgex-device-gpio"
const deviceGpioService = "edgex-device-gpio.device-gpio"
const (
deviceGpioSnap = "edgex-device-gpio"
appName = "device-gpio"
deviceGpioService = deviceGpioSnap + "." + appName
)

var start = time.Now()

Expand Down