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

support for not all DUT ports connected to a fanout switch #2517

Merged
merged 14 commits into from
Dec 28, 2020

Commits on Dec 23, 2020

  1. support for dicontiguos ports

    conn_graph_facts:
      conn_graph_facts.py returns device_vlan_map_list. This used to be a dictionary
      with key being hostname and value being a list of vlanids for the fanout ports.
      We have modified this where the value instead of being a list of vlanids, it is a dictionary
      with key being the port_index and the value being the vlan id. This port_index is what gets
      put in the topology file. We get the port
      by looking at the host_port_vlans defined in the conn_graph for that device. This
      host_port_vlans has key being the Ethernet port (like Ethernet10) and value being
      a dictionary with key 'vlanlist' being a the list of fanout vlans. We check against all the ports
      'vlanlist' to get the port on the DUT that connects to this fanout vlan, and then split on
      'Ethernet' to get the port index.
    
      For example - lets say on dut with hostname "dut1", we have port Ethernet10 connected to fanout w/ vlan 120, and
      Ethernet11 connected to fanout w/ vlan 121, then we would have:
    
      "host_port_vlans":
        {
          "Ethernet10": {
             "mode": "Access",
             "vlanids": "120",
             "vlanlist": [
                120
             ]
          },
          "Ethernet11": {
             "mode": "Access",
             "vlanids": "121",
             "vlanlist": [
                121
             ]
          }
       }
    
      "VlanList": [
         120,
         121
      ]
    
      For vlan 120 in VlanList, we would iterate through host_port_vlans to find the port
      that has vlan 120 - in our case "Ethernet10". The port_index would then be "10". Similarly,
      for vlan 121, the port_index would be "Ethernet11".
    
      So, returned device_vlan_map_list would be:
        "dut1" : {
           "10" : 120,
           "11" : 121
        }
    
    - vlan_port/kvm_port/mellanox_simx_port:
       - Updated to return (dut_fp_ports) a dictionary with key being the port index (same as in the topo file)
         and vlan being the port - instead of the just the list of ports.
    
    bind/unbind vm_topology:
       - vlan_index is now a string in the dictionary of dut_fp_ports
       - updated regexp for checking valid vlan for multi-dut to be of the format '<dutIndex>.<portIndex>@<ptfIndex>'
    
    remove_dut_port.yml:
      - set cmd to "remove" instead of "create" in vlan_port module call.
                                                                                                                                                                                                                                                            }
    sanmalho-git committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    7ccffff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e095934 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e56bd7d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    52557a3 View commit details
    Browse the repository at this point in the history
  5. Fixes to test failure on kvm in vm_topology

    - The dut_fp_ports is a dictionary with key being a string and not an integer
    sanmalho-git committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    6e06212 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0515a5d View commit details
    Browse the repository at this point in the history
  7. Fix when the port numbers are not consecutive.

    - We were using the port name like 'Ethernet10' and splitting in out 'Ethernet' to
      get the port_index in the device_vlan_map_list. This port_index is to correspond to
      what would be in the topology file. This would not work
      when ports are not consecutively names - like 'Ethernet0', 'Ethernet4', 'Ethernet8' .....
      In this scenario, the topology file would have host_interfaces/vlans still as 0,1,2,.....
    
      Fix is to get the port names based on 'hwksu' (like it is done for minigraph) and
      then use that list to get the port_index to be  put into device_vlan_map_list
    sanmalho-git committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    e554748 View commit details
    Browse the repository at this point in the history
  8. Moved the common port_alias_to_name_map code between minigraph_facts …

    …and conn_graph_facts to module_utils/port_utils
    
    The port_alias_to_name_map is generated based on hwsku and is common
    code between minigraph_facts and conn_graph_facts ansible module.
    
    Now that module_utils are supported, added module_utils/port_utils.py to
    have this common code. Modified the ansible modules to use this new
    common code.
    sanmalho-git committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    462d77f View commit details
    Browse the repository at this point in the history
  9. Removed unused imports

    sanmalho-git committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    27ac6c6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    524dbd7 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a79eed6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9a8a78d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    bf8512a View commit details
    Browse the repository at this point in the history
  14. Fix in vm_topology.bind when dealing with multi-hosts

    Since dut_fp_ports is a dictionary with key being the dut name, and the
    value being a dictionary with key being the interface index as a string,
    need to typecast the host_interfaces interface index as a string.
    sanmalho-git committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    be22df7 View commit details
    Browse the repository at this point in the history