/** * Test create an instance */ public function testCreateInstance() { $options = array(Instance::INSTANCE_IMAGEID => self::IMAGE_ID, Ec2::AWS_SECURITY_GROUP => array(self::SERVER_GROUP)); $instance = $this->infrastructure->createInstance(self::SERVER_NAME, $options); $this->assertTrue($this->infrastructure->isSuccessful()); $this->assertEquals(self::IMAGE_ID, $instance->getImageId()); }
/** * Test create an instance */ public function testCreateInstance() { $options = array('imageId' => self::IMAGE_ID, 'flavorId' => self::FLAVOR_ID, 'metadata' => array('foo' => 'bar')); $instance = $this->infrastructure->createInstance(self::SERVER_NAME, $options); $this->assertTrue($this->infrastructure->isSuccessful()); $this->assertEquals(self::IMAGE_ID, $instance->getImageId()); $this->assertEquals(self::SERVER_ID, $instance->getId()); $metadata = $instance->getMetadata(); $this->assertTrue(is_array($metadata)); $this->assertEquals('bar', $metadata['foo']); $this->assertEquals(self::SERVER_IP, $instance->getPublicDns()); $this->assertEquals(self::SERVER_PASS, $instance->getAttribute('adminPass')); $this->assertTrue(is_array($instance->getAttribute('addresses'))); }