/** * Test create an instance */ public function testCreateInstance() { $options = array('imageId' => constant('TESTS_ZEND_SERVICE_RACKSPACE_SERVER_IMAGEID'), 'flavorId' => constant('TESTS_ZEND_SERVICE_RACKSPACE_SERVER_FLAVORID'), 'metadata' => array('foo' => 'bar')); $instance = self::$infrastructure->createInstance(constant('TESTS_ZEND_SERVICE_RACKSPACE_SERVER_IMAGE_NAME'), $options); self::$instanceId = $instance->getId(); $this->assertEquals(constant('TESTS_ZEND_SERVICE_RACKSPACE_SERVER_IMAGEID'), $instance->getImageId()); }
/** * 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(Instance::INSTANCE_IMAGEID => constant('TESTS_ZEND_SERVICE_AMAZON_EC2_IMAGE_ID'), Ec2::AWS_SECURITY_GROUP => array(constant('TESTS_ZEND_SERVICE_AMAZON_EC2_SECURITY_GROUP'))); $instance = self::$infrastructure->createInstance('test', $options); self::$instanceId = $instance->getId(); $this->assertEquals(constant('TESTS_ZEND_SERVICE_AMAZON_EC2_IMAGE_ID'), $instance->getImageId()); $this->assertTrue(self::$infrastructure->WaitStatusInstance(self::$instanceId, Instance::STATUS_RUNNING)); }
/** * 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'))); }