Skip to content
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

[pytests]: creds fixture does not load correct groupvars creds #1574

Closed
lguohan opened this issue Apr 16, 2020 · 0 comments · Fixed by #1575
Closed

[pytests]: creds fixture does not load correct groupvars creds #1574

lguohan opened this issue Apr 16, 2020 · 0 comments · Fixed by #1575

Comments

@lguohan
Copy link
Contributor

lguohan commented Apr 16, 2020

Description
[pytests]: creds fixture does not load correct groupvars

Steps to reproduce the issue:

py.test --inventory veos.vtb --host-pattern all --user admin -vvv --show-capture stdout --testbed vms-kvm-t0 --testbed_file vtestbed.csv --disable_loganalyzer --log-file logs/1vlan/tacacs/test_rw_user.log --junitxml=results/1vlan/tacacs/test_rw_user.xml tacacs/test_rw_user.py

Describe the results you received:

18:39:43  ptfhost = <common.devices.PTFHost object at 0x7fa0e83d7b10>
18:39:43  duthost = <common.devices.SonicHost object at 0x7fa0e9c82710>
18:39:43  creds = {'ceos_image': 'ceosimage:4.23.2F-1', 'ceos_image_orig': 'ceosimage:4.23.2F', 'eos_default_login': 'admin', 'eos_default_password': '', ...}
18:39:43  
18:39:43      @pytest.fixture(scope="module")
18:39:43      def setup_tacacs(ptfhost, duthost, creds):
18:39:43          """setup tacacs client and server"""
18:39:43      
18:39:43          # disable tacacs server
18:39:43          ptfhost.service(name="tacacs_plus", state="stopped")
18:39:43      
18:39:43          # configure tacacs client
18:39:43  >       duthost.shell("sudo config tacacs passkey %s" % creds['tacacs_passkey'])
18:39:43  E       KeyError: 'tacacs_passkey'

Describe the results you expected:
test should pass.

The issue is that current creds fixture use the inventory file name as group name, which is not correct.
Additional information you deem important:

**Output of `show version`:**

```
(paste your output here)
```

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```
@lguohan lguohan linked a pull request Apr 16, 2020 that will close this issue
3 tasks
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 a pull request may close this issue.

1 participant