22
22
us_east_region_proxy = "proxy-test-name.proxy-XYZ.us-east-2.rds.amazonaws.com"
23
23
us_east_region_custom_domain = "custom-test-name.cluster-custom-XYZ.us-east-2.rds.amazonaws.com"
24
24
china_region_cluster = "database-test-name.cluster-XYZ.cn-northwest-1.rds.amazonaws.com.cn"
25
- china_alt_region_cluster = "database-test-name.cluster-XYZ.rds.cn-northwest-1.amazonaws.com.cn"
26
25
china_region_cluster_read_only = "database-test-name.cluster-ro-XYZ.cn-northwest-1.rds.amazonaws.com.cn"
27
- china_alt_region_cluster_read_only = "database-test-name.cluster-ro-XYZ.rds.cn-northwest-1.amazonaws.com.cn"
28
26
china_region_instance = "instance-test-name.XYZ.cn-northwest-1.rds.amazonaws.com.cn"
29
- china_alt_region_instance = "instance-test-name.XYZ.rds.cn-northwest-1.amazonaws.com.cn"
30
27
china_region_proxy = "proxy-test-name.proxy-XYZ.cn-northwest-1.rds.amazonaws.com.cn"
31
- china_alt_region_proxy = "proxy-test-name.proxy-XYZ.rds.cn-northwest-1.amazonaws.com.cn"
32
28
china_region_custom_domain = "custom-test-name.cluster-custom-XYZ.cn-northwest-1.rds.amazonaws.com.cn"
29
+
30
+ china_alt_region_cluster = "database-test-name.cluster-XYZ.rds.cn-northwest-1.amazonaws.com.cn"
31
+ china_alt_region_cluster_read_only = "database-test-name.cluster-ro-XYZ.rds.cn-northwest-1.amazonaws.com.cn"
32
+ china_alt_region_instance = "instance-test-name.XYZ.rds.cn-northwest-1.amazonaws.com.cn"
33
+ china_alt_region_proxy = "proxy-test-name.proxy-XYZ.rds.cn-northwest-1.amazonaws.com.cn"
33
34
china_alt_region_custom_domain = "custom-test-name.cluster-custom-XYZ.rds.cn-northwest-1.amazonaws.com.cn"
35
+ china_alt_region_limitless_db_shard_group = "database-test-name.limitless-XYZ.cn-northwest-1.rds.amazonaws.com.cn"
36
+ extra_rds_china_path = "database-test-name.cluster-XYZ.rds.cn-northwest-1.rds.amazonaws.com.cn"
37
+ missing_cn_china_path = "database-test-name.cluster-XYZ.rds.cn-northwest-1.amazonaws.com"
38
+ missing_region_china_path = "database-test-name.cluster-XYZ.rds.amazonaws.com.cn"
39
+
40
+ us_east_region_elb_url = "elb-name.elb.us-east-2.amazonaws.com"
41
+ us_isob_east_region_cluster = "database-test-name.cluster-XYZ.rds.us-isob-east-1.sc2s.sgov.gov"
42
+ us_isob_east_region_cluster_read_only = "database-test-name.cluster-ro-XYZ.rds.us-isob-east-1.sc2s.sgov.gov"
43
+ us_isob_east_region_instance = "instance-test-name.XYZ.rds.us-isob-east-1.sc2s.sgov.gov"
44
+ us_isob_east_region_proxy = "proxy-test-name.proxy-XYZ.rds.us-isob-east-1.sc2s.sgov.gov"
45
+ us_isob_east_region_custom_domain = "custom-test-name.cluster-custom-XYZ.rds.us-isob-east-1.sc2s.sgov.gov"
46
+ us_isob_east_region_limitless_db_shard_group = "database-test-name.limitless-XYZ.rds.us-isob-east-1.sc2s.sgov.gov"
47
+ us_gov_east_region_cluster = "database-test-name.cluster-XYZ.rds.us-gov-east-1.amazonaws.com"
48
+
49
+ us_iso_east_region_cluster = "database-test-name.cluster-XYZ.rds.us-iso-east-1.c2s.ic.gov"
50
+ us_iso_east_region_cluster_read_only = "database-test-name.cluster-ro-XYZ.rds.us-iso-east-1.c2s.ic.gov"
51
+ us_iso_east_region_instance = "instance-test-name.XYZ.rds.us-iso-east-1.c2s.ic.gov"
52
+ us_iso_east_region_proxy = "proxy-test-name.proxy-XYZ.rds.us-iso-east-1.c2s.ic.gov"
53
+ us_iso_east_region_custom_domain = "custom-test-name.cluster-custom-XYZ.rds.us-iso-east-1.c2s.ic.gov"
54
+
55
+ us_iso_east_region_limitless_db_shard_group = "database-test-name.limitless-XYZ.rds.us-iso-east-1.c2s.ic.gov"
34
56
35
57
36
58
@pytest .mark .parametrize ("test_value" , [
39
61
china_region_cluster ,
40
62
china_alt_region_cluster ,
41
63
china_region_cluster_read_only ,
42
- china_alt_region_cluster_read_only
64
+ china_alt_region_cluster_read_only ,
65
+ us_isob_east_region_cluster ,
66
+ us_isob_east_region_cluster_read_only ,
67
+ us_gov_east_region_cluster ,
68
+ us_iso_east_region_cluster ,
69
+ us_iso_east_region_cluster_read_only
43
70
])
44
71
def test_is_rds_cluster_dns (test_value ):
45
72
target = RdsUtils ()
@@ -56,7 +83,15 @@ def test_is_rds_cluster_dns(test_value):
56
83
china_region_custom_domain ,
57
84
china_alt_region_instance ,
58
85
china_alt_region_proxy ,
59
- china_alt_region_custom_domain
86
+ china_alt_region_custom_domain ,
87
+ china_alt_region_limitless_db_shard_group ,
88
+ us_east_region_elb_url ,
89
+ us_isob_east_region_instance ,
90
+ us_isob_east_region_proxy ,
91
+ us_isob_east_region_limitless_db_shard_group ,
92
+ us_iso_east_region_instance ,
93
+ us_iso_east_region_proxy ,
94
+ us_iso_east_region_limitless_db_shard_group ,
60
95
])
61
96
def test_is_not_rds_cluster_dns (test_value ):
62
97
target = RdsUtils ()
@@ -79,7 +114,15 @@ def test_is_not_rds_cluster_dns(test_value):
79
114
china_alt_region_cluster_read_only ,
80
115
china_alt_region_instance ,
81
116
china_alt_region_proxy ,
82
- china_alt_region_custom_domain
117
+ china_alt_region_custom_domain ,
118
+ china_alt_region_limitless_db_shard_group ,
119
+ us_isob_east_region_cluster ,
120
+ us_isob_east_region_cluster_read_only ,
121
+ us_isob_east_region_instance ,
122
+ us_isob_east_region_proxy ,
123
+ us_isob_east_region_custom_domain ,
124
+ us_isob_east_region_limitless_db_shard_group ,
125
+ us_gov_east_region_cluster ,
83
126
])
84
127
def test_is_rds_dns (test_value ):
85
128
target = RdsUtils ()
@@ -101,11 +144,19 @@ def test_is_rds_dns(test_value):
101
144
("?.XYZ.rds.cn-northwest-1.amazonaws.com.cn" , china_alt_region_cluster_read_only ),
102
145
("?.XYZ.rds.cn-northwest-1.amazonaws.com.cn" , china_alt_region_instance ),
103
146
("?.XYZ.rds.cn-northwest-1.amazonaws.com.cn" , china_alt_region_proxy ),
104
- ("?.XYZ.rds.cn-northwest-1.amazonaws.com.cn" , china_alt_region_custom_domain )
147
+ ("?.XYZ.rds.cn-northwest-1.amazonaws.com.cn" , china_alt_region_custom_domain ),
148
+ ("?.XYZ.cn-northwest-1.rds.amazonaws.com.cn" , china_alt_region_limitless_db_shard_group ),
149
+ ("?.XYZ.rds.us-isob-east-1.sc2s.sgov.gov" , us_isob_east_region_cluster ),
150
+ ("?.XYZ.rds.us-isob-east-1.sc2s.sgov.gov" , us_isob_east_region_cluster_read_only ),
151
+ ("?.XYZ.rds.us-isob-east-1.sc2s.sgov.gov" , us_isob_east_region_instance ),
152
+ ("?.XYZ.rds.us-isob-east-1.sc2s.sgov.gov" , us_isob_east_region_proxy ),
153
+ ("?.XYZ.rds.us-isob-east-1.sc2s.sgov.gov" , us_isob_east_region_custom_domain ),
154
+ ("?.XYZ.rds.us-isob-east-1.sc2s.sgov.gov" , us_isob_east_region_limitless_db_shard_group ),
155
+ ("?.XYZ.rds.us-gov-east-1.amazonaws.com" , us_gov_east_region_cluster ),
105
156
])
106
157
def test_get_rds_instance_host_pattern (expected , test_value ):
107
158
target = RdsUtils ()
108
- assert expected == target .get_rds_instance_host_pattern (test_value )
159
+ assert target .get_rds_instance_host_pattern (test_value ) == expected
109
160
110
161
111
162
@pytest .mark .parametrize ("expected, test_value" , [
@@ -123,11 +174,19 @@ def test_get_rds_instance_host_pattern(expected, test_value):
123
174
("cn-northwest-1" , china_alt_region_cluster_read_only ),
124
175
("cn-northwest-1" , china_alt_region_instance ),
125
176
("cn-northwest-1" , china_alt_region_proxy ),
126
- ("cn-northwest-1" , china_alt_region_custom_domain )
177
+ ("cn-northwest-1" , china_alt_region_custom_domain ),
178
+ ("cn-northwest-1" , china_alt_region_limitless_db_shard_group ),
179
+ ("us-isob-east-1" , us_isob_east_region_cluster ),
180
+ ("us-isob-east-1" , us_isob_east_region_cluster_read_only ),
181
+ ("us-isob-east-1" , us_isob_east_region_instance ),
182
+ ("us-isob-east-1" , us_isob_east_region_proxy ),
183
+ ("us-isob-east-1" , us_isob_east_region_custom_domain ),
184
+ ("us-isob-east-1" , us_isob_east_region_limitless_db_shard_group ),
185
+ ("us-gov-east-1" , us_gov_east_region_cluster ),
127
186
])
128
187
def test_get_rds_region (expected , test_value ):
129
188
target = RdsUtils ()
130
- assert expected == target .get_rds_region (test_value )
189
+ assert target .get_rds_region (test_value ) == expected
131
190
132
191
133
192
@pytest .mark .parametrize ("test_value" , [
@@ -152,7 +211,13 @@ def test_is_writer_cluster_dns(test_value):
152
211
china_alt_region_cluster_read_only ,
153
212
china_alt_region_instance ,
154
213
china_alt_region_proxy ,
155
- china_alt_region_custom_domain
214
+ china_alt_region_custom_domain ,
215
+ china_alt_region_limitless_db_shard_group ,
216
+ us_isob_east_region_cluster_read_only ,
217
+ us_isob_east_region_instance ,
218
+ us_isob_east_region_proxy ,
219
+ us_isob_east_region_custom_domain ,
220
+ us_isob_east_region_limitless_db_shard_group ,
156
221
])
157
222
def test_is_not_writer_cluster_dns (test_value ):
158
223
target = RdsUtils ()
@@ -163,6 +228,7 @@ def test_is_not_writer_cluster_dns(test_value):
163
228
@pytest .mark .parametrize ("test_value" , [
164
229
us_east_region_cluster_read_only ,
165
230
china_region_cluster_read_only ,
231
+ us_isob_east_region_cluster_read_only ,
166
232
])
167
233
def test_is_reader_cluster_dns (test_value ):
168
234
target = RdsUtils ()
@@ -182,7 +248,14 @@ def test_is_reader_cluster_dns(test_value):
182
248
china_region_cluster ,
183
249
china_region_instance ,
184
250
china_region_proxy ,
185
- china_region_custom_domain
251
+ china_region_custom_domain ,
252
+ china_alt_region_limitless_db_shard_group ,
253
+ us_isob_east_region_cluster ,
254
+ us_isob_east_region_instance ,
255
+ us_isob_east_region_proxy ,
256
+ us_isob_east_region_custom_domain ,
257
+ us_isob_east_region_limitless_db_shard_group ,
258
+ us_gov_east_region_cluster ,
186
259
])
187
260
def test_is_not_reader_cluster_dns (test_value ):
188
261
target = RdsUtils ()
0 commit comments