@@ -201,3 +201,77 @@ def test_complete(self):
201
201
]
202
202
args = get_network_create_args (net_desc , proj_name , net_name )
203
203
self .assertEqual (args , expected_args )
204
+
205
+ def test_disable_dns (self ):
206
+ net_desc = {
207
+ "labels" : [],
208
+ "internal" : False ,
209
+ "driver" : None ,
210
+ "driver_opts" : {},
211
+ "ipam" : {"config" : []},
212
+ "enable_ipv6" : False ,
213
+ "x-podman.disable_dns" : True ,
214
+ }
215
+ proj_name = "test_project"
216
+ net_name = "test_network"
217
+ expected_args = [
218
+ "create" ,
219
+ "--label" ,
220
+ f"io.podman.compose.project={ proj_name } " ,
221
+ "--label" ,
222
+ f"com.docker.compose.project={ proj_name } " ,
223
+ "--disable-dns" ,
224
+ net_name ,
225
+ ]
226
+ args = get_network_create_args (net_desc , proj_name , net_name )
227
+ self .assertEqual (args , expected_args )
228
+
229
+ def test_dns_string (self ):
230
+ net_desc = {
231
+ "labels" : [],
232
+ "internal" : False ,
233
+ "driver" : None ,
234
+ "driver_opts" : {},
235
+ "ipam" : {"config" : []},
236
+ "enable_ipv6" : False ,
237
+ "x-podman.dns" : "192.168.1.2" ,
238
+ }
239
+ proj_name = "test_project"
240
+ net_name = "test_network"
241
+ expected_args = [
242
+ "create" ,
243
+ "--label" ,
244
+ f"io.podman.compose.project={ proj_name } " ,
245
+ "--label" ,
246
+ f"com.docker.compose.project={ proj_name } " ,
247
+ "--dns" ,
248
+ "192.168.1.2" ,
249
+ net_name ,
250
+ ]
251
+ args = get_network_create_args (net_desc , proj_name , net_name )
252
+ self .assertEqual (args , expected_args )
253
+
254
+ def test_dns_list (self ):
255
+ net_desc = {
256
+ "labels" : [],
257
+ "internal" : False ,
258
+ "driver" : None ,
259
+ "driver_opts" : {},
260
+ "ipam" : {"config" : []},
261
+ "enable_ipv6" : False ,
262
+ "x-podman.dns" : ["192.168.1.2" , "192.168.1.3" ],
263
+ }
264
+ proj_name = "test_project"
265
+ net_name = "test_network"
266
+ expected_args = [
267
+ "create" ,
268
+ "--label" ,
269
+ f"io.podman.compose.project={ proj_name } " ,
270
+ "--label" ,
271
+ f"com.docker.compose.project={ proj_name } " ,
272
+ "--dns" ,
273
+ "192.168.1.2,192.168.1.3" ,
274
+ net_name ,
275
+ ]
276
+ args = get_network_create_args (net_desc , proj_name , net_name )
277
+ self .assertEqual (args , expected_args )
0 commit comments