New Testbed Configure File and Script#672
Conversation
The script TestbedProcessing.py can generate testbed configuration based on testbed-new.yaml .
Initial instructions on how to edit testbed.yaml, how to run TestbedProcessing.py, and how to run the first testcase.
Grep command does not return the expected value.
This reverts commit 1550833.
Changed the default testbed config filename argument to testbed-new.yaml from testbed.yaml
Added a new section within the testbed-new.yaml config file to have better for docker_registries. Modified updateDockerRegistry() to pull data from docker_registry section in testbed-new.yaml
docker_registry credentials now match the docker_registry credentials on Github.
Discovered issue that if device_types are blank, creating the fanout/secrets.yml file fails and the program exits. Resolved issue by updating blank device_types in config file with string literal "blank" If a user actually configured testbed-new.yaml, there should be no blank device_type fields.
maggiemsft
left a comment
There was a problem hiding this comment.
This PR is an alternative way for new SONiC testbed user to describe the testbed in one place for a simpler testbed, it's will help new user to setup testbed quicker, but lost some flexibility of original dynamic testbed change. We can continue work on testbed improvement to make it more user friendly.
| python version: 2.X | ||
| python package: PyYAML 3.12 (or later) | ||
|
|
||
| PyYaml Install Instructions: |
There was a problem hiding this comment.
we usually try to let user run test under docker-sonic-mgmt. PyYAML 3.12 is preinstalled in docker, so no need install PyYAML.
|
|
||
| Arguments: | ||
| -i : the testbed.yaml file to parse | ||
| -basedir : the basedir for the project |
There was a problem hiding this comment.
the way you run this script in your PR is different then here. Make sure you run a full test
| updateDockerRegistry | ||
| @:parameter outfile - the file to write to | ||
| hard codes the docker registry to search locally rather than externally | ||
| """ |
There was a problem hiding this comment.
why you change this to local? please use what it's in the original there. You may change to your own docker registry in your local patch
| @@ -0,0 +1,744 @@ | |||
| ##### | |||
| # | |||
| # testbed-github.yaml is designed to be a convenient config file that contains information pertaining to sonic-mgmt | |||
There was a problem hiding this comment.
you changed it to testbed-new.yaml?
| # - veos_groups generates: veos | ||
| # - veos generates: main.yml, vm_host/creds.yml, sonic_lab_devices.csv, eos/creds.yml, veos | ||
| # - testbed generates: testbed.csv | ||
| # - topology generates: sonic_lab_links.csv |
There was a problem hiding this comment.
like I commented earlier, you changed the docker registry file, why not included here? did you include any docker register steps if you force change to local docker registry? is it possible you keep what original there and give an option to use local registry server?
| # [11*] /host_vars/<host_var>.yml (where * is 0 or more) | ||
| # | ||
| ##### | ||
| testbed_config: |
There was a problem hiding this comment.
I know this part is optional and I didn't see scripts using this section. Why you keep it here? any purpose? why not using comments?
| # | ||
| ##### | ||
| testbed_config: | ||
| name: testbed-github |
There was a problem hiding this comment.
name should match your file?
| @@ -0,0 +1,215 @@ | |||
| # Sonic-Mgmt Testbed Setup | |||
There was a problem hiding this comment.
Could you change this file name to yamlalternative or other similar name instead of 'new'? This is another way to describe testbed.
| | Hostname | ansible_host | ansible_ssh_user | ansible_ssh_pass | HwSKU | device_type | | ||
| | ------ | ------ | ------ | ------ | ------ | ------ | | ||
| | str-msn2700-01 | [IP Address] | [username] | [password] | DevSonic | DevSonic | | ||
| | str-7260-10 | [IP Address] | [username] | [password] |Arista-7260QX-64 | FanoutRoot | |
There was a problem hiding this comment.
str-7260-11 is the fanoutroot based on your files
…ic-net#672) <!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md Please provide following information to help code review process a bit easier: --> ### Description of PR <!-- - Please include a summary of the change and which issue is fixed. - Please also include relevant motivation and context. Where should reviewer start? background context? - List any dependencies that are required for this change. --> Summary: The func_len in the configuration was not set to 0, which might cause problems for MY_SID programming in certain scenarios. Fixes # (issue) ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [x] Test case improvement ### Back port request - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [x] 202412 - [ ] 202505 ### Approach #### What is the motivation for this PR? #### How did you do it? #### How did you verify/test it? #### Any platform specific information? #### Supported testbed topology if it's a new test case? ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? -->
…D automatically (#23915) #### Why I did it src/sonic-platform-daemons ``` * c5e545e - (HEAD -> 202505, origin/202505) [202505] [xcvrd] Improve logging in case of unable to find appropriate match for optic SI settings (sonic-net#672) (sonic-net#673) (38 minutes ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog
Description of PR
Summary:
The script TestbedProcessing.py can generate testbed configuration based on testbed-new.yaml .
Type of change
Approach
How did you do it?
python TestbedProcessing.py testbed-new.yaml
How did you verify/test it?
output files created:
[1] /group_vars/vm_host/main.yml
[2] /group_vars/vm_host/creds.yml
[3] /files/sonic_lab_devices.csv
[4] /testbed.csv
[5] /files/sonic_lab_links.csv
[6] /group_vars/eos/creds.yml
[7] /group_vars/fanout/secrets.yml
[8] /group_vars/lab/secrets.yml
[9] /lab
[10] /veos
[11*] /host_vars/<host_var>.yml (where * is 0 or more)
Any platform specific information?
no.
Supported testbed topology if it's a new test case?
all.
Documentation
Refer testbed-new.yaml description.