Пример #1
0
def TestRuijieVlanSetting():
    ruijie_db.add_ruijie_switch_eth_binding("192.168.21.35", "0050.56bc.0003", "GigabitEthernet 3/0/20");
    ruijie_db.add_ruijie_vm_eth_binding("intf_id", "0050.56bc.0003");
    ovs_db.add_vlan_binding(100, "network_id")
    ruijie_vlan.set_ruijie_vlan("intf_id", "network_id")
    binding = ruijie_db.get_ruijie_vlan_binding("192.168.21.35", "GigabitEthernet 3/0/20", 100)
    if binding == []:
        assert 0
Пример #2
0
def TestRuijieVlanUnsetting():
    db.clear_db()
    net = db.network_create("miaosf", "net1")
    port = db.port_create(net.uuid)
    db.port_set_attachment(port.uuid, net.uuid, "intf_id")
    
    ruijie_db.add_ruijie_switch_eth_binding("192.168.21.35", "0050.56bc.0003", "GigabitEthernet 3/0/20");
    ruijie_db.add_ruijie_vm_eth_binding("intf_id", "0050.56bc.0003");
    
    ovs_db.add_vlan_binding(200, net.uuid)
    ruijie_vlan.set_ruijie_vlan("intf_id", net.uuid)
    binding = ruijie_db.get_ruijie_vlan_binding("192.168.21.35", "GigabitEthernet 3/0/20", 200)
    if binding == []:
        assert 0
    ruijie_vlan.unset_ruijie_vlan(net.uuid, port.uuid)
    binding = ruijie_db.get_ruijie_vlan_binding("192.168.21.35", "GigabitEthernet 3/0/20", 200)
    if binding != []:
        assert 0