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

Commit

Permalink
Update device-gpio's config_test (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonicaisHer authored Apr 25, 2022
1 parent 99de32c commit b4451bc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
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

0 comments on commit b4451bc

Please sign in to comment.