Skip to content

Commit 29ba848

Browse files
author
Jamie Hannaford
committed
Merge pull request #557 from ycombinator/neutron-sg
Adding smoke test to apply security group to port.
2 parents bb25867 + 49536c2 commit 29ba848

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/OpenCloud/Smoke/Unit/Networking.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,30 @@ protected function testSecurityGroupOperations()
272272
$securityGroup = $this->getService()->getSecurityGroup($securityGroup->getId());
273273
$this->stepInfo('Security Group ID: ' . $securityGroup->getId());
274274
$this->stepInfo('Security Group Name: ' . $securityGroup->getName());
275+
276+
$network1 = $this->getService()->createNetwork(array(
277+
'name' => 'test_network_for_test_port_sg'
278+
));
279+
$this->cleanupNetworkIds[] = $network1->getId();
280+
281+
$subnet1 = $this->getService()->createSubnet(array(
282+
'cidr' => '192.165.66.0/25',
283+
'networkId' => $network1->getId(),
284+
'ipVersion' => 4,
285+
'name' => 'test_subnet_for_test_port_sg'
286+
));
287+
$this->cleanupSubnetIds[] = $subnet1->getId();
288+
289+
$port1 = $this->getService()->createPort(array(
290+
'networkId' => $network1->getId(),
291+
'name' => 'test_port_for_test_port_sg'
292+
));
293+
$this->cleanupPortIds[] = $port1->getId();
294+
295+
$this->step('Apply security group to port');
296+
$port1->update(array(
297+
'securityGroups' => array($securityGroup->getId())
298+
));
275299
}
276300

277301
protected function testSecurityGroupRuleOperations()

0 commit comments

Comments
 (0)