diff --git a/tests/common.go b/tests/common.go index 7b65f4f..c227e53 100644 --- a/tests/common.go +++ b/tests/common.go @@ -6,6 +6,7 @@ import ( "testing" "time" + "github.com/canonical/matter-snap-testing/env" "github.com/canonical/matter-snap-testing/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -19,13 +20,13 @@ func InstallChipTool(t *testing.T) { // clean utils.SnapRemove(t, chipToolSnap) - if utils.LocalServiceSnap() { + if env.SnapPath() != "" { require.NoError(t, - utils.SnapInstallFromFile(nil, utils.LocalServiceSnapPath), + utils.SnapInstallFromFile(nil, env.SnapPath()), ) } else { require.NoError(t, - utils.SnapInstallFromStore(nil, chipToolSnap, utils.ServiceChannel), + utils.SnapInstallFromStore(nil, chipToolSnap, env.SnapChannel()), ) } t.Cleanup(func() { diff --git a/tests/go.mod b/tests/go.mod index c5068f7..1380952 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -1,17 +1,19 @@ module chip-tool-snap-tests -go 1.21.6 +go 1.22.1 + +toolchain go1.22.5 require ( - github.com/canonical/matter-snap-testing v1.0.0-beta.1 - github.com/stretchr/testify v1.8.4 - golang.org/x/crypto v0.20.0 + github.com/canonical/matter-snap-testing v1.0.0-beta.4 + github.com/stretchr/testify v1.9.0 + golang.org/x/crypto v0.25.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/sys v0.22.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/tests/go.sum b/tests/go.sum index cf5ed90..88cfd9c 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -1,5 +1,5 @@ -github.com/canonical/matter-snap-testing v1.0.0-beta.1 h1:obxh5jYRWgCw6QNax4+aY571h+q/zcPZBOP64gwd56E= -github.com/canonical/matter-snap-testing v1.0.0-beta.1/go.mod h1:800wP9+ux8DW9Xr9QvlIdxFHlu85mqlhvlA2JO20aeQ= +github.com/canonical/matter-snap-testing v1.0.0-beta.4 h1:fbmKYeGaIFAlugDBx6ehz0U10bG+WcFSgNBo36hxBL0= +github.com/canonical/matter-snap-testing v1.0.0-beta.4/go.mod h1:gQqLfxxUD2Uo1Ua/L1uIuRhTVghAtdS54yhetTOeSIc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -9,14 +9,14 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= -golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tests/thread_tests/local.go b/tests/thread_tests/local.go index fe42cf2..565cc90 100644 --- a/tests/thread_tests/local.go +++ b/tests/thread_tests/local.go @@ -7,9 +7,10 @@ import ( "testing" "time" - "github.com/canonical/matter-snap-testing/utils" - tests "chip-tool-snap-tests" + + "github.com/canonical/matter-snap-testing/env" + "github.com/canonical/matter-snap-testing/utils" ) func setup(t *testing.T) { @@ -19,7 +20,7 @@ func setup(t *testing.T) { utils.SnapRemove(t, otbrSnap) // Install OTBR - utils.SnapInstallFromStore(t, otbrSnap, utils.ServiceChannel) + utils.SnapInstallFromStore(t, otbrSnap, env.SnapChannel()) t.Cleanup(func() { utils.SnapRemove(t, otbrSnap) }) diff --git a/tests/upgrade_test.go b/tests/upgrade_test.go index 94600b6..e4f6979 100644 --- a/tests/upgrade_test.go +++ b/tests/upgrade_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/canonical/matter-snap-testing/env" "github.com/canonical/matter-snap-testing/utils" ) @@ -31,7 +32,7 @@ func TestUpgrade(t *testing.T) { utils.SnapConnect(t, chipToolSnap+":process-control", "") // Install all clusters app - utils.SnapInstallFromStore(t, allClustersSnap, utils.ServiceChannel) + utils.SnapInstallFromStore(t, allClustersSnap, env.SnapChannel()) // Setup all clusters app utils.SnapSet(t, allClustersSnap, "args", "--wifi") @@ -61,8 +62,8 @@ func TestUpgrade(t *testing.T) { }) t.Run("Upgrade snap", func(t *testing.T) { - if utils.LocalServiceSnap() { - utils.SnapInstallFromFile(t, utils.LocalServiceSnapPath) + if env.SnapPath() != "" { + utils.SnapInstallFromFile(t, env.SnapPath()) } else { utils.SnapRefresh(t, chipToolSnap, "latest/edge") }