Skip to main content

NAGATO: Network Automation Gears and Test Orchestrator

Project description

nagato

PyPI - Python Version pypi Code Style License

NAGATO

Network Automation Gears and Test Orchestrator.

Contents

Introduction

NAGATO provides components for network test automation. It is based on Robot Framework.
The project is hosted on GitHub.

NAGATO provides the following:

  • Robot Framework tools for automating infrastructure tests
  • System to automatically generate robot files for tests incorporating the created tools

nagato

Libraries

The RobotFramework Libraries in NAGATO is the following:

LIBRARY NAME DESCRIPTION
IxNetworkLibrary Provide operations on IxNetwork
NetmikoLibrary Provide operations on network devices through ssh/telnet connections
Pcap FileReader Provide packet capture file verification
SNMP Provide operations relevant to SNMP

For general information about using test libraries with Robot Framework, see Robot Framework User Guide.

High-Level Keywords

The RobotFramework resource files in NAGATO is the following:

LIBRARY NAME DESCRIPTION
Cisco_IOS_XR.resource Provides high-level keywords defining the basic operations of Cisco IOS-XR using NetmikoLibrary
Juniper_Junos.resource Provides high-level keywords defining the basic operations of Junos using NetmikoLibrary

Installation

Execute the following command:

pip install nagato-network

The command will also install the following latest-packages:

Usage

To use NAGATO in Robot Framework tests,
import the libraries you want to use in the settings section.

One of the advantages to use Robot Framework
in a form closer to Natural Language,
so write tests as easy-to-understand as possible.

Below is an example of a robot file using NetmikoLibrary and Cisco_IOS_XR.resource.

*** Settings ***
Documentation          This example demonstrates executing a command on a remote machine
...                    and getting its output.
...
...                    Notice how connections are handled as part of the suite setup and
...                    teardown. This saves some time when executing several test cases.

Library                NAGATO.NetmikoLibrary
Resource               NAGATO/Resources/Cisco_IOS_XR.resource
Suite Setup            Connect   &{device}
Suite Teardown         Disconnect All

*** Variables ***
&{device}
...    device_type=cisco_xr
...    host=192.0.2.1
...    alias=test
...    username=test
...    password=test

*** Test Cases ***
Execute Command And Verify Parsed Output
    [Documentation]    Send the command, get the parsed output, and verify that it is as expected
    ...                If parsing is not needed, the use_textfsm argument is not necessary.

    ${parsed_output} =    NAGATO.NetmikoLibrary.Send Command    command_string=show version    use_textfsm=${True}  host=${device}[alias]
    Should Be Equal    ${output}[0][hardware]    ASR9K

Get Normalized Running Config
    [Documentation]    Get only the configuration contents that do not contain date data 
    ...                from the output of show running-config

    ${output} =    NAGATO.NetmikoLibrary.Send Command     command_string=show running-config    host=${device}[alias]
    ${normalized_config} =    Cisco_IOS_XR.Normalize Config Text    ${output}
    Builtin.Log    ${normalized_config}

Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nagato_network-0.0.5.tar.gz (28.9 kB view hashes)

Uploaded Source

Built Distribution

nagato_network-0.0.5-py3-none-any.whl (52.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page