예제 #1
0
 def test_get_vnis_for_switch(self):
     vteps = VTEP.get(self.session)
     for vtep in vteps:
         vnis = vtep.get_vnis(self.session)
         self.assertIsInstance(vnis, list)
         has_vni = hasattr(vnis[0], 'vni')
         self.assertTrue(has_vni)
예제 #2
0
    def test_get_vtep_table(self):
        vteps = VTEP.get(self.session)

        template = "{0:8} {1:10} {2:15} {3:15} {4:15}"
        for v in vteps:
            data = []
            vnis = v.get_vnis(self.session)
            print "NVE VNI's for switch %s" % vnis[0].switchname
            print "=" * 80
            print ""
            template = "{0:10} {1:10} {2:10} {3:20} {4:10} {5:10} {6:10}"
            print(
                template.format("Interface", 'Status', "VNI",
                                "Multicast-Group", "Vlan", "SwitchID",
                                "Peers"))
            print(
                template.format("-" * 10, "-" * 10, "-" * 10, "-" * 20,
                                "-" * 10, "-" * 10, "-" * 10))

            for v in vnis:
                data.append(
                    (v.nve, v.status, v.vni, v.mcast, v.Vlan, v.switchid,
                     v.peers(self.session)))

            for rec in data:
                print(template.format(*rec))

            print ""
예제 #3
0
 def test_get_vnis_for_switch(self):
     vteps = VTEP.get(self.session)
     for vtep in vteps:
         vnis = vtep.get_vnis(self.session)
         self.assertIsInstance(vnis, list)
         has_vni = hasattr(vnis[0], 'vni')
         self.assertTrue(has_vni)
예제 #4
0
def main():
    session = Session(URL, LOGIN, PASSWORD)
    session.login()
    vteps = VTEP.get(session)
    data = []
    for v in vteps:
        data.append((v.switchid, v.ip, v.nve))
    template = "{0:19} {1:20} {2:15}"
    print(template.format("switchId", "ip", "NVE"))
    print(template.format("------", "-----------", "---"))
    for rec in data:
        print(template.format(*rec))
예제 #5
0
    def test_get_vtep_table(self):
        vteps = VTEP.get(self.session)

        template = "{0:8} {1:10} {2:15} {3:15} {4:15}"
        for v in vteps:
            data = []
            vnis = v.get_vnis(self.session)
            print "NVE VNI's for switch %s" % vnis[0].switchname
            print "=" * 80
            print ""
            template = "{0:10} {1:10} {2:10} {3:20} {4:10} {5:10} {6:10}"
            print(template.format("Interface", 'Status', "VNI", "Multicast-Group", "Vlan", "SwitchID","Peers"))
            print(template.format("-" * 10, "-" * 10, "-"* 10, "-" * 20, "-" * 10, "-" * 10, "-" * 10))

            for v in vnis:
                data.append((v.nve, v.status, v.vni, v.mcast, v.Vlan, v.switchid, v.peers(self.session)))

            for rec in data:
                print(template.format(*rec))

            print ""
예제 #6
0
 def test_get_vnis_by_mcast(self):
     vnis = VTEP.get(self.session, mcast=TEST_MCAST)
     has_vni = hasattr(vnis[0], 'vni')
     self.assertTrue(has_vni)
     self.assertIsInstance(vnis, list)
예제 #7
0
 def test_get_vnis_by_vni(self):
     vnis = VTEP.get(self.session, vni=TEST_VNI)
     has_vni = hasattr(vnis[0], 'vni')
     self.assertTrue(has_vni)
예제 #8
0
 def test_get_vteps(self):
     vteps = VTEP.get(self.session)
     self.assertIsInstance(vteps, list)
     self.assertIsInstance(vteps[0], VTEP)
예제 #9
0
 def test_get_vnis_by_vni(self):
     vnis = VTEP.get(self.session, vni=TEST_VNI)
     has_vni = hasattr(vnis[0], 'vni')
     self.assertTrue(has_vni)
예제 #10
0
 def test_get_vteps(self):
     vteps = VTEP.get(self.session)
     self.assertIsInstance(vteps, list)
     self.assertIsInstance(vteps[0], VTEP)
예제 #11
0
 def test_get_vnis_by_mcast(self):
     vnis = VTEP.get(self.session, mcast=TEST_MCAST)
     has_vni = hasattr(vnis[0], 'vni')
     self.assertTrue(has_vni)
     self.assertIsInstance(vnis, list)