Giter Site home page Giter Site logo

ainoniwa / robotframework-aristalibrary Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aristanetworks/robotframework-aristalibrary

0.0 0.0 0.0 252 KB

Robot Framework library for Arista EOS

License: BSD 3-Clause "New" or "Revised" License

Python 90.23% Makefile 1.57% Ruby 3.08% Shell 5.13%

robotframework-aristalibrary's Introduction

The Arista Library for Robot Framework

Introduction

AristaLibrary aims to simplify testing projects on Arista EOS <http://www.arista.com> using Robot Framework <http://robotframework.org/> by adding a number of EOS-centric keywords. The Library works by using the PyEAPI module to interact with EOS nodes.

Prerequisites

Installation

The easiest way to install is to use pip <http://www.pip-installer.org/en/latest/>:

pip install robotframework-aristalibrary

Upgrade using:

pip install --upgrade robotframework-aristalibrary

To install from source:

git clone https://github.com/aristanetworks/robotframework-aristalibrary.git
cd robotframework-aristalibrary
# Optionally, checkout the development branch"
git checkout develop"
python setup.py install

Keyword Documentation

See the AristaLibrary <http://aristanetworks.github.io/robotframework-aristalibrary/AristaLibrary.html> keyword documentation.

Example Robot Test

# -*- coding: robot -*-
# :setf robot
# :set noexpandtab
*** Settings ***
Documentation   This is a sample Robot Framework suite which takes advantage of
... the AristaLibrary for communicating with and controlling Arista switches.
... Run with:
... pybot --pythonpath=AristaLibrary demo/sample-test-refactored.txt

Library AristaLibrary
Library Collections
Suite Setup Connect To Switches
Suite Teardown  Clear All Connections

*** Variables ***
${TRANSPORT}    http
${SW1_HOST} localhost
${SW1_PORT} 2080
${SW2_HOST} localhost
${SW2_PORT} 2081
${USERNAME} apiuser
${PASSWORD} donttell

*** Test Cases ***
Ping Test
    [Documentation] Configure Et1 on both nodes and ping between them
    [tags]  Configure
    Configure IP Int    1   ethernet1   10.1.1.0/31
    Configure IP Int    2   ethernet1   10.1.1.1/31

    ${output}=  Enable  ping 10.1.1.0
    ${result}=  Get From Dictionary ${output[0]}    result
    Log ${result}
    ${match}    ${group1}=  Should Match Regexp ${result['messages'][0]}    (\\d+)% packet loss
    Should Be Equal As Integers ${group1}   0   msg="Packets lost percent not zero!!!"

*** Keywords ***
Connect To Switches
    [Documentation] Establish connection to a switch which gets used by test cases.
    Connect To  host=${SW1_HOST}    transport=${TRANSPORT}  username=${USERNAME}
    ... password=${PASSWORD}    port=${SW1_PORT}
    Configure   hostname veos0
    Connect To  host=${SW2_HOST}    transport=${TRANSPORT}  username=${USERNAME}
    ... password=${PASSWORD}    port=${SW2_PORT}
    Configure   hostname veos1

Configure IP Int
    [Arguments] ${switch}   ${interface}    ${ip}
    Change To Switch    ${switch}
    @{cmds}=    Create List
    ... default interface ${interface}
    ... interface ${interface}
    ... no switchport
    ... ip address ${ip}
    ... no shutdown
    Configure   ${cmds}

Release Notes

Release notes are available in the GitHub releases <https://github.com/aristanetworks/robotframework-aristalibrary/releases>.

Support and Contacts

AristaLibrary is a community-supported project, maintained by Arista EOS+. Contact the maintainers at [email protected].

Contributing

Contributing is encouraged via pull requests. Please see CONTRIBUTING.rst for more information.

License

All code within this repository is made available under the BSD3 license and via the LICENSE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.