def configure_acl_test(topology):
    ops1 = topology.get('ops1')
    hs1 = topology.get('hs1')
    hs2 = topology.get('hs2')

    topology_1switch_2host(ops1, hs1, hs2)

    ingress_acl_test.set_acl_addr_type('ip')
    ingress_acl_test.set_acl_app_type('port')
    ingress_acl_test.set_acl_direction('in')
    ingress_acl_test.set_topology(topology)
    ingress_acl_test.set_switch_1(ops1)
    ingress_acl_test.set_tx_host(hs1, '1.1.1.1')
    ingress_acl_test.set_rx_host(hs2, '1.1.1.2')
    ingress_acl_test.set_primary_interface_number('1')
    ingress_acl_test.set_secondary_interface_number('6')
    ingress_acl_test.set_tx_count(10)

    config_switch_l2(ops1, '100')

    hs1.send_command('service network-manager stop', shell='bash')
    hs2.send_command('service network-manager stop', shell='bash')

    config_hosts_l2(hs1, hs2, ip_hs1='1.1.1.1/24', ip_hs2='1.1.1.2/24')

    # Delaying to allow commands to be implemented
    sleep(5)
    for portlbl in ['1', '6']:
        wait_until_interface_up(ops1, portlbl)

    ping_test(hs2, '1.1.1.1')
    start_scapy_on_hosts(hs1, hs2)
Example #2
0
def configure_acl_test(topology):
    ops1 = topology.get('ops1')
    hs1 = topology.get('hs1')
    hs2 = topology.get('hs2')

    topology_1switch_2host(ops1, hs1, hs2)

    ingress_acl_test.set_acl_addr_type('ip')
    ingress_acl_test.set_acl_app_type('port')
    ingress_acl_test.set_acl_direction('in')
    ingress_acl_test.set_topology(topology)
    ingress_acl_test.set_switch_1(ops1)
    ingress_acl_test.set_tx_host(hs1, '1.1.1.1')
    ingress_acl_test.set_rx_host(hs2, '1.1.1.2')
    ingress_acl_test.set_primary_interface_number('1')
    ingress_acl_test.set_secondary_interface_number('6')
    ingress_acl_test.set_tx_count(10)

    config_switch_l2(ops1, '100')

    hs1.send_command('service network-manager stop', shell='bash')
    hs2.send_command('service network-manager stop', shell='bash')

    config_hosts_l2(hs1, hs2, ip_hs1='1.1.1.1/24', ip_hs2='1.1.1.2/24')

    # Delaying to allow commands to be implemented
    sleep(5)
    for portlbl in ['1', '6']:
        wait_until_interface_up(ops1, portlbl)

    ping_test(hs2, '1.1.1.1')
    start_scapy_on_hosts(hs1, hs2)
def test_validate_1switch_2host_l2(topology):

    ops1 = topology.get('ops1')
    hs1 = topology.get('hs1')
    hs2 = topology.get('hs2')
    topology_1switch_2host(ops1, hs1, hs2)
    config_switch_l2(ops1, vlan_id)
    config_hosts_l2(hs1, hs2, ip_hs1_bitlength, ip_hs2_bitlength)
    for portlbl in ['1', '6']:
        wait_until_interface_up(ops1, portlbl)
    ping_test(hs1, ip_hs2)
    ops1('show run')
Example #4
0
def test_validate_1switch_2host_l2(topology):

    ops1 = topology.get('ops1')
    hs1 = topology.get('hs1')
    hs2 = topology.get('hs2')
    topology_1switch_2host(ops1, hs1, hs2)
    config_switch_l2(ops1, vlan_id)
    config_hosts_l2(hs1, hs2, ip_hs1_bitlength, ip_hs2_bitlength)
    for portlbl in ['1', '6']:
        wait_until_interface_up(ops1, portlbl)
    ping_test(hs1, ip_hs2)
    ops1('show run')
Example #5
0
def test_validate_1switch_2host_l3(topology):

    ops1 = topology.get('ops1')
    hs1 = topology.get('hs1')
    hs2 = topology.get('hs2')
    topology_1switch_2host(ops1, hs1, hs2)
    config_switch_l3(ops1, ip_ops1_int1, ip_ops1_int2)
    ops1('show run')
    config_hosts_l3(hs1, hs2, ip_hs1, ip_hs2, hs1_ip_route, hs2_ip_route)
    for portlbl in ['1', '6']:
        wait_until_interface_up(ops1, portlbl)
    ping_test(hs1, ip_only_hs2)
    ops1('show run')
def test_validate_1switch_2host_l3(topology):

    ops1 = topology.get('ops1')
    hs1 = topology.get('hs1')
    hs2 = topology.get('hs2')
    topology_1switch_2host(ops1, hs1, hs2)
    config_switch_l3(ops1, ip_ops1_int1, ip_ops1_int2)
    ops1('show run')
    config_hosts_l3(
                hs1, hs2, ip_hs1, ip_hs2,
                hs1_ip_route, hs2_ip_route
                )
    for portlbl in ['1', '6']:
        wait_until_interface_up(ops1, portlbl)
    ping_test(hs1, ip_only_hs2)
    ops1('show run')