def runTest(self): telnet_and_execute(cfg.legacy_1['mgmtIpAddress'], untag_cmd_list) host0['ip'] = '192.168.60.118' host6['ip'] = '192.168.60.115' host7['ip'] = '192.168.70.30' h0 = Host(host0).set_ip() h6 = Host(host6).set_ip() h7 = Host(host7).set_ip() host_vlan_cfg1 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 60, 'tagPorts': [cfg.sw46_188['front_port_B']], 'untagPorts': [cfg.sw46_188['front_port_A']] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 70, 'tagPorts': [cfg.sw46_188['front_port_B']], 'untagPorts': [] } sr1 = (StaticRouting().add_switch_vlan(cfg.sw67_205['id'], 60, [ "192.168.60.254/24" ]).add_switch_vlan(cfg.sw67_205['id'], 70, [ "192.168.70.254/24" ]).add_host_vlan(host_vlan_cfg1).add_host_vlan(host_vlan_cfg2).build()) assert ('success' == h7.ping(host6['ip'])) assert ('success' == h6.ping(host0['ip']))
def runTest(self): host4['ip'] = '192.168.10.83' host5['ip'] = '192.168.10.63' h4 = Host(host4).set_ip(vlan=10) h5 = Host(host5).set_ip(vlan=10) assert ('success' == h4.ping(host5['ip'])) # vlan test host_vlan_cfg1 = { 'deviceId': cfg.sw46_126['id'], 'vlanId': 10, 'tagPorts': [cfg.sw46_126['front_port_A'], cfg.sw46_126['front_port_B']], 'untagPorts': [] } sr1 = (StaticRouting().add_switch_vlan( cfg.sw67_205['id'], 10, ["192.168.10.254/24"]).add_host_vlan(host_vlan_cfg1).build()) assert ('success' == h4.ping(host5['ip']))
def runTest(self): host2['ip'] = '192.168.5.103' host3['ip'] = '192.168.253.120' h2 = Host(host2).set_ip(vlan=5) h3 = Host(host3).set_ip(vlan=253) host_vlan_cfg1 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': 5, 'tagPorts': [cfg.sw46_185['front_port_B']], 'untagPorts': [] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_223['id'], 'vlanId': 253, 'tagPorts': [cfg.sw46_223['front_port_A']], 'untagPorts': [] } sr1 = (StaticRouting().add_switch_vlan(cfg.sw67_205['id'], 5, [ "192.168.5.254/24" ]).add_switch_vlan(cfg.sw67_205['id'], 253, [ "192.168.253.254/24" ]).add_host_vlan(host_vlan_cfg1).add_host_vlan(host_vlan_cfg2).build()) assert ('success' == h2.ping(host3['ip']))
def runTest(self): # no vlan test host1['ip'] = '192.168.200.119' host2['ip'] = '192.168.200.103' h1 = Host(host1).set_ip(vlan=200) h2 = Host(host2).set_ip(vlan=200) assert ('success' == h1.ping(host2['ip'])) # vlan test host_vlan_cfg1 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': 200, 'tagPorts': [cfg.sw46_185['front_port_A'], cfg.sw46_185['front_port_B']], 'untagPorts': [] } sr1 = (StaticRouting().add_switch_vlan( cfg.sw67_205['id'], 200, ["192.168.200.254/24"]).add_host_vlan(host_vlan_cfg1).build()) assert ('success' == h1.ping(host2['ip']))
def runTest(self): # no vlan test host2['ip'] = '192.168.60.103' host3['ip'] = '192.168.60.117' h2 = Host(host2).set_ip(vlan=60) h3 = Host(host3).set_ip(vlan=60) assert ('success' == h2.ping(host3['ip'])) # vlan test host_vlan_cfg1 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': 60, 'tagPorts': [cfg.sw46_185['front_port_B']], 'untagPorts': [] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_223['id'], 'vlanId': 60, 'tagPorts': [cfg.sw46_223['front_port_A']], 'untagPorts': [] } sr1 = (StaticRouting().add_switch_vlan(cfg.sw67_205['id'], 60, [ "192.168.60.254/24" ]).add_host_vlan(host_vlan_cfg1).add_host_vlan(host_vlan_cfg2).build()) assert ('success' == h2.ping(host3['ip']))
def runTest(self): legacy_switch_same_vlan_different_subnet_setting() host0['ip'] = '192.168.90.118' host6['ip'] = '192.168.100.115' host7['ip'] = '192.168.110.30' h0 = Host(host0).set_ip() h6 = Host(host6).set_ip() h7 = Host(host7).set_ip() host_vlan_cfg1 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 80, 'tagPorts': [cfg.sw46_188['front_port_B']], 'untagPorts': [cfg.sw46_188['front_port_A']] } sr1 = (StaticRouting().add_rest_switch_vlan( cfg.sw67_205['id'], 80, "192.168.90.254/24", ["192.168.100.254/24", "192.168.110.254/24" ]).add_host_vlan(host_vlan_cfg1).build()) assert ('success' == h7.ping(host6['ip'])) assert ('success' == h7.ping(host0['ip']))
def runTest(self): # no vlan test host0['ip'] = '192.168.0.118' host1['ip'] = '192.168.0.119' h0 = Host(host0).set_ip(vlan=100) h1 = Host(host1).set_ip(vlan=100) assert ('success' == h0.ping(host1['ip'])) # vlan test host_vlan_cfg1 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 100, 'tagPorts': [cfg.sw46_188['front_port_A']], 'untagPorts': [] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': 100, 'tagPorts': [cfg.sw46_185['front_port_A']], 'untagPorts': [] } sr1 = (StaticRouting().add_switch_vlan(cfg.sw67_205['id'], 100, [ "192.168.0.254/24" ]).add_host_vlan(host_vlan_cfg1).add_host_vlan(host_vlan_cfg2).build()) assert ('success' == h0.ping(host1['ip']))
def runTest(self): host1_vlan = 8 host2_vlan = 20 host_vlan_cfg1 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': host1_vlan, 'tagPorts': [], 'untagPorts': [cfg.sw46_185['front_port_A']] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': host2_vlan, 'tagPorts': [], 'untagPorts': [cfg.sw46_185['front_port_B']] } sr1 = (StaticRouting().add_switch_vlan( cfg.sw67_205['id'], host1_vlan, ["192.168.8.254/24"]).add_switch_vlan( cfg.sw67_205['id'], host2_vlan, ["192.168.20.254/24"]).add_host_vlan( host_vlan_cfg1).add_host_vlan(host_vlan_cfg2).build()) host1['ip'] = '192.168.8.119' host2['ip'] = '192.168.20.103' h1 = Host(host1).set_ip() h2 = Host(host2).set_ip() assert ('success' == h1.ping(host2['ip'])) sr1.del_host_vlan(cfg.sw46_185['id'], 8) host_vlan_cfg1['vlanId'] = 18 sr2 = (StaticRouting().add_switch_vlan( cfg.sw67_205['id'], 18, ["192.168.18.254/24"]).add_host_vlan(host_vlan_cfg1).build()) host1['ip'] = '192.168.18.119' h1 = Host(host1).set_ip() assert ('success' == h2.ping(host1['ip']))
def runTest(self): # no vlan test host0['ip'] = '192.168.0.118' host1['ip'] = '192.168.0.119' host3['ip'] = '192.168.0.120' host4['ip'] = '192.168.0.83' host5['ip'] = '192.168.0.63' h0 = Host(host0).set_ip() h1 = Host(host1).set_ip() h3 = Host(host3).set_ip() h4 = Host(host4).set_ip() h5 = Host(host5).set_ip() assert ('success' == h4.ping(host0['ip'])) assert ('success' == h4.ping(host1['ip'])) assert ('success' == h4.ping(host3['ip'])) assert ('success' == h4.ping(host5['ip'])) # vlan test vlan_id = 155 host_vlan_cfg1 = { 'deviceId': cfg.sw46_126['id'], 'vlanId': vlan_id, 'tagPorts': [], 'untagPorts': [cfg.sw46_126['front_port_B']] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': vlan_id, 'tagPorts': [], 'untagPorts': [cfg.sw46_188['front_port_A']] } host_vlan_cfg3 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': vlan_id, 'tagPorts': [], 'untagPorts': [cfg.sw46_185['front_port_A']] } host_vlan_cfg4 = { 'deviceId': cfg.sw46_223['id'], 'vlanId': vlan_id, 'tagPorts': [], 'untagPorts': [cfg.sw46_223['front_port_A']] } sr1 = (StaticRouting().add_switch_vlan( cfg.sw67_205['id'], vlan_id, ["192.168.0.254/24"]).add_host_vlan( host_vlan_cfg1).add_host_vlan(host_vlan_cfg2).add_host_vlan( host_vlan_cfg3).add_host_vlan(host_vlan_cfg4).build()) assert ('success' == h4.ping(host0['ip'])) assert ('success' == h4.ping(host1['ip'])) assert ('success' == h4.ping(host3['ip']))
def runTest(self): legacy_switch_tag_setting() host3['ip'] = '192.168.253.120' host5['ip'] = '192.168.10.63' host6['ip'] = '192.168.60.115' h3 = Host(host3).set_ip() h5 = Host(host5).set_ip(vlan=10) h6 = Host(host6).set_ip(vlan=60) host_vlan_cfg1 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 60, 'tagPorts': [cfg.sw46_188['front_port_B']], 'untagPorts': [] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_223['id'], 'vlanId': 253, 'tagPorts': [], 'untagPorts': [cfg.sw46_223['front_port_A']] } host_vlan_cfg3 = { 'deviceId': cfg.sw46_126['id'], 'vlanId': 10, 'tagPorts': [cfg.sw46_126['front_port_A']], 'untagPorts': [] } sr1 = (StaticRouting().add_rest_switch_vlan( cfg.sw67_205['id'], 253, "192.168.253.254/24", []).add_rest_switch_vlan( cfg.sw67_205['id'], 60, "192.168.60.254/24", []).add_rest_switch_vlan( cfg.sw67_205['id'], 10, "192.168.10.254/24", []).add_host_vlan(host_vlan_cfg1).add_host_vlan( host_vlan_cfg2).add_host_vlan(host_vlan_cfg3).build()) assert ('success' == h5.ping(host3['ip'])) assert ('success' == h6.ping(host3['ip']))
def runTest(self): legacy_switch_untag_setting() host0['ip'] = '192.168.90.118' host6['ip'] = '192.168.60.115' host7['ip'] = '192.168.70.30' h0 = Host(host0).set_ip() h6 = Host(host6).set_ip() h7 = Host(host7).set_ip() host_vlan_cfg1 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 60, 'tagPorts': [cfg.sw46_188['front_port_B']], 'untagPorts': [] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 70, 'tagPorts': [cfg.sw46_188['front_port_B']], 'untagPorts': [] } host_vlan_cfg3 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 90, 'tagPorts': [], 'untagPorts': [cfg.sw46_188['front_port_A']] } sr1 = (StaticRouting().add_rest_switch_vlan( cfg.sw67_205['id'], 60, "192.168.60.254/24", []).add_rest_switch_vlan( cfg.sw67_205['id'], 70, "192.168.70.254/24", []).add_rest_switch_vlan( cfg.sw67_205['id'], 90, "192.168.90.254/24", []).add_host_vlan(host_vlan_cfg1).add_host_vlan( host_vlan_cfg2).add_host_vlan(host_vlan_cfg3).build()) assert ('success' == h7.ping(host6['ip'])) assert ('success' == h7.ping(host0['ip']))
def runTest(self): telnet_and_execute(cfg.legacy_1['mgmtIpAddress'], untag_cmd_list) host3['ip'] = '192.168.253.120' host5['ip'] = '192.168.10.63' host6['ip'] = '192.168.60.115' h3 = Host(host3).set_ip() h5 = Host(host5).set_ip() h6 = Host(host6).set_ip() host_vlan_cfg1 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 60, 'tagPorts': [cfg.sw46_188['front_port_B']], 'untagPorts': [] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_223['id'], 'vlanId': 253, 'tagPorts': [], 'untagPorts': [cfg.sw46_223['front_port_A']] } host_vlan_cfg3 = { 'deviceId': cfg.sw46_126['id'], 'vlanId': 10, 'tagPorts': [], 'untagPorts': [cfg.sw46_126['front_port_A']] } sr1 = (StaticRouting().add_switch_vlan( cfg.sw67_205['id'], 253, ["192.168.253.254/24"]).add_switch_vlan( cfg.sw67_205['id'], 60, ["192.168.60.254/24"]).add_switch_vlan( cfg.sw67_205['id'], 10, ["192.168.10.254/24" ]).add_host_vlan(host_vlan_cfg1).add_host_vlan( host_vlan_cfg2).add_host_vlan(host_vlan_cfg3).build()) assert ('success' == h5.ping(host3['ip'])) assert ('success' == h6.ping(host3['ip']))
def runTest(self): host1['ip'] = '192.168.60.119' host2['ip'] = '192.168.70.103' h1 = Host(host1).set_ip() h2 = Host(host2).set_ip() host_vlan_cfg1 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': 50, 'tagPorts': [], 'untagPorts': [cfg.sw46_185['front_port_A'], cfg.sw46_185['front_port_B']] } sr1 = (StaticRouting().add_rest_switch_vlan( cfg.sw67_205['id'], 50, "192.168.60.254/24", ["192.168.70.254/24"]).add_host_vlan(host_vlan_cfg1).build()) assert ('success' == h1.ping(host2['ip'])) assert ('success' == h2.ping(host1['ip']))
def runTest(self): legacy_switch_same_vlan_different_subnet_setting() host0['ip'] = '192.168.80.118' host1['ip'] = '192.168.90.119' host2['ip'] = '192.168.100.103' host3['ip'] = '192.168.110.120' host4['ip'] = '192.168.120.83' host5['ip'] = '192.168.130.63' host6['ip'] = '192.168.140.115' host7['ip'] = '192.168.150.30' h0 = Host(host0).set_ip() h1 = Host(host1).set_ip() h2 = Host(host2).set_ip() h3 = Host(host3).set_ip() h4 = Host(host4).set_ip() h5 = Host(host5).set_ip() h6 = Host(host6).set_ip() h7 = Host(host7).set_ip() host_vlan_cfg1 = { 'deviceId': cfg.sw46_188['id'], 'vlanId': 80, 'tagPorts': [cfg.sw46_188['front_port_B']], 'untagPorts': [cfg.sw46_188['front_port_A']] } host_vlan_cfg2 = { 'deviceId': cfg.sw46_126['id'], 'vlanId': 80, 'tagPorts': [], 'untagPorts': [cfg.sw46_126['front_port_A'], cfg.sw46_126['front_port_B']] } host_vlan_cfg3 = { 'deviceId': cfg.sw46_185['id'], 'vlanId': 80, 'tagPorts': [], 'untagPorts': [cfg.sw46_185['front_port_A'], cfg.sw46_185['front_port_B']] } host_vlan_cfg4 = { 'deviceId': cfg.sw46_223['id'], 'vlanId': 80, 'tagPorts': [], 'untagPorts': [cfg.sw46_223['front_port_A']] } sr1 = (StaticRouting().add_rest_switch_vlan( cfg.sw67_205['id'], 80, "192.168.80.254/24", [ "192.168.90.254/24", "192.168.100.254/24", "192.168.110.254/24", "192.168.120.254/24", "192.168.130.254/24", "192.168.140.254/24", "192.168.150.254/24" ]).add_host_vlan(host_vlan_cfg1).add_host_vlan( host_vlan_cfg2).add_host_vlan(host_vlan_cfg3).add_host_vlan( host_vlan_cfg4).build()) assert ('success' == h7.ping(host0['ip'])) assert ('success' == h7.ping(host1['ip'])) assert ('success' == h7.ping(host2['ip'])) assert ('success' == h7.ping(host3['ip'])) assert ('success' == h7.ping(host4['ip'])) assert ('success' == h7.ping(host5['ip'])) assert ('success' == h7.ping(host6['ip']))