Skip to content

call test by test case name#362

Merged
lguohan merged 3 commits intosonic-net:masterfrom
maggiemsft:masun/test_by_name
Dec 15, 2017
Merged

call test by test case name#362
lguohan merged 3 commits intosonic-net:masterfrom
maggiemsft:masun/test_by_name

Conversation

@maggiemsft
Copy link
Copy Markdown
Contributor

Issue #361
This PR trying to:

  1. summarize all test cases in a yaml file roles/test/vars/testcases.yml,
    for each test case, it specify test case name, test playbook file name and extra vars needed to execute playbook
    so user will have an overview all available test cases, how to run it, ...

  2. improve test calling by skip calling by tag, and use test case directly

Future todo:
Was trying to run all applicable tests for one topology, but had some issues to run through Ansible playbook loops. Will out this to future improvement. Any suggestion?

Copy link
Copy Markdown
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

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

As commented

testbed_type:

fast-reboot:
filename: bgp_fact.yml
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.

fast-reboot.yml?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks!

########### if your test playbook requires more extra_vars than ptf_host and testbed_type, you may specify them here
########### ptf_host and testbed_type are handled by default
########### configure extra vars if your testcases need more vars
########### or when you call the playbook, you have to specify your extra_vars
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.

Probably it's better to encapsulate all logic related to any specific test inside of the test file?
I don't see why we should extract this logic from the test file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree. I was trying to see if we could call all tests by topology, but ansible playbook is not a good way to do it since then loop for test name and other look logic within test cases are conflicted. so left it only work for call single test case.
To have a quick way to call each test without tag, then will need to change/re-wrap most of the test_case.yml file.
I can either do it in 2 phases to improve it later, or abandon this one and make it more thorogh


def get_testbed_info(self, testbed_name):
if testbed_name:
return self.testbed_topo[testbed_name]
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.

Probably it's better to return the same type from the function?
if we have testbed name - return a list with one element, if we don't have testbed name - return a list with all entries.

@lguohan lguohan merged commit 610f4ef into sonic-net:master Dec 15, 2017
@maggiemsft maggiemsft deleted the masun/test_by_name branch January 4, 2018 06:10
praveen-li pushed a commit to praveen-li/sonic-mgmt that referenced this pull request Jun 20, 2019
* msft_github/master:
  Update README.testbed.Setup.md
  call test by test case name (sonic-net#362)
  [testbed] fanout add rootfanout connect when deploying fanout switch (sonic-net#368)
  [lag_2] enable lag_2 test on t0-116 topology (sonic-net#390)
  [deployment] add missing quotation marks that breaks (sonic-net#386)
  Finalize T0-116 topology (sonic-net#381)
  Directed broadcast Test (sonic-net#377)
  [change_mac]: Change MAC address formatting (sonic-net#380)
  add github template helping report issues and submit pull request (sonic-net#378)
  Fixing logic to identify proper 'port_config.ini' file. (sonic-net#376)
  [sensors] add sensor definitions for arista 7260/7060 (sonic-net#371)
  [pfc_wd]: Rework for P2 (sonic-net#363)
  [test]: Update BGP speaker test (sonic-net#236)
  Add vm_resument which restore paused VMs (sonic-net#297)
  Copy acsbase files to ptf before ptf_runner (sonic-net#366)
  Modify dhcp_servers IPs in order to fix DHCP relay test (sonic-net#364)
  [templates]: Remove trailing space in t1-lag minigraph template (sonic-net#360)
  [fastreboot test]: Add "fanout_listener" for MLNX fanout switches (sonic-net#353)
  patch t0 portchannel name to 15 chars (sonic-net#358)
  [process_checker]: Add the process_checker playbook (sonic-net#349)
  fix issue 354 (sonic-net#355)
  Update build instruction for docker-ptf.gz and docker-sonic-mgmt.gz
  [upgrade_sonic]: Add upgrade_sonic as a convenience script to upgrade the device with an image (sonic-net#338)
  [acl test]: Generate switch info file. (sonic-net#346)
  fix t0 templates for generate minigraph (sonic-net#344)
  [loganalyzer_end.yml]: Rename expected_matches (sonic-net#345)
  [minigraph_facts]: Add the missing brace (sonic-net#342)
  [Arista7260cx3] update topology t0-116 to include port 17 and 19 (sonic-net#340)
  [fdb test] help switch populate mac table before starting the test (sonic-net#341)
  [arista7260cx3] include port 18 and 20 as 50G breakout ports (sonic-net#339)
  Loganalyzer enhancements (sonic-net#321)
  [plugin]: Adding Dell platform in switch connection plugin (sonic-net#333)
  modified files to get lag members from minigraph (sonic-net#327)
  [minigraph] modify script to fit the latest configuration method (sonic-net#331)
  [minigraph_fact] add port mapping for 5 INGRASYS switches (sonic-net#336)
  [sensors] add sensor data for 5 INGRASYS switches (sonic-net#335)
  [minigraph-template]: Add ACL L3 and mirroring tables to minigraph template. (sonic-net#330)
  [acltb-test]: Addopt ACL test to acl-loader. (sonic-net#299)
  [everflow test]: Addopt Everflow testbed test to acl-loader. (sonic-net#300)
  Remove hard-coded bgp speaker asn number, fetch from DUT (sonic-net#329)
  Port alias mapping added for Arista-7060CX-32S-C32 (sonic-net#328)
  Adding if case for S6100 platform to get port details (sonic-net#314)
  [interface_facts] improve interface facts checking performance (sonic-net#326)
  [fdb] Hard code port layout to enable fdb test on t0-116 topology (sonic-net#322) (sonic-net#320)
  [fib] Hard code port layout to enable fib test on t0-116 topology (sonic-net#322)
  [fib, fdb] Allow fib and fdb test info files to contain empty lines and comments (sonic-net#323)
  [lag_test]: Correct typo error for lag tests (sonic-net#325)
  [link flap test] improve performance of link flap test (sonic-net#319)
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
 Add support for attribute capability query in lua script (sonic-net#362)
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…tomatically (sonic-net#17231)

#### Why I did it
src/sonic-linux-kernel
```
* 6ff3cc2 - (HEAD -> 202305, origin/202305) arm64: Kconfig inclusions to fix PCI hang and MTD detection (sonic-net#362) (2 days ago) [Pavan Naregundi]
```
#### 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