@@ -273,6 +273,8 @@ private function deleteSubnet($subnetId)
273273
274274 public function ports ()
275275 {
276+ $ this ->logStep ('Test port ' );
277+
276278 $ replacements = ['{newName} ' => $ this ->randomStr ()];
277279
278280 /** @var $network \OpenStack\Networking\v2\Models\Network */
@@ -284,7 +286,6 @@ public function ports()
284286 /** @var $port \OpenStack\Networking\v2\Models\Port */
285287 $ path = $ this ->sampleFile ($ replacements , 'ports/create.php ' );
286288 require_once $ path ;
287- $ this ->assertInstanceOf (Port::class, $ port );
288289
289290 $ replacements ['{portId} ' ] = $ port ->id ;
290291 $ port ->networkId = $ network ->id ;
@@ -316,5 +317,43 @@ public function ports()
316317
317318 $ path = $ this ->sampleFile ($ replacements , 'networks/delete.php ' );
318319 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 ]);
319358 }
320359}
0 commit comments