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

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

Merged
merged 1 commit into from
Dec 15, 2020

Conversation

lolyu
Copy link
Contributor

@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 shi-su and a team December 9, 2020 07:33
@@ -54,6 +54,8 @@ all:
sonic:
vars:
mgmt_subnet_mask_length: 24
ansible_connection: multi_passwd_ssh
ansible_altpassword: YourPaSsWoRd
Copy link
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
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
Contributor 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
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