Skip to content

[pytest] Add condition check to skip tests in unsupported topo.#1553

Closed
EmmaLin11 wants to merge 2 commits intosonic-net:masterfrom
EmmaLin11:skip_unsupported_topo
Closed

[pytest] Add condition check to skip tests in unsupported topo.#1553
EmmaLin11 wants to merge 2 commits intosonic-net:masterfrom
EmmaLin11:skip_unsupported_topo

Conversation

@EmmaLin11
Copy link
Contributor

Signed-off-by: Emma Lin emma_lin@edge-core.com

Description of PR

Summary:
Perform some tests in unsupported topology will failed.
Add condition check to skip tests in unsupported topology.

bgp_speaker: skip tests in t1 & ptf
bgp_fact: skip tests in ptf
dhcp_relay: skip tests in t1 & ptf
vrf: only support t0 topology, other topologies need to be filtered

Type of change

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

Approach

How did you do it?

Add condition check to skip tests in unsupported topo.

How did you verify/test it?

Perform pytest to confirm bgp_speaker/bgp_fact/dhcp_relay/vrf tests are skipped in unsupported topology.

Any platform specific information?

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

Documentation

bgp_speaker: skip tests in t1 & ptf
bgp_fact:    skip tests in ptf
dhcp_relay:  skip tests in t1 & ptf
vrf:         only support t0 topology, other topologies need to be filtered

Signed-off-by: Emma Lin <emma_lin@edge-core.com>
@pytest.fixture(scope="module", autouse=True)
def setup_check_topo(testbed):
if testbed['topo']['name'] != 't0':
pytest.skip('Unsupported topology')
Copy link
Contributor

Choose a reason for hiding this comment

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

is this by design that vrf won't work for t0 topology?

Copy link
Contributor

Choose a reason for hiding this comment

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

Run vrf on t0 only.


@pytest.fixture(scope="module", autouse=True)
def setup_check_topo(testbed):
if testbed['topo']['name'] != 't0':
Copy link
Contributor

Choose a reason for hiding this comment

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

why use topo name here, not type?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because we meet setup error on t0-56 as below

>       g_vars['vrf_intfs'] = get_vrf_intfs(cfg_facts)

test_vrf.py:426:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cfg_facts = {'ACL_TABLE': {'DATAACL': {'policy_desc': 'DATAACL', 'ports': ['PortChannel0001', 'PortChannel0002', 'PortChannel0003'...BUFFER_POOL': {'ingress_lossy_pool': {'mode': 'dynamic', 'size': '32736769', 'type': 'ingress', 'xoff': '19457'}}, ...}

    def get_vrf_intfs(cfg_facts):
        intf_tables = ['INTERFACE', 'PORTCHANNEL_INTERFACE', 'VLAN_INTERFACE', 'LOOPBACK_INTERFACE']
        vrf_intfs = {}

        for table in intf_tables:
            for intf, attrs in cfg_facts.get(table, {}).iteritems():
                if '|' not in intf:
>                   vrf = attrs['vrf_name']
E                   KeyError: 'vrf_name'

test_vrf.py:115: KeyError

Copy link
Contributor

Choose a reason for hiding this comment

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

the test should be fixed to support t0-56. you can open an issue to ask support vrf support in t0-56. but we should have uniform rule to decide whether a test can or cannot be run on certain topology. otherwise, the maintenance cost is too high.

    vrf_attr: only support t0 topology, other topologies need to be filtered

    Signed-off-by: Irene Pan <irene_pan@edge-core.com>
@yxieca
Copy link
Collaborator

yxieca commented May 12, 2020

@linemma we will use markers to solve this issue at test execution level. Having test protect against topology again could be redundant.

@EmmaLin11 EmmaLin11 closed this Aug 27, 2020
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…et#7487)

* [202012][swss/swss-common/utilities/kernel] Update submodule

sonic-swss:
- [Monitor Vlan] Fix a typo in hostif (sonic-net#1722)
- Update pool sizes during initialization from timer only (sonic-net#1708)
- [SflowMgr] SamplingRate Update by Speed Change Added (sonic-net#1721)

sonic-swss-common:
- [swss-common] Add MUX Metrics Table (sonic-net#482)
- [azp] Purge swss before installing the newly built deb package (sonic-net#472)

sonic-utilities:
- disk_check: Check & mount RO as RW using tmpfs (sonic-net#1569)
- No more IP validation as it is more likely a URL (sonic-net#1555)
- Stop PMON docker before cold and soft reboots (sonic-net#1514)
- Add soft-reboot reboot type (sonic-net#1453)
- [acl] Use a list instead of a comma-separated string for ACL port list (sonic-net#1519)
- sonic-installer: fix py3 issues in bootloader.aboot (sonic-net#1553)
- Fix unsupported fs.squashfs extraction in sonic-installer (sonic-net#1366)
- [show][config] cli support for firmware upgrade on Y-Cable (sonic-net#1528) (sonic-net#1558)

sonic-linux-kernel:
- [Mellanox] backport kernel patches for hw-management 7.0100.2303 (sonic-net#211)

Signed-off-by: Danny Allen <daall@microsoft.com>

* Update utilities w/ build fix
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.

5 participants