Skip to content

[advanced-reboot] Improve error reporting in ansible log#903

Merged
yxieca merged 2 commits intosonic-net:masterfrom
stepanblyschak:error_reporting
May 9, 2019
Merged

[advanced-reboot] Improve error reporting in ansible log#903
yxieca merged 2 commits intosonic-net:masterfrom
stepanblyschak:error_reporting

Conversation

@stepanblyschak
Copy link
Contributor

Description of PR

Summary: [advanced-reboot] Improve error reporting in ansible log
Fixes # (issue)

Type of change

  • Bug fix
  • [] Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?

Log error not only in ptf log file but also to ansible log.
Also fix a bug with threading even initialization and reachability watcher thread start order

How did you verify/test it?

From the ansible log there is only "Something went wrong message", now it is more verbose and outputs specific failure reason:
e.g.:

ok: [mts-sonic-dut-t0] => {
    "out.stdout_lines": [
        "WARNING: No route found for IPv6 destination :: (no default route?)",
        "advanced-reboot.ReloadTest ... FAIL",
        "",
        "======================================================================",
        "FAIL: advanced-reboot.ReloadTest",
        "----------------------------------------------------------------------",
        "Traceback (most recent call last):",
        "  File \"ptftests/advanced-reboot.py\", line 720, in runTest",
        "    self.assertTrue(is_good, errors)",
        "AssertionError: ",
        "",
        "Something went wrong. Please check output below:",
        "",
        "FAILED:dut:Control plane didn't come up within warm up timeout",
        "FAILED:dut:DUT is not ready for test",
        "",
        "",
        "----------------------------------------------------------------------",
        "Ran 1 test in 240.056s",
        "",
        "FAILED (failures=1)"
    ]
}
ok: [mts-sonic-dut-t0] => {
    "out.stdout_lines": [
        "WARNING: No route found for IPv6 destination :: (no default route?)",
        "advanced-reboot.ReloadTest ... FAIL",
        "",
        "======================================================================",
        "FAIL: advanced-reboot.ReloadTest",
        "----------------------------------------------------------------------",
        "Traceback (most recent call last):",
        "  File \"ptftests/advanced-reboot.py\", line 720, in runTest",
        "    self.assertTrue(is_good, errors)",
        "AssertionError: ",
        "",
        "Something went wrong. Please check output below:",
        "",
        "FAILED:dut:DUT hasn't shutdown in 300 seconds",
        "",
        "",
        "----------------------------------------------------------------------",
        "Ran 1 test in 382.915s",
        "",
        "FAILED (failures=1)"
    ]

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Stepan Blyschak added 2 commits May 6, 2019 06:09
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
@yxieca yxieca merged commit 19299ff into sonic-net:master May 9, 2019
yxieca pushed a commit that referenced this pull request May 14, 2019
* [advanced-reboot] start watcher thread after initializing Event objects

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>

* [advanced-reboot] improve error messages when DUT is not ready for test

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
stepanblyschak added a commit to stepanblyschak/sonic-mgmt that referenced this pull request Jun 14, 2019
* [advanced-reboot] start watcher thread after initializing Event objects

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>

* [advanced-reboot] improve error messages when DUT is not ready for test

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
deerao02 pushed a commit to deerao02/sonic-mgmt that referenced this pull request Dec 18, 2025
…refactor (sonic-net#903)

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->
Summary:
Packet trimming configuration depends on the chip, but currently everything is based on constants. In order to support multiple chips we should refactor all packet trimming configuration to retrieve values through functions that check the asic name in duthost.

Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
 - [ ] Skipped for non-supported platforms
- [x] Test case improvement

### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [x] 202412
- [x] 202505

### Approach
#### What is the motivation for this PR?
Packet trimming tests today are written with only small set of chips in mind. The test uses constants for all configuration values. In an effort to support packet trimming on Arista Quicksilver512, we found these constants did not work to configure the chip.

#### How did you do it?
Refactored any config related constants into functions that are accessed through the class `PacketTrimmingConfig`. These static methods require `duthost` to be passed in such that values returned can be based on `duthost.get_asic_name()`.

#### How did you verify/test it?
We have been running packet trimming tests internally with this refactor and have sorted out any failures related to this refactor.

#### Any platform specific information?

#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Reverted Add 'interface transceiver' subgroup with 'lpmode' and 'reset'
subcommands (sonic-net#904) as it dependent of sonic-net#903 which is not marked to
cherry-pick for 201911. Need to add that before we can use this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants