Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests by changing log assertions #69

Merged
merged 11 commits into from
Jul 5, 2024
Merged

Fix tests by changing log assertions #69

merged 11 commits into from
Jul 5, 2024

Conversation

farshidtz
Copy link
Member

@farshidtz farshidtz commented Jul 3, 2024

Summary

  • Fix time reference for log queries
  • Move "Upgrade snap" to a subtest so it doesn't run when a previous subtest fails in failfast mode
  • Set unique names for subtest logs to avoid overriding others
  • Update reference log message for the assertions - the SDK has changed the log prefixes
  • Remove obsolete log dump for chip tool, as it has no service that writes logs to the journal
  • The CHIP logs are now buffered, possibly since Choose logging backend on a per-target basis project-chip/connectedhomeip#32119. Change the assertions to seek a reference that is produced prior to the buffering of request handling debug info.
  • Comment out bluetooth setup on remote device in thread tests as bluetooth isn't needed.

@farshidtz
Copy link
Member Author

farshidtz commented Jul 3, 2024

The journal doesn't report logs from when the Matter request is received up until when the stop signal is sent (starting from 16:26:22 in the logs below). The CHIP logs timestamp show that the logs are produced on time but the journal does not receive them. Strangely, this only sometimes happens and in the TestAllClustersApp, but not the TestUpgrade. Adding a 30 seconds delay in tests did not help either.

Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [EM] Handling via exchange: 43167r, Delegate: 0x55aaf06a2128
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG] InvokeRequestMessage =
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG] {
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]         suppressResponse = false, 
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]         timedRequest = false, 
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]         InvokeRequests =
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]         [
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                 CommandDataIB =
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                 {
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                         CommandPathIB =
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                         {
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                                 EndpointId = 0x1,
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                                 ClusterId = 0x6,
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                                 CommandId = 0x2,
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                         },
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                         
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                         CommandFields = 
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                         {
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                         },
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                 },
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]                 
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]         ],
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]         
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG]         InteractionModelRevision = 11
Jul 03 16:26:12 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG] },

<<< snap removed as part of teardown >>>

Jul 03 16:26:22 fv-az1776-301 sudo[6742]:   runner : PWD=/home/runner/work/chip-tool-snap/chip-tool-snap/tests ; USER=root ; COMMAND=/usr/bin/snap remove --purge matter-all-clusters-app
Jul 03 16:26:22 fv-az1776-301 systemd[1]: Stopping Service for snap application matter-all-clusters-app.all-clusters-app...

<<< rest of the logs coming >>>
<<< note that the CHIP unix timestamp is now 10 seconds behind the journal >>>

Jul 03 16:26:22 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG] AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o
Jul 03 16:26:22 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG] AccessControl: allowed
Jul 03 16:26:22 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [DMG] Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0002
Jul 03 16:26:22 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023972.079] [6636:6636] [ZCL] Toggle ep1 on/off from state 0 to 1
...
Jul 03 16:26:22 fv-az1776-301 matter-all-clusters-app.all-clusters-app[6636]: [1720023982.529] [6636:6636] [DL] System Layer shutdown
Jul 03 16:26:22 fv-az1776-301 systemd[1]: snap.matter-all-clusters-app.all-clusters-app.service: Deactivated successfully.
Jul 03 16:26:22 fv-az1776-301 systemd[1]: Stopped Service for snap application matter-all-clusters-app.all-clusters-app.

Copy link

github-actions bot commented Jul 3, 2024

Everyone contributing to this PR have now signed the CLA. Thanks!

@farshidtz farshidtz marked this pull request as ready for review July 4, 2024 08:14
@farshidtz farshidtz requested a review from jpm-canonical July 4, 2024 08:14
@farshidtz farshidtz changed the title Fix tests by updating log references and unbuffering logs Fix tests by changing log assertions Jul 4, 2024
tests/wifi_test.go Show resolved Hide resolved
@jpm-canonical
Copy link
Contributor

Using this branch, running the tests in the naive way, using the command provided in the readme, fails.

~/chip-tool-snap/tests$ git status
On branch fix-tests
Your branch is up to date with 'origin/fix-tests'.

nothing to commit, working tree clean
~/chip-tool-snap/tests$ go test -v -failfast -count 1
=== RUN   TestUpgrade
    snap.go:62: [exec] sudo snap remove --purge matter-all-clusters-app
[sudo] password for jpmeijers: 
    exec.go:140: [stderr] snap "matter-all-clusters-app" is not installed
    snap.go:62: [exec] sudo snap remove --purge chip-tool
    exec.go:140: [stdout] chip-tool removed
    snap.go:28: [exec] sudo snap install chip-tool --channel=latest/stable
    exec.go:140: [stdout] chip-tool v1.3.0.0+snap from Canonical IoT Labs installed
    snap.go:81: [exec] sudo snap connect chip-tool:avahi-observe 
    snap.go:81: [exec] sudo snap connect chip-tool:bluez 
    snap.go:81: [exec] sudo snap connect chip-tool:process-control 
    snap.go:28: [exec] sudo snap install matter-all-clusters-app --channel=latest/edge
    exec.go:140: [stdout] matter-all-clusters-app (edge) cde0b92d+snap from Canonical IoT Labs installed
    snap.go:143: [exec] sudo snap set matter-all-clusters-app args='--wifi'
    snap.go:81: [exec] sudo snap connect matter-all-clusters-app:avahi-control 
    snap.go:81: [exec] sudo snap connect matter-all-clusters-app:bluez 
    snap.go:161: [exec] sudo snap start --enable matter-all-clusters-app
    exec.go:140: [stdout] Started.
    config.go:59: Retry 1/10: Waiting for expected content in logs: CHIP minimal mDNS started advertising
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:22:51" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:63: Found expected content in logs: CHIP minimal mDNS started advertising
=== RUN   TestUpgrade/Commission
    upgrade_test.go:47: [exec] sudo chip-tool pairing onnetwork 110 20202021 2>&1
=== RUN   TestUpgrade/Control_before_upgrade
    snap.go:105: [exec] snap info chip-tool | grep installed | awk '{print $2}'
    exec.go:140: [stdout] v1.3.0.0+snap
    snap.go:113: [exec] snap list chip-tool | awk 'NR==2 {print $3}'
    exec.go:140: [stdout] 96
2024/07/04 16:23:29 chip-tool installed version v1.3.0.0+snap build 96
    upgrade_test.go:57: [exec] sudo chip-tool onoff on 110 1 2>&1
    config.go:59: Retry 1/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 2/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 3/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 4/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 5/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 6/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 7/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 8/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 9/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:59: Retry 10/10: Waiting for expected content in logs: Toggle ep1 on/off from state 0 to 1
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 16:23:29" --no-pager | grep "matter-all-clusters-app"|| true
    config.go:68: Time out: reached max 10 retries.
2024/07/04 16:23:40 [exec] sudo snap remove --purge matter-all-clusters-app
2024/07/04 16:23:44 [stdout] matter-all-clusters-app removed
2024/07/04 16:23:44 [exec] (sudo journalctl --since "2024-07-04 16:22:51" --no-pager | grep "matter-all-clusters-app"|| true) > matter-all-clusters-app.log
Wrote snap logs to /home/jpmeijers/chip-tool-snap/tests/matter-all-clusters-app.log
2024/07/04 16:23:44 [exec] sudo snap remove --purge chip-tool
2024/07/04 16:23:48 [stdout] chip-tool removed
--- FAIL: TestUpgrade (56.42s)
    --- PASS: TestUpgrade/Commission (0.77s)
    --- FAIL: TestUpgrade/Control_before_upgrade (11.43s)
FAIL
exit status 1
FAIL	chip-tool-snap-tests	56.427s

@farshidtz
Copy link
Member Author

@jpm-canonical so I believe the other instances of asserting the log message should be replaced with checking the cluster ID.

Copy link
Contributor

@jpm-canonical jpm-canonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After changing to look for ClusterId = 0x6 the non-thread tests pass.

tests/upgrade_test.go Outdated Show resolved Hide resolved
tests/upgrade_test.go Outdated Show resolved Hide resolved
@farshidtz
Copy link
Member Author

Similar issue in thread tests:

Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [EM] Handling via exchange: 1089r, Delegate: 0xaaaad795f948
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG] InvokeRequestMessage =
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG] {
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]         suppressResponse = false, 
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]         timedRequest = false, 
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]         InvokeRequests =
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]         [
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                 CommandDataIB =
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                 {
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                         CommandPathIB =
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                         {
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                                 EndpointId = 0x1,
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                                 ClusterId = 0x6,
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                                 CommandId = 0x2,
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                         },
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                         
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                         CommandFields = 
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                         {
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                         },
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                 },
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]                 
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]         ],
Jul 04 20:16:19 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]         

<starting here>

Jul 04 20:16:29 ubuntu sudo[9090]:   ubuntu : PWD=/home/ubuntu ; USER=root ; COMMAND=/usr/bin/snap remove --purge matter-all-clusters-app
Jul 04 20:16:29 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG]         InteractionModelRevision = 11
Jul 04 20:16:29 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG] },
Jul 04 20:16:29 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG] AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0006 e=1 p=o
Jul 04 20:16:29 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG] AccessControl: allowed
Jul 04 20:16:29 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [DMG] Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0002
Jul 04 20:16:29 ubuntu matter-all-clusters-app.all-clusters-app[9036]: [1720124179.177] [9036:9036] [ZCL] Toggle ep1 on/off from state 0 to 1

Failing tests:

=== RUN   TestAllClustersAppThread/Control
    thread_test.go:28: [exec] sudo chip-tool onoff toggle 110 1 2>&1
    thread_test.go:33: Retry 1/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 2/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 3/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 4/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 5/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 6/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 7/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 8/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 9/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Retry 10/10: Waiting for expected content in logs: 'CHIP:ZCL: Toggle ep1 on/off'
    thread_test.go:33: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:16:18" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:33: Time out: reached max 10 retries.
    thread_test.go:33: [exec-ssh] journalctl --no-pager --lines=10 --unit=snap.openthread-border-router.otbr-agent --priority=notice
    thread_test.go:33: Jul 04 20:15:47 ubuntu otbr-agent[7932]: [NOTE]-AGENT---: Running 0.3.0-thread-reference-20230710-dirty
        Jul 04 20:15:47 ubuntu otbr-agent[7932]: [NOTE]-AGENT---: Thread version: 1.3.0
        Jul 04 20:15:47 ubuntu otbr-agent[7932]: [NOTE]-AGENT---: Thread interface: wpan0
        Jul 04 20:15:47 ubuntu otbr-agent[7932]: [NOTE]-AGENT---: Radio URL: spinel+hdlc+uart:///dev/ttyACM0
        Jul 04 20:15:47 ubuntu otbr-agent[7932]: [NOTE]-ILS-----: Infra link selected: eth0
        Jul 04 20:15:47 ubuntu otbr-agent[7932]: 00:00:00.024 [N] RoutingManager: No valid /48 BR ULA prefix found in settings, generating new one
        Jul 04 20:15:47 ubuntu otbr-agent[7932]: 00:00:00.030 [N] RoutingManager: BR ULA prefix: fd11:f474:da40::/48 (generated)
        Jul 04 20:15:47 ubuntu otbr-agent[7932]: 00:00:00.030 [N] RoutingManager: Local on-link prefix: fdde:ad00:beef:cafe::/64
        Jul 04 20:15:47 ubuntu otbr-agent[7932]: [WARN]-BA------: Result of publish meshcop service OpenThread BorderRouter #F796._meshcop._udp.local: Invalid state
        Jul 04 20:16:17 ubuntu otbr-agent[7932]: [ERR ]-UTILS---: Replied to org.freedesktop.DBus.Properties.GetAll with result io.openthread.Error.NotImplemented
        
=== NAME  TestAllClustersAppThread
    remote.go:116: [exec-ssh] sudo snap remove --purge matter-all-clusters-app
    remote.go:87: [exec-ssh] sudo snap remove --purge openthread-border-router
    snap.go:62: [exec] sudo snap remove --purge openthread-border-router
    exec.go:140: [stdout] openthread-border-router removed
    snap.go:62: [exec] sudo snap remove --purge chip-tool
    exec.go:140: [stdout] chip-tool removed
--- FAIL: TestAllClustersAppThread (106.94s)
    --- PASS: TestAllClustersAppThread/Commission (1.07s)
    --- FAIL: TestAllClustersAppThread/Control (10.89s)
FAIL
FAIL    chip-tool-snap-tests/thread_tests       106.943s
FAIL

@farshidtz
Copy link
Member Author

farshidtz commented Jul 4, 2024

Thread tests:

$ LOCAL_INFRA_IF="enp2s0" REMOTE_INFRA_IF="eth0" REMOTE_USER="ubuntu" REMOTE_PASSWORD="raspberry" REMOTE_HOST="192.168.1.24" go test -v -failfast -count 1 ./thread_tests
=== RUN   TestAllClustersAppThread
    snap.go:62: [exec] sudo snap remove --purge chip-tool
    exec.go:140: [stderr] snap "chip-tool" is not installed
2024/07/04 22:26:18 [exec] sudo snap install chip-tool --channel=latest/edge
2024/07/04 22:26:21 [stdout] chip-tool (edge) cde0b92d+snap from Canonical IoT Labs installed
    snap.go:81: [exec] sudo snap connect chip-tool:avahi-observe 
    snap.go:81: [exec] sudo snap connect chip-tool:bluez 
    snap.go:81: [exec] sudo snap connect chip-tool:process-control 
    snap.go:62: [exec] sudo snap remove --purge openthread-border-router
    exec.go:140: [stderr] snap "openthread-border-router" is not installed
    snap.go:28: [exec] sudo snap install openthread-border-router --channel=latest/edge
    exec.go:140: [stdout] openthread-border-router (edge) thread-reference-20230710+snap from Canonical IoT Labs installed
2024/07/04 22:26:26 [exec] sudo snap connect openthread-border-router:avahi-control 
2024/07/04 22:26:27 [exec] sudo snap connect openthread-border-router:firewall-control 
2024/07/04 22:26:27 [exec] sudo snap connect openthread-border-router:raw-usb 
2024/07/04 22:26:28 [exec] sudo snap connect openthread-border-router:network-control 
2024/07/04 22:26:29 [exec] sudo snap connect openthread-border-router:bluetooth-control 
2024/07/04 22:26:30 [exec] sudo snap connect openthread-border-router:bluez 
2024/07/04 22:26:31 [exec] sudo snap set openthread-border-router infra-if='enp2s0'
2024/07/04 22:26:31 [exec] sudo snap set openthread-border-router radio-url='spinel+hdlc+uart:///dev/ttyACM0'
    snap.go:161: [exec] sudo snap start --enable openthread-border-router
    exec.go:140: [stdout] Started.
    local.go:76: Retry 1/10: Waiting for expected content in logs: Start Thread Border Agent: OK
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    local.go:80: Found expected content in logs: Start Thread Border Agent: OK
    local.go:55: [exec] sudo openthread-border-router.ot-ctl dataset init new
    local.go:56: [exec] sudo openthread-border-router.ot-ctl dataset commit active
    local.go:57: [exec] sudo openthread-border-router.ot-ctl ifconfig up
    local.go:58: [exec] sudo openthread-border-router.ot-ctl thread start
    config.go:59: Retry 1/10: Waiting for expected content in logs: Thread Network
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    config.go:59: Retry 2/10: Waiting for expected content in logs: Thread Network
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    config.go:59: Retry 3/10: Waiting for expected content in logs: Thread Network
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    config.go:59: Retry 4/10: Waiting for expected content in logs: Thread Network
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    config.go:59: Retry 5/10: Waiting for expected content in logs: Thread Network
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    config.go:59: Retry 6/10: Waiting for expected content in logs: Thread Network
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    config.go:59: Retry 7/10: Waiting for expected content in logs: Thread Network
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    config.go:59: Retry 8/10: Waiting for expected content in logs: Thread Network
    snap.go:138: [exec] sudo journalctl --since "2024-07-04 22:26:31" --no-pager | grep "openthread-border-router"|| true
    config.go:63: Found expected content in logs: Thread Network
    local.go:63: [exec] sudo openthread-border-router.ot-ctl dataset active -x | awk '{print $NF}' | grep --invert-match "Done"
    remote.go:81: SSH: connected to 192.168.1.24
    remote.go:106: [exec-ssh] sudo snap remove --purge openthread-border-router
    remote.go:106: [exec-ssh] sudo snap install openthread-border-router --edge
    remote.go:106: [exec-ssh] sudo snap set openthread-border-router infra-if='eth0'
    remote.go:106: [exec-ssh] sudo snap set openthread-border-router radio-url='spinel+hdlc+uart:///dev/ttyACM0'
    remote.go:106: [exec-ssh] sudo snap connect openthread-border-router:firewall-control
    remote.go:106: [exec-ssh] sudo snap connect openthread-border-router:raw-usb
    remote.go:106: [exec-ssh] sudo snap connect openthread-border-router:network-control
    remote.go:106: [exec-ssh] sudo snap start openthread-border-router
    remote.go:109: Retry 1/10: Waiting for expected content in logs: 'Start Thread Border Agent: OK'
    remote.go:109: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:26:42" --no-pager | grep "openthread-border-router"|| true
    remote.go:109: Found expected content in logs: 'Start Thread Border Agent: OK'
    remote.go:110: OTBR on remote device is ready
    remote.go:132: [exec-ssh] sudo snap remove --purge matter-all-clusters-app
    remote.go:132: [exec-ssh] sudo snap install matter-all-clusters-app --edge
    remote.go:132: [exec-ssh] sudo snap set matter-all-clusters-app args='--thread'
    remote.go:132: [exec-ssh] sudo snap connect matter-all-clusters-app:avahi-control
    remote.go:132: [exec-ssh] sudo snap connect matter-all-clusters-app:otbr-dbus-wpan0 openthread-border-router:dbus-wpan0
    remote.go:132: [exec-ssh] sudo snap start matter-all-clusters-app
    remote.go:135: Retry 1/10: Waiting for expected content in logs: 'CHIP minimal mDNS started advertising'
    remote.go:135: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:26:56" --no-pager | grep "matter-all-clusters-app"|| true
    remote.go:135: Found expected content in logs: 'CHIP minimal mDNS started advertising'
    remote.go:136: Matter All Clusters App is ready
=== RUN   TestAllClustersAppThread/Commission
    thread_test.go:20: [exec] sudo chip-tool pairing code-thread 110 hex:0e080000000000010000000300001335060004001fffe00208656c2f1b40199e910708fd417409cd1004560510c2c69eebfe413338285161957078bed1030f4f70656e5468726561642d3362353101023b510410dfa02658645e6f8da538d5dd39d6ec590c0402a0f7f8 34970112332 2>&1
=== RUN   TestAllClustersAppThread/Control
    thread_test.go:28: [exec] sudo chip-tool onoff toggle 110 1 2>&1
    thread_test.go:36: Retry 1/10: Waiting for expected content in logs: 'ClusterId = 0x6'
    thread_test.go:36: [exec-ssh] sudo journalctl --utc --since "2024-07-04 20:27:06" --no-pager | grep "matter-all-clusters-app"|| true
    thread_test.go:36: Found expected content in logs: 'ClusterId = 0x6'
=== NAME  TestAllClustersAppThread
    remote.go:116: [exec-ssh] sudo snap remove --purge matter-all-clusters-app
    remote.go:87: [exec-ssh] sudo snap remove --purge openthread-border-router
    snap.go:62: [exec] sudo snap remove --purge openthread-border-router
    exec.go:140: [stdout] openthread-border-router removed
    snap.go:62: [exec] sudo snap remove --purge chip-tool
    exec.go:140: [stdout] chip-tool removed
--- PASS: TestAllClustersAppThread (76.01s)
    --- PASS: TestAllClustersAppThread/Commission (1.02s)
    --- PASS: TestAllClustersAppThread/Control (1.44s)
PASS
ok      chip-tool-snap-tests/thread_tests       76.012s

@farshidtz farshidtz requested a review from jpm-canonical July 4, 2024 20:57
@jpm-canonical
Copy link
Contributor

Standard tests run successfully:

$ go test -v -failfast -count 1
=== RUN   TestUpgrade
<snip>
=== RUN   TestUpgrade/Commission
<snip>
=== RUN   TestUpgrade/Control_before_upgrade
<snip>
=== RUN   TestUpgrade/Upgrade_snap
<snip>
=== RUN   TestUpgrade/Control_upgraded_snap
<snip>
=== RUN   TestAllClustersAppWiFi
<snip>
=== RUN   TestAllClustersAppWiFi/Commission
<snip>
=== RUN   TestAllClustersAppWiFi/Control
<snip>
=== NAME  TestAllClustersAppWiFi
<snip>
--- PASS: TestAllClustersAppWiFi (26.62s)
    --- PASS: TestAllClustersAppWiFi/Commission (0.79s)
    --- PASS: TestAllClustersAppWiFi/Control (1.46s)
PASS
ok  	chip-tool-snap-tests	62.670s

Thread test runs successfully:

$ LOCAL_RADIO_URL="spinel+hdlc+uart:///dev/ttyACM2" LOCAL_INFRA_IF="wlp2s0" REMOTE_INFRA_IF="wlan0" REMOTE_USER="<redacted>" REMOTE_PASSWORD="<redacted>" REMOTE_HOST="raspi-a.lan" go test -v -failfast -count 1 ./thread_tests
=== RUN   TestAllClustersAppThread
<snip>
=== RUN   TestAllClustersAppThread/Commission
<snip>
=== RUN   TestAllClustersAppThread/Control
<snip>
=== NAME  TestAllClustersAppThread
<snip>
--- PASS: TestAllClustersAppThread (91.09s)
    --- PASS: TestAllClustersAppThread/Commission (1.27s)
    --- PASS: TestAllClustersAppThread/Control (1.53s)
PASS
ok  	chip-tool-snap-tests/thread_tests	91.098s

tests/wifi_test.go Show resolved Hide resolved
@farshidtz farshidtz merged commit b406880 into main Jul 5, 2024
6 checks passed
@farshidtz farshidtz deleted the fix-tests branch July 5, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants