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

Pdu and Console connection info in connection graph #2257

Merged
merged 6 commits into from
Feb 17, 2021
Merged

Pdu and Console connection info in connection graph #2257

merged 6 commits into from
Feb 17, 2021

Conversation

sujinmkang
Copy link
Contributor

@sujinmkang sujinmkang commented Sep 22, 2020

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

Add console/PDU link to the device connection graph.

How did you do it?

  1. Improve creategraph.py to allow specifying console connection and pdu connections.
  2. Improve creategraph.py to allow specifying inventory name and generate input file names.
  3. Update conn_graph_facts.py to return device PDU/console information.
  4. Allow console/PDU information missing so that community members can take time to catch up.
  5. Supporting DUT connects to multiple PDUs.

How did you verify/test it?

Tested with graph creation without specifying the console and pdu information.

Tested with instrumentation code (on graph generated before this change, and graph generated with this change but no console/pdu information, and graph with incremental console/pdu information):

def test_graph(conn_graph_facts):
    logger.warning('=== device_pdu_info {}'.format(json.dumps(conn_graph_facts['device_pdu_info'], indent=4)))
    logger.warning('=== device_pdu_links {}'.format(json.dumps(conn_graph_facts['device_pdu_links'], indent=4)))
    logger.warning('=== device_console_info {}'.format(json.dumps(conn_graph_facts['device_console_info'], indent=4)))
    logger.warning('=== device_console_link {}'.format(json.dumps(conn_graph_facts['device_console_link'], indent=4)))

19:44:41 WARNING test_foo.py:test_pdu:18: === device_pdu_info {
    "str-7260cx3-acs-1": {
        "PSU1": {
            "Protocol": "snmp",
            "ManagementIp": "10.3.155.107/23",
            "HwSku": "Sentry",
            "Type": "Pdu"
        },
        "PSU2": {
            "Protocol": "snmp",
            "ManagementIp": "10.3.155.107/23",
            "HwSku": "Sentry",
            "Type": "Pdu"
        }
    }
}
19:44:41 WARNING test_foo.py:test_pdu:19: === device_pdu_links {
    "str-7260cx3-acs-1": {
        "PSU1": {
            "peerdevice": "pdu-107",
            "peerport": "39"
        },
        "PSU2": {
            "peerdevice": "pdu-107",
            "peerport": "38"
        }
    }
}
17:59:28 WARNING test_foo.py:test_pdu:20: === device_console_info {
    "str-7260cx3-acs-1": {
        "Protocol": "ssh",
        "ManagementIp": "10.3.145.82",
        "HwSku": "Cisco",
        "Type": "ConsoleServer"
    }
}
17:59:28 WARNING test_foo.py:test_pdu:21: === device_console_link {
    "str-7260cx3-acs-1": {
        "ConsolePort": {
            "peerdevice": "console-82",
            "peerport": "36"
        }
    }
}

@@ -1,5 +1,8 @@
Hostname,ManagementIp,HwSku,Type
Hostname,ManagementIp,HwSku,Type,Protocol
str-msn2700-01,10.251.0.188/23,Mellanox-2700,DevSonic
str-7260-10,10.251.0.13/23,Arista-7260QX-64,FanoutLeaf
str-7260-11,10.251.0.234/23,Arista-7260QX-64,FanoutRoot
str-acs-serv-01,10.251.0.245/23,TestServ,Server
Copy link
Collaborator

Choose a reason for hiding this comment

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

For devices do not have protocol information, maybe an extra comma at the end of line is required to make these lines conform with the CSV headers? For example:

str-msn2700-01,10.251.0.188/23,Mellanox-2700,DevSonic,
str-7260-10,10.251.0.13/23,Arista-7260QX-64,FanoutLeaf,
str-7260-11,10.251.0.234/23,Arista-7260QX-64,FanoutRoot,
str-acs-serv-01,10.251.0.245/23,TestServ,Server,

@lgtm-com
Copy link

lgtm-com bot commented Sep 25, 2020

This pull request introduces 6 alerts and fixes 1 when merging 6f0bbb49531c9ab57c98ce4bdd7fe050eb630a64 into 9b47bae - view on LGTM.com

new alerts:

  • 4 for Variable defined multiple times
  • 2 for Unused local variable

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Sep 25, 2020

This pull request fixes 2 alerts when merging 44dedc1523f42f0aaea26d6950e5ec2cb8086ed1 into 9b47bae - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@sujinmkang sujinmkang marked this pull request as ready for review January 27, 2021 18:52
@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2021

This pull request fixes 2 alerts when merging 7435ec0e5e24d88c7b37a03c9baafbad4f74f104 into e8bfd88 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable

@sujinmkang
Copy link
Contributor Author

retest vsimage please

@sujinmkang
Copy link
Contributor Author

@yxieca can you please review and approve this change if it's ok to merge?

@sujinmkang
Copy link
Contributor Author

retest vsimage please

@yxieca
Copy link
Collaborator

yxieca commented Feb 10, 2021

retest this please

@yxieca
Copy link
Collaborator

yxieca commented Feb 10, 2021

retest vsimage please

@yxieca
Copy link
Collaborator

yxieca commented Feb 10, 2021

/Azurepipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

sujinmkang and others added 2 commits February 14, 2021 22:02
- add -i option to generate device/link/console/pdu file names.
- allow graph file missing console/pdu information.
@sujinmkang sujinmkang requested a review from a team as a code owner February 15, 2021 06:54
@lgtm-com
Copy link

lgtm-com bot commented Feb 15, 2021

This pull request introduces 1 alert and fixes 3 when merging 5730c96 into e1d9265 - view on LGTM.com

new alerts:

  • 1 for Variable defined multiple times

fixed alerts:

  • 2 for Unused local variable
  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Feb 15, 2021

This pull request fixes 3 alerts when merging 395e903 into e1d9265 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2021

This pull request fixes 3 alerts when merging 126a5e9 into 70c7a95 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2021

This pull request fixes 3 alerts when merging fa92e99 into 70c7a95 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 1 for Unused import

@yxieca
Copy link
Collaborator

yxieca commented Feb 16, 2021

/Azurepipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca merged commit 8148a1c into sonic-net:master Feb 17, 2021
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.

3 participants