Skip to content

[swap_syncd] Port swap_syncd task to pytest#1516

Merged
daall merged 2 commits intosonic-net:masterfrom
daall:swap_syncd_pytest
Apr 2, 2020
Merged

[swap_syncd] Port swap_syncd task to pytest#1516
daall merged 2 commits intosonic-net:masterfrom
daall:swap_syncd_pytest

Conversation

@daall
Copy link
Contributor

@daall daall commented Mar 31, 2020

Description of PR

Summary: Converts the swap_syncd job from Ansible to pytest.

Type of change

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

Approach

How did you do it?

I took advantage of the existing pytest plugins and added some new ones for docker to mimick the behavior in ansible/swap_syncd.yml.

How did you verify/test it?

I created a test_mock test case to run swap_syncd and verified that the DUT was using the rpc image for its syncd container.

Any platform specific information?

N/A

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

Documentation

Added docstring comments to the new docker plugins.

Signed-off-by: Danny Allen <daall@microsoft.com>
@daall
Copy link
Contributor Author

daall commented Mar 31, 2020

There are two big open questions for this PR (so far):

  1. Should docker_registry.yml be moved/copied out of the ansible directory?
  2. How should we approach the password field for docker login? The concern is that the password will be exposed in the logs in the current code. My thought is to use the --password-stdin field that Docker provides, but I'm wondering if @lguohan or @wangxin have handled this before or know of a good way to approach this.

Comment on lines +1 to +2
SWITCH_HWSKUS = ["Force10-S6000", "Accton-AS7712-32X", "Celestica-DX010-C32",
"Seastone-DX010", "Celestica-E1031-T48S4"]
Copy link
Contributor

Choose a reason for hiding this comment

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

We are using many more Broadcom SKU's

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know, this is just the list that I copied from ansible/group_vars/sonic/vars. It seems like it's been a while since this was updated... 😝

Copy link
Contributor

Choose a reason for hiding this comment

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

in the show version, there is asic field. We should use that instead of the hardware sku, too many skus, too difficult to maintain.

Platform: x86_64-juniper_qfx5210-r0
HwSKU: Juniper-QFX5210-64C
ASIC: broadcom

Can you later submit another pr to refactor this?

@daall daall marked this pull request as ready for review April 1, 2020 21:08
dut.docker_image(source="pull",
name="{}/{}:{}".format(registry.host, image_name, image_version))

def tag_image(dut, tag, image_name, image_version="latest"):
Copy link
Contributor

Choose a reason for hiding this comment

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

these are very slim wrappers around Ansible APIs. You can use the Ansible API directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept the wrappers because the interface is a lot simpler than the Ansible APIs. The Ansible APIs are very useful for this sort of thing, but they're also very flexible and have dozens of options to sift through. Most of the time, we really only need to use a few of them.

This just saves some effort digging through the Ansible docs to find which 3 options you need (plus, if someone /really/ needs to go do something super specific, they can still use the Ansible API directly).

@lguohan
Copy link
Contributor

lguohan commented Apr 2, 2020

i suggest to use the pytest_runner to replace the existing swap_syncd.yml

@daall daall requested a review from tahmed-dev April 2, 2020 18:41
@daall daall merged commit 25aa6b9 into sonic-net:master Apr 2, 2020
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
utilities:
* 83f068b 2021-03-22 | Handling error scenario of adding port to Vlan which is part of LAG (sonic-net#1516) (HEAD -> 202012) [Sudharsan Dhamal Gopalarathnam]
* 470e8ce 2021-03-24 | Enable PFCWD only on ports where PFC is enabled (sonic-net#1508) [Andriy Yurkiv]
* 09ef2e0 2021-03-22 | [show][config] add support for setting and displaying switching modes on Y cable (sonic-net#1501) [vdahiya12]
* 0d17d37 2021-03-24 | Warmboot script improvements - timeout exec, disable swss autorestart, remove trap (sonic-net#1495) [Vaibhav Hemant Dixit]
* 2718cd8 2021-03-24 | [show] Fix int status of LAGs, configured as Vlan members (sonic-net#1478) [maksymbelei95]
* cc168fb 2021-03-22 | Fix bug: show vlan config for vlan with no members (sonic-net#1503) [allas-nvidia]

swss:
* 5d8d1fb 2021-03-26 | Revert "Revert "[buffermgr] Support maximum port headroom checking (sonic-net#1607)" (sonic-net#1675)" (sonic-net#1682) (HEAD -> 202012) [Prince Sunny]
* f8df1f8 2021-03-26 | [Dynamic Buffer Calc] Enhance the field checking in table handling (sonic-net#1680) [Stephen Sun]
* 6328c9f 2021-03-22 | [MuxOrch] FDB ageout safety check (sonic-net#1674) [Prince Sunny]
* e1d733e 2021-03-21 | reduce severity of log to info in case of flush on non-existing member (sonic-net#1669) [allas-nvidia]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…tically (sonic-net#21638)

#### Why I did it
src/sonic-sairedis
```
* f35e743a - (HEAD -> 202411, origin/202411) [nvidia] Skip SAI discovery on ports (sonic-net#1524) (57 minutes ago) [mssonicbld]
* bf049ed2 - Use sonictest pool instead of sonic-common and fix arm64 issue. (sonic-net#1516) (2 days ago) [mssonicbld]
* ffe371d6 - [syncd] Support bulk set in INIT_VIEW mode (sonic-net#1517) (2 days ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
756dd9c8123cd06dc581d9b2eb236334deee1850 (HEAD -> 201911, origin/201911)
[201911 sonic-swss] Flushing FDB entries before removing BridgePort (sonic-net#1516)
e3f22ea6685104a819440ecc0efe89c4bd3a0003 [201911/portsorch] Add
correct stat list for port buffer drop counters (sonic-net#1509)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
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.

5 participants