GithubHelp home page GithubHelp logo

corestate55 / net-tester Goto Github PK

View Code? Open in Web Editor NEW

This project forked from net-tester/net-tester

0.0 2.0 0.0 3.84 MB

物理ネットワークのための受け入れテストツール

License: GNU General Public License v3.0

Ruby 72.88% JavaScript 0.58% CSS 0.60% HTML 4.47% Gherkin 21.48%

net-tester's Introduction

What is NetTester?

NetTester is an acceptance testing tool for physical networks. You can connect virtual hosts for testing to the physical network and automatically perform tests such as ping communication. Since the generation of the virtual host and the connection to the physical network are all done by software, time-consuming exhaustive tests can be automatically executed by test scripts.

overview

Tests on NetTester run according to the test script. The test script can contain the following elements:

  • The connection relationship between virtual hosts and the physical network
  • A series of test cases such as "Ping from host1 to host."

When you run a NetTester test script, virtual hosts connect to the physical network and displays the results of sending and receiving packets. Currently, we support Cucumber as a test tool.

How to Write Test Scenarios

Test Configuration Example

test_scenario

Cucumber Scenario

Feature: host1 and host2 are connected

  Scenario: send and receive packets between host1 and host2
    Given start NetTester with options "--nhost 2 --device eth1 --dpid 0x123"
    When there are following patches:
      | Virtual Port | Physical Port |
      |            1 |             1 |
      |            2 |             2 |
    And each host sends packets as follows:
      | Source Host | Destination Host |
      |           1 |                2 |
      |           2 |                1 |
    Then each host receives packets as follows:
      | Source Host | Destination Host |
      |           1 |                2 |
      |           2 |                1 |

Cucumber Setup & Teardown

features/support/hooks.rb:

require 'net_tester'
require 'active_support/core_ext/object/try'

Before do
  NetTester.log_dir = File.join(Aruba.config.working_directory, 'log')
  NetTester.pid_dir = File.join(Aruba.config.working_directory, 'pids')
  NetTester.socket_dir = File.join(Aruba.config.working_directory, 'sockets')

  device = ENV['DEVICE'] || 'eth1'
  dpid = ENV['DPID'].try(&:hex) || 0x123
  NetTester.run(network_device: device, physical_switch_dpid: dpid)
end

After do
  NetTester.kill
end

How does NetTester work?

The minimum configuration of NetTester is a Linux box and an OpenFlow physical switch only.

network

The Linux box starts virtual hosts that send and receive packets and a software OpenFlow switch. The OpenFlow physical switch virtually connects those virtual hosts to the physical network by creating virtual patches with the virtual OpenFlow switch. In this way, by preparing one Linux box and a physical OpenFlow switch, we can automatically test various patterns using NetTester.

Installation

You need to have some prerequisites installed:

  • The Ruby language version 2.2.0 or newer
  • Open vSwitch (apt-get install openvswitch-switch).
$ git clone https://github.com/net-tester/net-tester.git
$ cd net_tester
$ bundle install

List of Commands

net_tester run [options]

The net_tester run command starts a NetTester process.

$ ./bin/net_tester run --nhost 3 --device eth1 --dpid 0x123
  • --nhost: the number of virtual hosts to invoke
  • --device: the device name that the virtual switch uses
  • --dpid: the physical switch's DPID

network

net_tester add [options]

The net_tester add command adds a virtual patch.

$ ./bin/net_tester add --vport 2 --port 1 --vlan 100
  • --vport: the port number of the virtual switch
  • --port: the port number of the physical switch
  • --vlan: the VLAN ID added by the physical switch port

network

net_tester delete [options]

The net_tester delete command deletes a virtual patch.

$ ./bin/net_tester delete --vport 2 --port 1
  • --vport: the port number of the virtual switch
  • --port: the port number of the physical switch

net_tester send [options]

The net_tester asend command sends test packets.

$ net_tester send --source host1 --dest host2
  • --source: the source host of the test packet
  • --dest: the destination host of the test packet

net_tester stats host

The net_tester stats commands shows the sent and received packet stats.

$ ./bin/net_tester stats host1
Packets sent:
  host1 -> host2 = 1 packet
Packets received:
  host2 -> host1 = 1 packet

net_tester kill

The net_tester kill command terminates a NetTester process.

Related Test Tools

NetTester referred to the following test tools. Thanks!

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.