-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pytest] improvements for pytest infrastructure #2
Conversation
…e issues There are two issues with pytest-ansible I found: - ansible_adhoc is limited to function scope which makes it not usable for wider scope test fixtures - localhost fixture has some hidden dependency on ansible_adhoc (even without changing default scope) e.g.: def test_x(ansible_adhoc, testbed): duthost = AnsibleHost(ansible_adhoc, testbed['dut']) pass def test_y(ansible_adhoc, localhost, testbed): pass This snippet of test code fails to evaluate localhost fixture in test_y: test_x.py::test_x PASSED [ 50%] test_x.py::test_y ERROR [100%] Part of error log: host = self.get_host(hostname) if host is None: > raise AnsibleError("no host vars as host is not in inventory: %s" % hostname) E AnsibleError: ERROR! no host vars as host is not in inventory: arc-switch1025 Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
…trol PTF traffic from sonic-mgmt node Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
…f framework Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
…ention Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
…unity string Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
… cases for lldp should be done in pytest Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
4bb2f32
to
d6be436
Compare
Regarding tests/fdb/init.py, is it necessary to make the fdb testing scripts a package? |
tests/fdb/test_fdb.py
Outdated
res = duthost.command('show mac') | ||
logger.debug('"show mac" output on DUT') | ||
for line in res['stdout_lines']: | ||
logger.debug(' {}'.format(line)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package pprint is for this kind of job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I replaced with pprint
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
No, thanks |
Signed-off-by: Roman Kachur <romankac@mellanox.com>
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
How did you do it?
How did you verify/test it?
Verify ansible LLDP test
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation