Skip to content

Commit

Permalink
Check services startup completion (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonicaisHer authored Apr 9, 2024
1 parent 35503fd commit 3da1259
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/snap_services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tests

import (
"testing"
"time"

"github.com/canonical/matter-snap-testing/utils"
"github.com/stretchr/testify/require"
Expand All @@ -15,12 +16,17 @@ func TestSnapServicesStatus(t *testing.T) {
utils.SnapStop(t, otbrSnap)
})

start := time.Now()
utils.SnapStart(nil, otbrSnap)

// Oneshot service
utils.WaitForLogMessage(t, otbrSetupApp, "OTBR completed oneshot setup", start)
require.False(t, utils.SnapServicesActive(t, otbrSetupApp))

// Active services
utils.WaitForLogMessage(t, otbrWebApp, "Border router web started", start)
require.True(t, utils.SnapServicesActive(t, otbrWebApp))

utils.WaitForLogMessage(t, otbrAgentApp, "Start Thread Border Agent: OK", start)
require.True(t, utils.SnapServicesActive(t, otbrAgentApp))
}

0 comments on commit 3da1259

Please sign in to comment.