cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
530
Views
1
Helpful
1
Replies

PyATS testbed criteria based connect?

Konstantin20147
Level 1
Level 1

Hello,

How do I tell testbed to connect to devices of (let's say) type="router" ? I use couple of devices as proxy and would like to skip them in tests that are ran via pyats.easypy.

So far the best solution I came up with is to filter them in every test case based on self.device.os (or any other property). They do show up in report as Failed. I would prefer to skip them in every test case.

Thank you.

1 Accepted Solution

Accepted Solutions

Konstantin20147
Level 1
Level 1

I've found one solution to filter out "proxy" jumphosts - to loop through filtered list in common_setup class. Like this:

class common_setup(aetest.CommonSetup):
    @aetest.subsection
    def TestRouters(self, testbed):
        routers = [x for x in testbed.devices.values() if x.type == 'router']
        aetest.loop.mark(Testcase_VERSION, device=routers)

View solution in original post

1 Reply 1

Konstantin20147
Level 1
Level 1

I've found one solution to filter out "proxy" jumphosts - to loop through filtered list in common_setup class. Like this:

class common_setup(aetest.CommonSetup):
    @aetest.subsection
    def TestRouters(self, testbed):
        routers = [x for x in testbed.devices.values() if x.type == 'router']
        aetest.loop.mark(Testcase_VERSION, device=routers)