deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [2/4] EC2: allow launching instances into a subnet
Date Thu, 30 Aug 2012 18:27:07 GMT
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/31979f92/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state.yml
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state.yml
b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state.yml
new file mode 100644
index 0000000..e30571b
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state.yml
@@ -0,0 +1,411 @@
+--- 
+recorded_with: VCR 2.2.4
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=RunInstances&AddressingType=public&ImageId=ami-aecd60c7&InstanceType=t1.micro&MaxCount=1&MinCount=1&Placement.AvailabilityZone=us-east-1a&Signature=7TAagHYZvKkM2voACsypZzEVxTRT2pqPougPiTKaePw=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:24:39.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:24:39 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>945c368c-8dd3-42c8-8923-b3ced28e763e</requestId>
+            <reservationId>r-1ff40478</reservationId>
+            <ownerId>122214243412</ownerId>
+            <groupSet>
+                <item>
+                    <groupId>default</groupId>
+                </item>
+            </groupSet>
+            <instancesSet>
+                <item>
+                    <instanceId>i-768c640c</instanceId>
+                    <imageId>ami-aecd60c7</imageId>
+                    <instanceState>
+                        <code>0</code>
+                        <name>pending</name>
+                    </instanceState>
+                    <privateDnsName/>
+                    <dnsName/>
+                    <reason/>
+                    <amiLaunchIndex>0</amiLaunchIndex>
+                    <productCodes/>
+                    <instanceType>t1.micro</instanceType>
+                    <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                    <placement>
+                        <availabilityZone>us-east-1a</availabilityZone>
+                        <groupName/>
+                    </placement>
+                    <kernelId>aki-88aa75e1</kernelId>
+                    <monitoring>
+                        <state>disabled</state>
+                    </monitoring>
+                    <stateReason>
+                        <code>pending</code>
+                        <message>pending</message>
+                    </stateReason>
+                    <architecture>x86_64</architecture>
+                    <rootDeviceType>ebs</rootDeviceType>
+                    <rootDeviceName>/dev/sda1</rootDeviceName>
+                    <blockDeviceMapping/>
+                    <virtualizationType>paravirtual</virtualizationType>
+                    <clientToken/>
+                </item>
+            </instancesSet>
+        </RunInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:24:40 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=RebootInstances&InstanceId.1=i-768c640c&Signature=i2hVf4DeZwGGOvnnOT3znwTn7XZTnjWhfb1Q3sEGbgs=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:02.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:02 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <RebootInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>630ce453-2d41-4c0d-ab27-140db812d4b1</requestId>
+            <return>true</return>
+        </RebootInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:02 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=fwLguKJtHglYEbm+ammmPmaXPMAT9sSg1/EG9XEq6fM=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:02.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:03 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>a1f18086-624c-4e8e-a81c-ebf736b9f344</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>16</code>
+                                <name>running</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-03-CA-6E.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-22-221-103.compute-1.amazonaws.com</dnsName>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.249.201.152</privateIpAddress>
+                            <ipAddress>23.22.221.103</ipAddress>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-75aa0f0e</volumeId>
+                                        <status>attached</status>
+                                        <attachTime>2012-08-28T23:25:01.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:03 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=oOTcViQozv2KBCKISS1arGBbGhi/xMSwpfrgNuBK1co=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:03.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:03 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>be67624c-43dd-4f58-a2ed-3ed3358ea70d</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>16</code>
+                                <name>running</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-03-CA-6E.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-22-221-103.compute-1.amazonaws.com</dnsName>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.249.201.152</privateIpAddress>
+                            <ipAddress>23.22.221.103</ipAddress>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-75aa0f0e</volumeId>
+                                        <status>attached</status>
+                                        <attachTime>2012-08-28T23:25:01.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:03 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=TerminateInstances&InstanceId.1=i-768c640c&Signature=kTmPtjoaUUqtXzwg3u3DEiK5i95ENZWKKRnkNJk9+aw=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:03.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:03 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <TerminateInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>5f727b94-b7b6-42d7-a91d-656f84614b98</requestId>
+            <instancesSet>
+                <item>
+                    <instanceId>i-768c640c</instanceId>
+                    <currentState>
+                        <code>32</code>
+                        <name>shutting-down</name>
+                    </currentState>
+                    <previousState>
+                        <code>16</code>
+                        <name>running</name>
+                    </previousState>
+                </item>
+            </instancesSet>
+        </TerminateInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:04 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=ma4c9NIDY+wOdJZwqEg6JciJwSq6jgj/Ip8G63vrjhk=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:04.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:04 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>56a061b3-3d36-459a-80cf-544717a0165f</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>32</code>
+                                <name>shutting-down</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-03-CA-6E.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-22-221-103.compute-1.amazonaws.com</dnsName>
+                            <reason>User initiated (2012-08-28 23:25:04 GMT)</reason>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.249.201.152</privateIpAddress>
+                            <ipAddress>23.22.221.103</ipAddress>
+                            <stateReason>
+                                <code>Client.UserInitiatedShutdown</code>
+                                <message>Client.UserInitiatedShutdown: User initiated
shutdown</message>
+                            </stateReason>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-75aa0f0e</volumeId>
+                                        <status>attached</status>
+                                        <attachTime>2012-08-28T23:25:01.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:05 GMT

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/31979f92/server/tests/drivers/ec2/fixtures/test_0009_must_allow_to_reboot_instance_in_running_state-9.yml
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/fixtures/test_0009_must_allow_to_reboot_instance_in_running_state-9.yml
b/server/tests/drivers/ec2/fixtures/test_0009_must_allow_to_reboot_instance_in_running_state-9.yml
new file mode 100644
index 0000000..b6f1760
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0009_must_allow_to_reboot_instance_in_running_state-9.yml
@@ -0,0 +1,88 @@
+--- 
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      User-Agent: 
+      - ""
+      Accept: 
+      - "*/*"
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+      Transfer-Encoding: 
+      - chunked
+      Date: 
+      - Mon, 30 Jul 2012 11:07:29 GMT
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>c28d5a60-c784-4b86-976a-da4ad72f3b57</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-362c9d52</reservationId>
+                    <ownerId>293787749884</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-7177920a</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>0</code>
+                                <name>pending</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.248.122.144</privateIpAddress>
+                            <ipAddress>23.20.114.135</ipAddress>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-ba6f60db</volumeId>
+                                        <status>attaching</status>
+                                        <attachTime>2012-07-30T11:07:24.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
+recorded_with: VCR 2.2.4

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/31979f92/server/tests/drivers/ec2/instance_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/instance_test.rb b/server/tests/drivers/ec2/instance_test.rb
index ed50c7d..2cbf848 100644
--- a/server/tests/drivers/ec2/instance_test.rb
+++ b/server/tests/drivers/ec2/instance_test.rb
@@ -90,6 +90,16 @@ describe 'Ec2Driver Instances' do
     instances.each { |i| i.is_stopped?.must_equal true }
   end
 
+  it 'must allow creating instance in a VPC subnet' do
+    realm_id = "#{@@subnet[:availability_zone]}:#{@@subnet[:subnet_id]}"
+    instance = @driver.create_instance('ami-aecd60c7',
+                                       :realm_id => realm_id,
+                                       :hwp_id => 'm1.small')
+    instance.must_be_kind_of Instance
+    instance.realm_id.must_equal realm_id
+    @driver.destroy_instance(instance.id)
+  end
+
   it 'must allow to reboot instance in running state' do
     instance = @driver.create_instance('ami-aecd60c7', :realm_id => 'us-east-1a', :hwp_id
=> 't1.micro')
     instance = instance.wait_for!(@driver, record_retries) { |i| i.is_running? }


Mime
View raw message