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

Merge Azure/master to local fork #8

Merged
merged 99 commits into from
May 19, 2020
Merged

Conversation

noaOrMlnx
Copy link
Owner

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Approach

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

noaOrMlnx and others added 30 commits April 6, 2020 09:48
* Convert dip_sip ansible test to pytest

* Fix Review Comments:
- Add ansible wrapper to dip_sip.yml
- Delete unneccessary files

Signed-off-by: Noa Or <[email protected]>

* Fix review comments

Check if topology is lag group by minigraph facts.

* Update test_dip_sip.py
* [daemon utils] move platform/check_daemon_status.py to common/platform/daemon_utils.py

Signed-off-by: Ying Xie <[email protected]>

* [pmon daemon] refactoring pmon daemon state checking

- Refactor get_pmon_daemon_list to get_pmon_daemon_states:
  returning list of daemon states.
  not returning daemons that are known short lived.
  not returning daemons disabled by configuration.
- Refactor daemon state check to check the returned states.

Signed-off-by: Ying Xie <[email protected]>
* Fix test_techsupport.py so it could run with T1 topology
Signed-off-by: Xin Wang <[email protected]>

Co-authored-by: Xin Wang <[email protected]>
Add APC SNMP MIB for PDU control

PORT_NAME_BASE_OID = ".1.3.6.1.4.1.318.1.1.4.4.2.1.4"
PORT_STATUS_BASE_OID = ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4"
PORT_CONTROL_BASE_OID = ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4"

How did you verify/test it?
{username}@{sonic-mgmt-docker}:/var/sonic-mgmt-int/tests/common/plugins/psu_controller$ python
Python 2.7.12 (default, Oct 8 2019, 14:14:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from snmp_psu_controllers import *
psucntl = get_psu_controller('<controller_ip>',"<device_name>")
psucntl.get_psu_status()
[{'psu_id': 0, 'psu_on': True}]
psucntl.turn_off_psu('0')
True
psucntl.get_psu_status()
[{'psu_id': 0, 'psu_on': False}]
psucntl.turn_on_psu('0')
True
psucntl.get_psu_status()
[{'psu_id': 0, 'psu_on': True}]
print psucntl.psuType
APC
* [thermal fix] 1. should not mock PSU fan speed less than 100; 2. wait 5 seconds after turning on PSU
* Add some check for test case test_thermal_control_psu_absence
1. Iterate once for every port when hash key is ingress port.
2. In loose mode, do not need to enter the check_balancing function.
* [advanced reboot] Add Paramiko module for device connection

Parmiko module provides fallback mechanism to using username/password
This is required if we are rebooting into new image using advanced
reboot test fixture.

signed-off-by: Tamer Ahmed <[email protected]>
* [pytest] Port advanced reboot based test cases (sad path)

This patch ports remaining sad path advanced reboot test cases
to pytest infra.

signed-off-by: Tamer Ahmed <[email protected]>
…s removed (#1547)

PR #1492 copied the implementation of conn_graph_facts in tests/platform/platform_fixtures.py
to tests/common/fixtures/conn_graph_facts.py.

Then PR #1503 removed file tests/platform/platform_fixtures.py. But not all related importings
were updated.

This change is to update all the platform_fixtures related importings.

Signed-off-by: Xin Wang <[email protected]>

Co-authored-by: Xin Wang <[email protected]>
* If core-storage secret key is available, add to /etc/sonic/core_analyzer.rc.json and enable & start core_uploader service
If https_proxy is provided, update /etc/sonic/core_analyzer.rc.json.

* Check the entire dict path before de-referencing.

* Improved regex per comments.

* Fixed syntax error.

* Add a sample file for newly introduced ansible facts.wq

* Removed a redundant empty line.

Co-authored-by: Ubuntu <remanava@remanava-kube-1.hblknyhzkmnujibhxvn3dmavjb.xx.internal.cloudapp.net>
* [tests/common/devices] Add FanoutHost

- Add FanoutHost which aggregate different fanout switch host
- Add fanouthosts fixture shortcut to get fanouthost easily
- Support select host instance by os type
- Support get fanout host by both mgmtip and hostname

Co-authored-by: Jing Kan<[email protected]>
* [tests/lag]: Convert lag_fallback.yml to pytest

- Convert lag_fallback.yml to pytest
- Reuse int shutdown mehod to shut a member of lag
- Use EOSHost class method shutdown/no_shutdown
- Add post check for EOSHost shutdown/no_shutdown
- Fix typos

Co-authored-by: Jing Kan<[email protected]>
* [pytest] Fix get_asic_type method and logging

The get_asic_type method dereferences dut which is not a member of the the class.
the dut is an instance of SonicHost class and so should reference self.

signed-off-by: Tamer Ahmed <[email protected]>
…messages (#1561)

* Added iptables rules to make sure BGP don't
ack to peer messages. Otherwise this TX packets
can make egress buffer accounting  off

Signed-off-by: Abhishek Dosi <[email protected]>

* Review Comments Address
…ding src_ports in hash_test.py. (#1511)

Generate available send packet ports instead of hard coding src_ports in hash_test.py.
* [fanout switch] build fanout switch list from device_conn map

- Build fanout switch from connection map.
- Build fanout switch DUT port map for tests.
- Build credential dict according to the DUt's inventory.
- Set fanout switch password with right variable name.
- Return command outpus.

Signed-off-by: Ying Xie <[email protected]>

* Fix an indentation

* add comment for the os type
…nexpectly, which caused the fdb test fail. (#1559)

* Stop arp_update before crm test to prevent DUT learning mac address unexpectly, which caused the fdb test fail.
Adding an option to replace fast reboot script on dut as part of
testbed preparation.

signed-off-by: Tamer Ahmed <[email protected]>
…1576)

- The check can be put in a wait_unitl if user want

Co-authored-by: Blueve <[email protected]>
Co-authored-by: Rama Sasthri, Kristipati <[email protected]>
…t FanoutHost (#1577)

- Read os var from ansible inventory manager

Co-authored-by: Jing Kan<[email protected]>
[link flap] add link flap pytest

* Use show interface status to obtain operational status of interfaces.
* Filter out operational down interfaces from test list.
* Address show_interface.py issue with single interface output.

Signed-off-by: Ying Xie <[email protected]>
daall and others added 29 commits April 30, 2020 17:01
* [pytest/ansible] Add support for multi-duts

* review comment: use duts instead of dut

* Fixing various test cases to use duthost instead of testbed_devices['dut']

* trim spaces if any when present in the duts list

signed-off-by: Tamer Ahmed <[email protected]>
* Pytest organization proposal

Signed-off-by: Neetha John <[email protected]>
* [test/dir_bcast] Convert dir_bcast.yml to pytest
* Force refresh router before testing and move to ipfwd folder
* Fix LGTM alerts

Co-authored-by: Jing Kan<[email protected]>
* [copp] Convert COPP test to pytest (#1633)
* Fix missing space in ptf_runner

Signed-off-by: Danny Allen <[email protected]>
The pytest-ansible plugin always assumes that the value
of cli argument '--inventory' is a single inventory file.
With this enhancement, we can pass in multiple inventory
files using the cli argument '--inventory'. The multiple
inventory files can be separated by comma ','.

For example:
        pytest --inventory "inventory1, inventory2" <other arguments>
        pytest --inventory inventory1,inventory2 <other arguments>

Signed-off-by: Xin Wang <[email protected]>
* [pytest] Fix module import issue when running whole test suite

When having multiple conftest, dir leading to this conftest has
to be Python package (presence of __init__.py.) Also, adding
pytest basedir to conftest.py

signed-off-by: Tamer Ahmed <[email protected]>
This code ports PR 1637 to advanced reboot.

ported-pr: #1637
signed-off-by: Tamer Ahmed <[email protected]>
* Deprecate ansible_host.py

The functionalities in ansible_host.py , including the
AnsibleHost class and some exceptions, have been
implemented in the common library. This file can
be deprecated in case people new to sonic-mgmt
waste time on old libraries.

Changes:
1. Remove ansible_host.py
2. Replace all the AnsibleHost related calls with
    more appropriate fixtures or functions.
3. Remove duplicated localhost fixture definition

Signed-off-by: Xin Wang <[email protected]>
* Fix for SN4700 sensors

Signed-off-by: Shlomi Bitton <[email protected]>

* Edit sensors file with correct labels
- Get the correct interface for combined L2/L3 counters
- Add Arista and Dell SKUs to the combined counter list

Signed-off-by: Danny Allen <[email protected]>
When testbed is behind a proxy then NTP inside the ptf container cant synchronize with public NTP servers and test hung on ntpd -gq command
- When process is missing, reload_config.
- When port channle or vlan link is down, reload_config.
- redirect output of config reload and load minigraph to /dev/null.

Signed-off-by: Ying Xie <[email protected]>
* Pytest PFCWD config test

Signed-off-by: Neetha John <[email protected]>

* Address LGTM

Signed-off-by: Neetha John <[email protected]>

* Rename marker to syslog_marker

Signed-off-by: Neetha John <[email protected]>

* Separate out verbose comments

Signed-off-by: Neetha John <[email protected]>
…VM (#1579)

Fix warm-reboot-sad-bgp testing hang after vEOS upgraded to 4.20.15M.
It pops a confirm message when doing BGP shutdown.
#1671)

* Revert "[pytest] Fix module import issue when running whole test suite (#1642)"

This reverts commit f88cff2.

* [file organization] Rename folder names to allow markers to work again

pytest has an issue dealing with sub-folders with the same name and being
included from. In this case, the problem was with several components has
'args' as sub-folder to hold argument parsing utilities.

This issue was initially caught when we were tryign to run the whole test
suite. Attemp was made to address this issue. However there are more in
pytest that cannot tolerate same name sub-folders.

Change 'args' to '<feature>_args' and change conftest.py accordingly.

Signed-off-by: Ying Xie <[email protected]>
The testbed_devices fixture is not a good design. Multiple testbed device
objects are initialized in this fixture. It is not common that a test
script needs all the devices. This fixture may cause unnecessary overhead.
It would be better for test scripts to use the fixtures for different
devices on needed basis.

Changes:
1. Remove the definition of fixture testbed_devices.
2. Replace the call to testbed_devices fixture with other fixtures that
   fit better.

Signed-off-by: Xin Wang <[email protected]>
Fix some issues found during QoS test.

- Support ARP populate for ptf topo
- Add debug info in WRRtest for the purpose of providing detail result in case of failure.
@noaOrMlnx noaOrMlnx merged commit c14ff80 into noaOrMlnx:master May 19, 2020
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.