Skip to content

Commit

Permalink
Change WriteLogFile to accept a string
Browse files Browse the repository at this point in the history
  • Loading branch information
jpm-canonical committed Aug 2, 2024
1 parent 95017a7 commit 8712719
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/thread_tests/thread_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ func TestAllClustersAppThread(t *testing.T) {
t.Run("Commission", func(t *testing.T) {
stdout, _, _ := utils.Exec(t, "chip-tool pairing code-thread 110 hex:"+trimmedActiveDataset+" 34970112332 2>&1")

assert.NoError(t, utils.WriteLogFile(t, "chip-tool-thread-pairing", []byte(stdout)))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-thread-pairing", stdout))
})

t.Run("Control", func(t *testing.T) {
start := time.Now()
stdout, _, _ := utils.Exec(t, "chip-tool onoff toggle 110 1 2>&1")

assert.NoError(t, utils.WriteLogFile(t, "chip-tool-thread-onoff", []byte(stdout)))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-thread-onoff", stdout))

// 0x6 is the Matter Cluster ID for on-off
// Using cluster ID here because of a buffering issue in the log stream:
Expand Down
6 changes: 3 additions & 3 deletions tests/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestUpgrade(t *testing.T) {

t.Run("Commission", func(t *testing.T) {
stdout, _, _ := utils.Exec(t, "chip-tool pairing onnetwork 110 20202021 2>&1")
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-pairing", []byte(stdout)))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-pairing", stdout))
})

t.Run("Control before upgrade", func(t *testing.T) {
Expand All @@ -58,7 +58,7 @@ func TestUpgrade(t *testing.T) {

start := time.Now()
stdout, _, _ := utils.Exec(t, "chip-tool onoff on 110 1 2>&1")
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-onoff", []byte(stdout)))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-onoff", stdout))

waitForOnOffHandlingByAllClustersApp(t, start)
})
Expand All @@ -78,7 +78,7 @@ func TestUpgrade(t *testing.T) {

start := time.Now()
stdout, _, _ := utils.Exec(t, "chip-tool onoff off 110 1 2>&1")
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-onoff", []byte(stdout)))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-onoff", stdout))

waitForOnOffHandlingByAllClustersApp(t, start)
})
Expand Down
4 changes: 2 additions & 2 deletions tests/wifi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ func TestAllClustersAppWiFi(t *testing.T) {

t.Run("Commission", func(t *testing.T) {
stdout, _, _ := utils.Exec(t, "chip-tool pairing onnetwork 110 20202021 2>&1")
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-pairing", []byte(stdout)))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-pairing", stdout))
})

t.Run("Control", func(t *testing.T) {
stdout, _, _ := utils.Exec(t, "chip-tool onoff toggle 110 1 2>&1")
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-toggle", []byte(stdout)))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-toggle", stdout))

waitForOnOffHandlingByAllClustersApp(t, start)
})
Expand Down

0 comments on commit 8712719

Please sign in to comment.