Skip to content

Commit

Permalink
cacert flag is changing to caCert (#9)
Browse files Browse the repository at this point in the history
[#6 ] cacert flag is changing to caCert

- Required dependencies to suite-connector and resources are changed

Signed-off-by: Antonia Avramova <antonia.avramova@bosch.io>
  • Loading branch information
antonia-avramova authored Aug 23, 2022
1 parent eb5c8f5 commit 7a823a2
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 17 deletions.
6 changes: 6 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ imdario/mergo (0.3.12)
* Project: https://github.com/imdario/mergo
* Source: https://github.com/imdario/mergo/releases/tag/0.3.12

tevino/abool (2.0.1)

* License: MIT License
* Project: https://github.com/tevino/abool
* Source: https://github.com/tevino/abool/releases/tag/v2.0.1

google/go-tpm (0.3.2)

* License: Apache License 2.0
Expand Down
2 changes: 1 addition & 1 deletion cmd/twins/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (l *launcher) Run(
honoClient.AddConnectionListener(synchronizeHandler)
defer honoClient.RemoveConnectionListener(synchronizeHandler)

if err := config.LocalConnect(cloudClient, logger); err != nil {
if err := config.LocalConnect(context.Background(), cloudClient, logger); err != nil {
logger.Error("Cannot connect to local broker", err, nil)
app.StopRouter(r)
return
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.17
require (
github.com/Jeffail/gabs/v2 v2.6.1
github.com/ThreeDotsLabs/watermill v1.1.1
github.com/eclipse-kanto/suite-connector v0.1.0-M1
github.com/eclipse-kanto/suite-connector v0.1.0-M1.0.20220822083435-d47b0a2edf1a
github.com/imdario/mergo v0.3.12
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
Expand All @@ -27,6 +27,7 @@ require (
github.com/lithammer/shortuuid/v3 v3.0.4 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tevino/abool/v2 v2.0.1 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ 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=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/eclipse-kanto/suite-connector v0.1.0-M1 h1:w+CIM+2jF3m/uUrOZKhukrJactz16/Rw9uzPhOzbFXc=
github.com/eclipse-kanto/suite-connector v0.1.0-M1/go.mod h1:bE+Ydj8vNyPTRBaEFJ4CAh3/2W+mz7eyGh19Wg0HswE=
github.com/eclipse-kanto/suite-connector v0.1.0-M1.0.20220822083435-d47b0a2edf1a h1:Arf9Zhlz65DkGEzc2Vy5JqQVbd41ZUnJvKQOCt7YFxw=
github.com/eclipse-kanto/suite-connector v0.1.0-M1.0.20220822083435-d47b0a2edf1a/go.mod h1:dT/Iz+SN/PbWatJQ6GBFJN5XX0TncX61WRQjylf2uJs=
github.com/eclipse/ditto-clients-golang v0.0.0-20220225085802-cf3b306280d3 h1:bfFGs26yNSfhSi6xmnmykB0jZn1Vu5e1/7JA5Wu5aGc=
github.com/eclipse/ditto-clients-golang v0.0.0-20220225085802-cf3b306280d3/go.mod h1:ey7YwfHSQJsinGkGbgeEgqZA7qJnoB0YiFVTFEY50Jg=
github.com/eclipse/paho.mqtt.golang v1.3.5/go.mod h1:eTzb4gxwwyWpqBUHGQZ4ABAV7+Jgm1PklsYT/eo8Hcc=
Expand Down Expand Up @@ -152,12 +152,15 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tevino/abool/v2 v2.0.1 h1:OF7FC5V5z3yAWyixbc32ecEzrgAJCsPkVOsPM2qoZPI=
github.com/tevino/abool/v2 v2.0.1/go.mod h1:+Lmlqk6bHDWHqN1cbxqhwEAwMPXgc8I1SDEamtseuXY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
Expand Down
6 changes: 3 additions & 3 deletions internal/commands/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s *CommandsSuite) S() *CommandsSuite {
}

func (s *CommandsSuite) SetupSuite() {
handler, err := NewTestHandler(s.provisioning)
handler, err := NewTestHandler(s.provisioning, s.T())
require.NoError(s.T(), err)
s.handler = handler
}
Expand All @@ -103,7 +103,7 @@ func (s *CommandsSuite) TearDownTest() {
s.deleteThing()
}

func NewTestHandler(autoProvisioning bool) (*commands.Handler, error) {
func NewTestHandler(autoProvisioning bool, t *testing.T) (*commands.Handler, error) {
handler := &commands.Handler{}
db, err := persistence.NewThingsDB(dbLocation, testThingID)
if err != nil {
Expand All @@ -119,7 +119,7 @@ func NewTestHandler(autoProvisioning bool) (*commands.Handler, error) {
handler.HonoPub = &testPublisher{
buffer: list.New(),
}
handler.Logger = testutil.NewLogger("commands", logger.TRACE)
handler.Logger = testutil.NewLogger("commands", logger.TRACE, t)
return handler, nil
}

Expand Down
6 changes: 3 additions & 3 deletions internal/sync/cloud_retrieve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestCloudRetrieveSuite(t *testing.T) {
}

func (s *CloudRetrieveSuite) SetupSuite() {
sync, err := NewTestCloudRetrieveSynchronizer()
sync, err := NewTestCloudRetrieveSynchronizer(s.T())
require.NoError(s.T(), err)
s.sync = sync
addTestThing(s)
Expand All @@ -78,7 +78,7 @@ func (s *CloudRetrieveSuite) SetupSuite() {
WithStatus(http.StatusOK)
}

func NewTestCloudRetrieveSynchronizer() (*sync.Synchronizer, error) {
func NewTestCloudRetrieveSynchronizer(t *testing.T) (*sync.Synchronizer, error) {
db, err := persistence.NewThingsDB(dbLocation, testThingID)
if err != nil {
return nil, err
Expand All @@ -92,7 +92,7 @@ func NewTestCloudRetrieveSynchronizer() (*sync.Synchronizer, error) {
TenantID: "cloud:retrieve:tenant",
},
Storage: db,
Logger: testutil.NewLogger("sync", logger.TRACE),
Logger: testutil.NewLogger("sync", logger.TRACE, t),
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/sync/it_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (s *SyncSuite) SetupSuite() {
require.NoError(s.T(), err)
s.test = test

client, err := testutil.NewMessageClient()
client, err := testutil.NewMessageClient(s.T())
require.NoError(s.T(), err)

rootThingName := client.Subscription.DeviceName
Expand Down
6 changes: 3 additions & 3 deletions internal/sync/synchronizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s *SynchronizerSuite) S() *SynchronizerSuite {
}

func (s *SynchronizerSuite) SetupSuite() {
synchronizer, err := NewTestSynchronizer()
synchronizer, err := NewTestSynchronizer(s.T())
require.NoError(s.T(), err)
s.sync = synchronizer
}
Expand Down Expand Up @@ -91,7 +91,7 @@ func (s *SynchronizerSuite) deleteThing() {

}

func NewTestSynchronizer() (*sync.Synchronizer, error) {
func NewTestSynchronizer(t *testing.T) (*sync.Synchronizer, error) {
db, err := persistence.NewThingsDB(dbLocation, syncTestThingID)
if err != nil {
return nil, err
Expand All @@ -106,7 +106,7 @@ func NewTestSynchronizer() (*sync.Synchronizer, error) {
TenantID: "tenantID",
},
Storage: db,
Logger: testutil.NewLogger("sync", logger.TRACE),
Logger: testutil.NewLogger("sync", logger.TRACE, t),
}
sync.Connected(true)
return sync, nil
Expand Down
5 changes: 3 additions & 2 deletions internal/testutil/message_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"context"
"fmt"
"strings"
"testing"

"github.com/ThreeDotsLabs/watermill"
"github.com/ThreeDotsLabs/watermill/message"
Expand Down Expand Up @@ -43,7 +44,7 @@ type MessageClient struct {

// NewMessageClient returns a new MessageClient with an initialized testutil.SubscriptionDetails, local MQTT connection
// and publisher.
func NewMessageClient() (*MessageClient, error) {
func NewMessageClient(t *testing.T) (*MessageClient, error) {
subsDetails, err := readSubscriptionTestData()
if err != nil {
return nil, err
Expand All @@ -53,7 +54,7 @@ func NewMessageClient() (*MessageClient, error) {
Subscription: subsDetails,
}

logger := testutil.NewLogger("integration", logger.DEBUG)
logger := testutil.NewLogger("integration", logger.DEBUG, t)
c.logger = logger

config, err := testutil.NewLocalConfig()
Expand Down
2 changes: 1 addition & 1 deletion resources/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cacert": "/etc/local-digital-twins/iothub.crt",
"caCert": "/etc/local-digital-twins/iothub.crt",
"provisioningFile": "/etc/local-digital-twins/provisioning.json",
"logFile": "/var/log/local-digital-twins/local-digital-twins.log",
"thingsDb": "/var/lib/local-digital-twins/thing.db"
Expand Down

0 comments on commit 7a823a2

Please sign in to comment.