-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pytest] Convert interface naming mode test to pytest (#1702)
* [pytest] Convert interface naming mode test to pytest * [pytest] Interface naming mode: Change logging level to INFO, remove ansible playbooks
- Loading branch information
1 parent
a77d45a
commit e15df26
Showing
19 changed files
with
841 additions
and
937 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,4 @@ | ||
# Tests for interface_naming_mode feature | ||
- include_vars: roles/test/tasks/iface_naming_mode/vars/iface_naming_vars.yml | ||
|
||
- name: Gathering minigraph facts about the device | ||
minigraph_facts: host={{inventory_hostname}} | ||
|
||
- name: find interface name mapping | ||
port_alias: hwsku="{{hwsku}}" | ||
|
||
# Get the default interface names list | ||
- set_fact: | ||
default_interfaces: "{{port_name_map | list}}" | ||
|
||
#Get the configured ports which are up from minigraph facts and get its alias name | ||
- set_fact: | ||
up_ports: "{{minigraph_ports | list}}" | ||
|
||
- name: Change port alias names in redis db for make it common to all platforms | ||
command: "redis-cli -n 4 HSET 'PORT|{{item.1}}' alias TestAlias{{item.0}}" | ||
with_indexed_items: "{{ default_interfaces }}" | ||
|
||
- name: rewrite port alias list, port name map dict, port alias map dict | ||
set_fact: | ||
port_alias: [] | ||
port_name_map: {} | ||
port_alias_map: {} | ||
|
||
- name: create list of new port alias names | ||
set_fact: | ||
port_alias: "{{ port_alias | default([]) | union( [ 'TestAlias%s' | format(item.0) ] ) }}" | ||
with_indexed_items: "{{ default_interfaces }}" | ||
|
||
- name: create dict of new port name map | ||
set_fact: | ||
port_name_map: "{{ port_name_map | default({}) | combine( { item.0 : item.1 } ) }}" | ||
port_alias_map: "{{ port_alias_map | default({}) | combine( { item.1 : item.0 } ) }}" | ||
with_together: | ||
- "{{ default_interfaces }}" | ||
- "{{ port_alias }}" | ||
|
||
- name: create list of port speed values | ||
set_fact: | ||
port_speed_values: "{{ port_speed.values() | list }}" | ||
|
||
- name: rewrite port speed dict | ||
set_fact: | ||
port_speed: {} | ||
|
||
- name: create dict of new port speed | ||
set_fact: | ||
port_speed: "{{ port_speed | default({}) | combine( { item.1 : item.0 } ) }}" | ||
with_together: | ||
- "{{ port_speed_values }}" | ||
- "{{ port_alias }}" | ||
|
||
# Reassign up port alias list | ||
- set_fact: | ||
upport_alias_list: "{{ port_alias }}" | ||
|
||
#Sample Test interface name and its alias | ||
- set_fact: | ||
interface: "{{minigraph_ports | sort | first}}" | ||
- set_fact: | ||
interface_alias: "{{port_name_map[interface]}}" | ||
|
||
############################################################# | ||
######################## START OF TESTS ##################### | ||
############################################################# | ||
|
||
# All tests run for user guest in alias mode as well as in default mode | ||
|
||
- name: Test Interface naming mode feature in alias mode | ||
include_tasks: "roles/test/tasks/iface_naming_mode/iface_naming_mode_tests.yml" | ||
- name: run test | ||
include_tasks: roles/test/tasks/pytest_runner.yml | ||
vars: | ||
mode: alias | ||
|
||
- name: Test Interface naming mode feature in default mode | ||
include_tasks: "roles/test/tasks/iface_naming_mode/iface_naming_mode_tests.yml" | ||
vars: | ||
mode: default | ||
|
||
- name: Reboot dut after all test passed to return default port alias name | ||
include_tasks: "common_tasks/reboot_sonic.yml" | ||
test_node: iface_namingmode/test_iface_namingmode.py |
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
ansible/roles/test/tasks/iface_naming_mode/check_userifmode.yml
This file was deleted.
Oops, something went wrong.
87 changes: 0 additions & 87 deletions
87
ansible/roles/test/tasks/iface_naming_mode/iface_naming_mode_tests.yml
This file was deleted.
Oops, something went wrong.
113 changes: 0 additions & 113 deletions
113
ansible/roles/test/tasks/iface_naming_mode/interface_config.yml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.