Beispiel #1
0
 def test_equals(self):
     self.assertEqual(EP_DATA_1_1, EP_DATA_1_1)
     self.assertEqual(
         EndpointData(["prof2", "prof1"], ["10.0.0.2", "10.0.0.1"]),
         EndpointData(["prof2", "prof1"], ["10.0.0.2", "10.0.0.1"]))
     self.assertEqual(
         EndpointData(["prof2", "prof1"], ["10.0.0.2", "10.0.0.1"]),
         EndpointData(["prof1", "prof2"], ["10.0.0.1", "10.0.0.2"]))
     self.assertNotEquals(EP_DATA_1_1, None)
     self.assertNotEquals(EP_DATA_1_1, EP_DATA_2_1)
     self.assertNotEquals(EP_DATA_1_1, EMPTY_ENDPOINT_DATA)
     self.assertFalse(
         EndpointData(["prof2", "prof1"], ["10.0.0.2", "10.0.0.1"]) !=
         EndpointData(["prof2", "prof1"], ["10.0.0.2", "10.0.0.1"]))
Beispiel #2
0
 def test_hash(self):
     self.assertEqual(
         hash(EndpointData(["prof2", "prof1"], ["10.0.0.2", "10.0.0.1"])),
         hash(EndpointData(["prof1", "prof2"], ["10.0.0.1", "10.0.0.2"])))
Beispiel #3
0
}
EP_1_1_LABELS = {
    "profile_ids": ["prof1", "prof2"],
    "ipv4_nets": ["10.0.0.1/32"],
    "labels": {
        "a": "a1",
    }
}
EP_1_1_LABELS_NEW_IP = {
    "profile_ids": ["prof1", "prof2"],
    "ipv4_nets": ["10.0.0.2/32"],
    "labels": {
        "a": "a1",
    }
}
EP_DATA_1_1 = EndpointData(["prof1", "prof2"], ["10.0.0.1"])
EP_1_1_NEW_IP = {
    "profile_ids": ["prof1", "prof2"],
    "ipv4_nets": ["10.0.0.2/32", "10.0.0.3/32"],
}
EP_1_1_NEW_PROF_IP = {
    "profile_ids": ["prof3"],
    "ipv4_nets": ["10.0.0.3/32"],
}
EP_ID_1_2 = EndpointId("host1", "orch", "wl1_2", "ep1_2")
EP_ID_2_1 = EndpointId("host2", "orch", "wl2_1", "ep2_1")
EP_2_1 = {
    "profile_ids": ["prof1"],
    "ipv4_nets": ["10.0.0.1/32"],
}
EP_2_1_NO_NETS = {