@@ -273,6 +273,8 @@ private function deleteSubnet($subnetId)
273
273
274
274
public function ports ()
275
275
{
276
+ $ this ->logStep ('Test port ' );
277
+
276
278
$ replacements = ['{newName} ' => $ this ->randomStr ()];
277
279
278
280
/** @var $network \OpenStack\Networking\v2\Models\Network */
@@ -284,7 +286,6 @@ public function ports()
284
286
/** @var $port \OpenStack\Networking\v2\Models\Port */
285
287
$ path = $ this ->sampleFile ($ replacements , 'ports/create.php ' );
286
288
require_once $ path ;
287
- $ this ->assertInstanceOf (Port::class, $ port );
288
289
289
290
$ replacements ['{portId} ' ] = $ port ->id ;
290
291
$ port ->networkId = $ network ->id ;
@@ -316,5 +317,43 @@ public function ports()
316
317
317
318
$ path = $ this ->sampleFile ($ replacements , 'networks/delete.php ' );
318
319
require_once $ path ;
320
+
321
+ $ this ->createPortWithFixedIps ();
322
+ }
323
+
324
+ private function createPortWithFixedIps ()
325
+ {
326
+ $ this ->logStep ('Test port with fixed IP ' );
327
+
328
+ /** @var $network \OpenStack\Networking\v2\Models\Network */
329
+ $ path = $ this ->sampleFile (['{networkName} ' => $ this ->randomStr ()], 'networks/create.php ' );
330
+ require_once $ path ;
331
+ $ this ->logStep ('Created network {id} ' , ['{id} ' => $ network ->id ]);
332
+
333
+
334
+ /** @var $subnet \OpenStack\Networking\v2\Models\Subnet */
335
+ $ path = $ this ->sampleFile (['{subnetName} ' => $ this ->randomStr (), '{networkId} ' => $ network ->id ], 'subnets/create.php ' );
336
+ require_once $ path ;
337
+ $ this ->logStep ('Created subnet {id} ' , ['{id} ' => $ subnet ->id ]);
338
+
339
+ /** @var $port \OpenStack\Networking\v2\Models\Port */
340
+ $ path = $ this ->sampleFile (['{networkId} ' => $ network ->id ], 'ports/create_with_fixed_ips.php ' );
341
+ require_once $ path ;
342
+ $ this ->logStep ('Created port {id} ' , ['{id} ' => $ port ->id ]);
343
+
344
+ $ path = $ this ->sampleFile (['{portId} ' => $ port ->id ], 'ports/delete.php ' );
345
+ require_once $ path ;
346
+
347
+ $ this ->logStep ('Deleted port {id} ' , ['{id} ' => $ port ->id ]);
348
+
349
+ /** @var $subnet \OpenStack\Networking\v2\Models\Subnet */
350
+ $ path = $ this ->sampleFile (['{subnetId} ' => $ subnet ->id ], 'subnets/delete.php ' );
351
+ require_once $ path ;
352
+ $ this ->logStep ('Deleted subnet {id} ' , ['{id} ' => $ subnet ->id ]);
353
+
354
+ /** @var $network \OpenStack\Networking\v2\Models\Network */
355
+ $ path = $ this ->sampleFile (['{networkId} ' => $ network ->id ], 'networks/delete.php ' );
356
+ require_once $ path ;
357
+ $ this ->logStep ('Deleted network {id} ' , ['{id} ' => $ network ->id ]);
319
358
}
320
359
}
0 commit comments