Exemple #1
0
#!/usr/bin/python
import sys
import time
from tools.unetlab import UNetLab
from tools.testflows import TestFlows
from tools.traceroute import Traceroute
import tools.file_io as file_io
from tools.globals import *


UNL = UNetLab(**file_io.read_yaml('{}/unetlab.yml'.format(NET_DIR)))
TEST_FLOWS = TestFlows(file_io.read_txt('{}/traffic_flows.txt'.format(TEST_DIR)))
INTF_CONV = file_io.read_yaml(INTF_CONV_FILE)
RECONVERGENCE_TIMER = 15


def conf_shut_intf(intf):
    return conf_run_intf(intf, 'shutdown')


def conf_unshut_intf(intf):
    return conf_run_intf(intf, 'no shutdown')


def conf_run_intf(intf, command):
    return '\r\n'.join(['enable', 'conf t', 'interface {}'.format(intf), command, 'end'])


def run_tests(tests):
    failed = False
    for seq, fail_condition in sorted(tests.keys()):
Exemple #2
0
#!/usr/bin/python
import sys
from tools.unetlab import UNetLab
from tools.testflows import TestFlows
from tools.traceroute import Traceroute
import tools.file_io as file_io
from tools.globals import *


UNL = UNetLab(**file_io.read_yaml('{}/unetlab.yml'.format(NET_DIR)))
TEST_FLOWS = TestFlows(file_io.read_txt('{}/traffic_flows.txt'.format(TEST_DIR)))


def conf_shut_intf(intf):
    return conf_run_intf(intf, 'shutdown')


def conf_unshut_intf(intf):
    return conf_run_intf(intf, 'no shutdown')


def conf_run_intf(intf, command):
    return '\r\n'.join(['enable', 'conf t', 'interface {}'.format(intf), command, 'end'])


def run_tests(tests, lab):
    failed = False
    for seq, fail_condition in sorted(tests.keys()):
        print
        print("*** TESTING SCENARIO {}".format(seq))
        for fail_point in fail_condition:
Exemple #3
0
#!/usr/bin/python
import sys
import time
from tools.unetlab import UNetLab
from tools.testflows import TestFlows
from tools.traceroute import Traceroute
import tools.file_io as file_io
from tools.globals import *

UNL = UNetLab(**file_io.read_yaml('{}/unetlab.yml'.format(NET_DIR)))
TEST_FLOWS = TestFlows(
    file_io.read_txt('{}/traffic_flows.txt'.format(TEST_DIR)))
INTF_CONV = file_io.read_yaml(INTF_CONV_FILE)
RECONVERGENCE_TIMER = 15


def conf_shut_intf(intf):
    return conf_run_intf(intf, 'shutdown')


def conf_unshut_intf(intf):
    return conf_run_intf(intf, 'no shutdown')


def conf_run_intf(intf, command):
    return '\r\n'.join(
        ['enable', 'conf t', 'interface {}'.format(intf), command, 'end'])


def run_tests(tests):
    failed = False
Exemple #4
0
from tools.ping import Ping
import tools.file_io as file_io
from tools.unetlab import UNetLab
from tools.globals import *
import sys

UNL = UNetLab(**file_io.read_yaml('{}/unetlab.yml'.format(NET_DIR)))
PING_FLOWS = file_io.read_txt('{}/ping_flows.txt'.format(TEST_DIR))


def main():
    lab = UNL.get_lab()
    ping = Ping(PING_FLOWS, lab)
    while True:
        ping.run(lab)


if __name__ == '__main__':
    sys.exit(main())
Exemple #5
0
from tools.ping import Ping
import tools.file_io as file_io
from tools.unetlab import UNetLab
from tools.globals import *
import sys


UNL = UNetLab(**file_io.read_yaml('{}/unetlab.yml'.format(NET_DIR)))
PING_FLOWS = file_io.read_txt('{}/ping_flows.txt'.format(TEST_DIR))


def main():
    lab = UNL.get_lab()
    ping = Ping(PING_FLOWS, lab)
    while True:
        ping.run(lab)

if __name__ == '__main__':
    sys.exit(main())