|
|
@ -473,6 +473,7 @@ class Test_ProfileIsMatch(TestCase): |
|
|
endpoints = 1, |
|
|
endpoints = 1, |
|
|
endpoint_name = 'name', |
|
|
endpoint_name = 'name', |
|
|
endpoint_type = 'profile/nestedEndpoints', |
|
|
endpoint_type = 'profile/nestedEndpoints', |
|
|
|
|
|
endpoint_status = None, |
|
|
target = 'target.unit.tests', |
|
|
target = 'target.unit.tests', |
|
|
target_id = 'resource/id', |
|
|
target_id = 'resource/id', |
|
|
geos = ['GEO-AF'], |
|
|
geos = ['GEO-AF'], |
|
|
@ -490,6 +491,7 @@ class Test_ProfileIsMatch(TestCase): |
|
|
endpoints=[Endpoint( |
|
|
endpoints=[Endpoint( |
|
|
name=endpoint_name, |
|
|
name=endpoint_name, |
|
|
type=endpoint_type, |
|
|
type=endpoint_type, |
|
|
|
|
|
endpoint_status=endpoint_status, |
|
|
target=target, |
|
|
target=target, |
|
|
target_resource_id=target_id, |
|
|
target_resource_id=target_id, |
|
|
geo_mapping=geos, |
|
|
geo_mapping=geos, |
|
|
@ -506,6 +508,9 @@ class Test_ProfileIsMatch(TestCase): |
|
|
self.assertFalse(is_match(profile(), profile(monitor_proto='HTTP'))) |
|
|
self.assertFalse(is_match(profile(), profile(monitor_proto='HTTP'))) |
|
|
self.assertFalse(is_match(profile(), profile(endpoint_name='a'))) |
|
|
self.assertFalse(is_match(profile(), profile(endpoint_name='a'))) |
|
|
self.assertFalse(is_match(profile(), profile(endpoint_type='b'))) |
|
|
self.assertFalse(is_match(profile(), profile(endpoint_type='b'))) |
|
|
|
|
|
self.assertFalse( |
|
|
|
|
|
is_match(profile(), profile(endpoint_status='Disabled')) |
|
|
|
|
|
) |
|
|
self.assertFalse( |
|
|
self.assertFalse( |
|
|
is_match(profile(endpoint_type='b'), profile(endpoint_type='b')) |
|
|
is_match(profile(endpoint_type='b'), profile(endpoint_type='b')) |
|
|
) |
|
|
) |
|
|
@ -1760,7 +1765,7 @@ class TestAzureDnsProvider(TestCase): |
|
|
self.assertEqual(profiles[0].endpoints[0].endpoint_status, 'Disabled') |
|
|
self.assertEqual(profiles[0].endpoints[0].endpoint_status, 'Disabled') |
|
|
self.assertEqual(profiles[1].endpoints[0].endpoint_status, 'Disabled') |
|
|
self.assertEqual(profiles[1].endpoints[0].endpoint_status, 'Disabled') |
|
|
|
|
|
|
|
|
# # test that same record gets populated back from traffic managers |
|
|
|
|
|
|
|
|
# test that same record gets populated back from traffic managers |
|
|
tm_list = provider._tm_client.profiles.list_by_resource_group |
|
|
tm_list = provider._tm_client.profiles.list_by_resource_group |
|
|
tm_list.return_value = profiles |
|
|
tm_list.return_value = profiles |
|
|
azrecord = RecordSet( |
|
|
azrecord = RecordSet( |
|
|
@ -1772,7 +1777,8 @@ class TestAzureDnsProvider(TestCase): |
|
|
record2 = provider._populate_record(zone, azrecord) |
|
|
record2 = provider._populate_record(zone, azrecord) |
|
|
self.assertEqual(record1.dynamic._data(), record2.dynamic._data()) |
|
|
self.assertEqual(record1.dynamic._data(), record2.dynamic._data()) |
|
|
|
|
|
|
|
|
# _process_desired_zone shouldn't change anything when not needed |
|
|
|
|
|
|
|
|
# _process_desired_zone shouldn't change anything when status value is |
|
|
|
|
|
# supported |
|
|
zone1 = Zone(zone.name, sub_zones=[]) |
|
|
zone1 = Zone(zone.name, sub_zones=[]) |
|
|
zone1.add_record(record1) |
|
|
zone1.add_record(record1) |
|
|
zone2 = provider._process_desired_zone(zone1.copy()) |
|
|
zone2 = provider._process_desired_zone(zone1.copy()) |
|
|
|