Skip to content

[veos_vtb] Add connection variable to 'sonic' group#2639

Merged
lolyu merged 1 commit intosonic-net:masterfrom
lolyu:vtestbed_conn_var
Dec 15, 2020
Merged

[veos_vtb] Add connection variable to 'sonic' group#2639
lolyu merged 1 commit intosonic-net:masterfrom
lolyu:vtestbed_conn_var

Conversation

@lolyu
Copy link
Copy Markdown
Collaborator

@lolyu lolyu commented Dec 9, 2020

By default, Ansible will search for group variables from the directory
where inventory file locates. For vtestbed Pytest users who calls Pytest
with tests/veos_vtb, Ansible fails to find the groups variables
defined under ansible/group_vars, thus fail to use multi_passwd_ss.
So let's add those connection variables directly to veos_vtb

Signed-off-by: Longxiang Lyu lolv@microsoft.com

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

If calling pytest with tests/veos_vtb, Ansible will fails to get groups variables in ansible/group_vars, in which connection variables are defined for sonic group.

How did you do it?

Add those connection variables to veos_vtb

How did you verify/test it?

Run pytest with --inventory tests/veos_vtb

Any platform specific information?

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

Documentation

By default, Ansible will search for group variables from the directory
where inventory file locates. For vtestbed Pytest users who calls Pytest
with `tests/veos_vtb`, Ansible fails to find the groups variables
defined under `ansible/group_vars`, thus fail to use `multi_passwd_ss`.
So let's add those connection variables directly to `veos_vtb`

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@lolyu lolyu requested review from a team and shi-su December 9, 2020 07:33
vars:
mgmt_subnet_mask_length: 24
ansible_connection: multi_passwd_ssh
ansible_altpassword: YourPaSsWoRd
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should fix the multi_passwd_ssh is not accessible if tests/veos_vtb is selected as the inventory file. I think a fundamental problem is that the whole ansible/group_vars directory is not accessible when using tests/veos_vtb as the inventory file. I am not sure if any other things in ansible/group_vars are useful (or potentially useful) in pytest? If so, it is probably better to help pytest finding the directory (maybe a symbolic link)?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks like ansible always looks for group_vars and host_vars under the same directory of inventory file. Probably we can try:

cd tests
pytest -i ../ansible/veos_vtb ...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but this is not the case in our public Jenkins vtestbed jobs, which uses the symbolic link under tests/.

@lolyu lolyu merged commit c86b445 into sonic-net:master Dec 15, 2020
@lolyu lolyu deleted the vtestbed_conn_var branch December 15, 2020 13:40
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
swss:
* f28d6622 2023-01-25 | [portinit] Do not call GET on SAI_PORT_ATTR_SPEED when AUTONEG is enabled (sonic-net#2484) (sonic-net#2639) (github/202012, 202012) [Ying Xie]
* 217f7f00 2023-01-21 | Cherry pick of sonic-net/sonic-swss#2589 (sonic-net#2627) [siqbal1986]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
```
39cdb49c7 [202012][show] Add bgpraw to show run all (sonic-net#2639)
b3ebba2ca [202012][show] add new CLI to show tunnel route objects sonic-net#2255 (sonic-net#2659)
d08f59b9f Fixed a bug in "show vnet routes all" causing screen overrun. (sonic-net#2644) (sonic-net#2654)
a996abdb5 [202012][show] show logging CLI support for logs stored in tmpfs (sonic-net#2652)
c60f771c0 [202012][show_bfd] add local discriminator in show bfd command (sonic-net#2616)
```
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.

4 participants