Skip to content

New Testbed Configure File and Script#672

Merged
maggiemsft merged 13 commits intosonic-net:masterfrom
delta46101:master
Aug 29, 2018
Merged

New Testbed Configure File and Script#672
maggiemsft merged 13 commits intosonic-net:masterfrom
delta46101:master

Conversation

@delta46101
Copy link
Copy Markdown
Contributor

Description of PR

Summary:
The script TestbedProcessing.py can generate testbed configuration based on testbed-new.yaml .

Type of change

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

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.

The script TestbedProcessing.py can generate testbed configuration based on testbed-new.yaml .
@msftclas
Copy link
Copy Markdown

msftclas commented Aug 2, 2018

CLA assistant check
All CLA requirements met.

delta46101 and others added 12 commits August 7, 2018 17:56
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.
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.
Copy link
Copy Markdown
Contributor

@maggiemsft maggiemsft left a comment

Choose a reason for hiding this comment

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

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:
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.

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
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.

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
"""
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.

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
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.

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
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.

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:
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.

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
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.

name should match your file?

@@ -0,0 +1,215 @@
# Sonic-Mgmt Testbed Setup
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.

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 |
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.

str-7260-11 is the fanoutroot based on your files

@maggiemsft maggiemsft merged commit c8e20ec into sonic-net:master Aug 29, 2018
wangxin pushed a commit to wangxin/sonic-mgmt that referenced this pull request Oct 27, 2025
…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?
-->
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants