sonic-swss icon indicating copy to clipboard operation
sonic-swss copied to clipboard

[VS test] test failure for persistent testbed

Open shuaishang opened this issue 1 year ago • 0 comments

According to setting-up-a-persistent-testbed, use persistent testbed to run VS test:

After setup persistent testbed, run the vs test: sudo pytest --dvsname=vs

The error log:

_________________________________________ ERROR at setup of TestPortChannelAcl.test_AclCtrl __________________________________________

request = <SubRequest 'dvs' for <Function test_AclCtrl>>, manage_dvs = <function manage_dvs.<locals>.update_dvs at 0x7f8abdf0ac10>

    @pytest.fixture(scope="module")
    def dvs(request, manage_dvs) -> DockerVirtualSwitch:
        dvs_env = getattr(request.module, "DVS_ENV", [])
        name = request.config.getoption("--dvsname")
        log_path = name if name else request.module.__name__

>       return manage_dvs(log_path, dvs_env)

conftest.py:1817:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
conftest.py:1794: in update_dvs
    dvs.create_servers()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <conftest.DockerVirtualSwitch object at 0x7f8abd89de80>

    def create_servers(self):
        for i in range(NUM_PORTS):
>           server = VirtualServer(self.ctn_sw.name, self.ctn_sw_pid, i)
E           AttributeError: 'DockerVirtualSwitch' object has no attribute 'ctn_sw'

conftest.py:417: AttributeError
------------------------------------------------------- Captured stdout setup --------------------------------------------------------

For persistent testbed, it should not destroy and create servers: https://github.com/sonic-net/sonic-swss/blob/b32536c9f3fcd29e2d873437359cdee9499887d5/tests/conftest.py#L1793

shuaishang avatar Apr 25 '23 06:04 shuaishang