Skip to content

Commit

Permalink
Remove duplication in log file names
Browse files Browse the repository at this point in the history
  • Loading branch information
jpm-canonical committed Aug 7, 2024
1 parent 7dd9c0f commit 1bb60c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 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", stdout))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool", 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", stdout))
assert.NoError(t, utils.WriteLogFile(t, "chip-tool", 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
8 changes: 4 additions & 4 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", stdout))
assert.NoError(t, utils.WriteLogFile(t, chipToolSnap, 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", stdout))
assert.NoError(t, utils.WriteLogFile(t, chipToolSnap, stdout))

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

t.Run("Control upgraded snap", func(t *testing.T) {
t.Run("Control after upgrade", func(t *testing.T) {
snapVersion := utils.SnapVersion(t, chipToolSnap)
snapRevision := utils.SnapRevision(t, chipToolSnap)
log.Printf("%s installed version %s build %s\n", chipToolSnap, snapVersion, snapRevision)

start := time.Now()
stdout, _, _ := utils.Exec(t, "chip-tool onoff off 110 1 2>&1")
assert.NoError(t, utils.WriteLogFile(t, "chip-tool-onoff", stdout))
assert.NoError(t, utils.WriteLogFile(t, chipToolSnap, 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", stdout))
assert.NoError(t, utils.WriteLogFile(t, chipToolSnap, 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", stdout))
assert.NoError(t, utils.WriteLogFile(t, chipToolSnap, stdout))

waitForOnOffHandlingByAllClustersApp(t, start)
})
Expand Down

0 comments on commit 1bb60c4

Please sign in to comment.