libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1079029 [11/13] - in /incubator/libcloud/trunk: ./ demos/ dist/ libcloud/ libcloud/common/ libcloud/compute/ libcloud/compute/drivers/ libcloud/drivers/ libcloud/storage/ libcloud/storage/drivers/ test/ test/compute/ test/compute/fixtures/...
Date Mon, 07 Mar 2011 23:44:12 GMT
Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,132 @@
+<VApp href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" type="application/vnd.vmware.vcloud.vApp+xml" name="testerpart2" status="4" size="10485760" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <Link rel="up" href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224" type="application/vnd.vmware.vcloud.vdc+xml"/>
+  <Link rel="down" href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031/options/compute" type="application/xml" name="Compute Options"/>
+  <Link rel="down" href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031/options/customization" type="application/xml" name="Customization Options"/>
+  <NetworkConnectionSection xmlns="http://schemas.dmtf.org/ovf/envelope/1">
+    <NetworkConnection Network="Internal" xmlns="http://www.vmware.com/vcloud/v0.8">
+      <IpAddress>10.112.78.69</IpAddress>
+    </NetworkConnection>
+  </NetworkConnectionSection>
+  <OperatingSystemSection d2p1:id="25" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:d2p1="http://schemas.dmtf.org/ovf/envelope/1">
+    <Info>The kind of installed guest operating system</Info>
+    <Description>Red Hat Enterprise Linux 5 (32-bit)</Description>
+  </OperatingSystemSection>
+  <VirtualHardwareSection xmlns="http://schemas.dmtf.org/ovf/envelope/1">
+    <Info>Virtual Hardware</Info>
+    <System>
+      <AutomaticRecoveryAction xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <AutomaticShutdownAction xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <AutomaticStartupAction xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <AutomaticStartupActionDelay xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <AutomaticStartupActionSequenceNumber xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <ConfigurationDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <ConfigurationFile xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <ConfigurationID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <CreationTime xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <Description xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">Virtual Hardware Family</ElementName>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">0</InstanceID>
+      <LogDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <RecoveryFile xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <SnapshotDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <SuspendDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <SwapFileDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <VirtualSystemIdentifier xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">testerpart2</VirtualSystemIdentifier>
+      <VirtualSystemType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">vmx-07</VirtualSystemType>
+    </System>
+    <Item>
+      <Address xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AddressOnParent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AllocationUnits xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">hertz * 10^6</AllocationUnits>
+      <AutomaticAllocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticDeallocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ConsumerVisibility xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Description xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Number of Virtual CPUs</Description>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2 virtual CPU(s)</ElementName>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1</InstanceID>
+      <Limit xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <MappingBehavior xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <OtherResourceType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Parent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <PoolID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Reservation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceSubType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</ResourceType>
+      <VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2</VirtualQuantity>
+      <VirtualQuantityUnits xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">count</VirtualQuantityUnits>
+      <Weight xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+    </Item>
+    <Item>
+      <Address xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AddressOnParent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AllocationUnits xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">byte * 2^20</AllocationUnits>
+      <AutomaticAllocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticDeallocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ConsumerVisibility xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Description xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Memory Size</Description>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">512MB of memory</ElementName>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2</InstanceID>
+      <Limit xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <MappingBehavior xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <OtherResourceType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Parent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <PoolID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Reservation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceSubType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">4</ResourceType>
+      <VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">512</VirtualQuantity>
+      <VirtualQuantityUnits xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">byte * 2^20</VirtualQuantityUnits>
+      <Weight xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+    </Item>
+    <Item>
+      <Address xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">0</Address>
+      <AddressOnParent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AllocationUnits xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticAllocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticDeallocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ConsumerVisibility xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Description xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">SCSI Controller</Description>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">SCSI Controller 0</ElementName>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</InstanceID>
+      <Limit xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <MappingBehavior xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <OtherResourceType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Parent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <PoolID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Reservation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceSubType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">lsilogic</ResourceSubType>
+      <ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">6</ResourceType>
+      <VirtualQuantity xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <VirtualQuantityUnits xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Weight xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+    </Item>
+    <Item>
+      <Address xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AddressOnParent xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">0</AddressOnParent>
+      <AllocationUnits xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticAllocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticDeallocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ConsumerVisibility xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Description xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Hard Disk 1</ElementName>
+      <HostResource xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">10485760</HostResource>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">9</InstanceID>
+      <Limit xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <MappingBehavior xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <OtherResourceType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Parent xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</Parent>
+      <PoolID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Reservation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceSubType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">17</ResourceType>
+      <VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">10485760</VirtualQuantity>
+      <VirtualQuantityUnits xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Weight xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+    </Item>
+  </VirtualHardwareSection>
+</VApp>

Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_action_deploy.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_action_deploy.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_action_deploy.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_action_deploy.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,4 @@
+<Task href="https://services.vcloudexpress.terremark.com/api/v0.8/task/10496" type="application/vnd.vmware.vcloud.task+xml" status="queued" startTime="2009-11-13T23:58:22.893Z" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <Owner href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224" type="application/vnd.vmware.vcloud.vdc+xml" name="Miami Environment 1"/>
+  <Result href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" type="application/vnd.vmware.vcloud.vApp+xml" name="testerpart2"/>
+</Task>

Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_get.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_get.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_get.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_get.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,132 @@
+<VApp href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" type="application/vnd.vmware.vcloud.vApp+xml" name="testerpart2" status="4" size="10485760" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <Link rel="up" href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224" type="application/vnd.vmware.vcloud.vdc+xml"/>
+  <Link rel="down" href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031/options/compute" type="application/xml" name="Compute Options"/>
+  <Link rel="down" href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031/options/customization" type="application/xml" name="Customization Options"/>
+  <NetworkConnectionSection xmlns="http://schemas.dmtf.org/ovf/envelope/1">
+    <NetworkConnection Network="Internal" xmlns="http://www.vmware.com/vcloud/v0.8">
+      <IpAddress>10.112.78.69</IpAddress>
+    </NetworkConnection>
+  </NetworkConnectionSection>
+  <OperatingSystemSection d2p1:id="25" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:d2p1="http://schemas.dmtf.org/ovf/envelope/1">
+    <Info>The kind of installed guest operating system</Info>
+    <Description>Red Hat Enterprise Linux 5 (32-bit)</Description>
+  </OperatingSystemSection>
+  <VirtualHardwareSection xmlns="http://schemas.dmtf.org/ovf/envelope/1">
+    <Info>Virtual Hardware</Info>
+    <System>
+      <AutomaticRecoveryAction xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <AutomaticShutdownAction xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <AutomaticStartupAction xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <AutomaticStartupActionDelay xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <AutomaticStartupActionSequenceNumber xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <ConfigurationDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <ConfigurationFile xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <ConfigurationID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <CreationTime xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <Description xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">Virtual Hardware Family</ElementName>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">0</InstanceID>
+      <LogDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <RecoveryFile xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <SnapshotDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <SuspendDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <SwapFileDataRoot xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"/>
+      <VirtualSystemIdentifier xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">testerpart2</VirtualSystemIdentifier>
+      <VirtualSystemType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">vmx-07</VirtualSystemType>
+    </System>
+    <Item>
+      <Address xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AddressOnParent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AllocationUnits xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">hertz * 10^6</AllocationUnits>
+      <AutomaticAllocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticDeallocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ConsumerVisibility xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Description xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Number of Virtual CPUs</Description>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2 virtual CPU(s)</ElementName>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1</InstanceID>
+      <Limit xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <MappingBehavior xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <OtherResourceType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Parent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <PoolID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Reservation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceSubType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</ResourceType>
+      <VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2</VirtualQuantity>
+      <VirtualQuantityUnits xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">count</VirtualQuantityUnits>
+      <Weight xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+    </Item>
+    <Item>
+      <Address xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AddressOnParent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AllocationUnits xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">byte * 2^20</AllocationUnits>
+      <AutomaticAllocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticDeallocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ConsumerVisibility xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Description xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Memory Size</Description>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">512MB of memory</ElementName>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">2</InstanceID>
+      <Limit xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <MappingBehavior xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <OtherResourceType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Parent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <PoolID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Reservation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceSubType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">4</ResourceType>
+      <VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">512</VirtualQuantity>
+      <VirtualQuantityUnits xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">byte * 2^20</VirtualQuantityUnits>
+      <Weight xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+    </Item>
+    <Item>
+      <Address xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">0</Address>
+      <AddressOnParent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AllocationUnits xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticAllocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticDeallocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ConsumerVisibility xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Description xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">SCSI Controller</Description>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">SCSI Controller 0</ElementName>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</InstanceID>
+      <Limit xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <MappingBehavior xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <OtherResourceType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Parent xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <PoolID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Reservation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceSubType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">lsilogic</ResourceSubType>
+      <ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">6</ResourceType>
+      <VirtualQuantity xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <VirtualQuantityUnits xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Weight xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+    </Item>
+    <Item>
+      <Address xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AddressOnParent xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">0</AddressOnParent>
+      <AllocationUnits xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticAllocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <AutomaticDeallocation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Caption xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ConsumerVisibility xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Description xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Hard Disk 1</ElementName>
+      <HostResource xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">10485760</HostResource>
+      <InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">9</InstanceID>
+      <Limit xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <MappingBehavior xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <OtherResourceType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Parent xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</Parent>
+      <PoolID xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Reservation xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceSubType xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">17</ResourceType>
+      <VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">10485760</VirtualQuantity>
+      <VirtualQuantityUnits xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+      <Weight xsi:nil="true" xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"/>
+    </Item>
+  </VirtualHardwareSection>
+</VApp>

Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_powerOn.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_powerOn.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_powerOn.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_powerOn.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,4 @@
+<Task href="https://services.vcloudexpress.terremark.com/api/v0.8/task/10499" type="application/vnd.vmware.vcloud.task+xml" status="queued" startTime="2009-11-14T00:01:05.227Z" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <Owner href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224" type="application/vnd.vmware.vcloud.vdc+xml" name="Miami Environment 1"/>
+  <Result href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" type="application/vnd.vmware.vcloud.vApp+xml" name="testerpart2"/>
+</Task>

Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_poweroff.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_poweroff.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_poweroff.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_poweroff.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,4 @@
+<Task href="https://services.vcloudexpress.terremark.com/api/v0.8/task/11001" type="application/vnd.vmware.vcloud.task+xml" status="queued" startTime="2009-11-16T18:18:02.82Z" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <Owner href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224" type="application/vnd.vmware.vcloud.vdc+xml" name="Miami Environment 1"/>
+  <Result href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" type="application/vnd.vmware.vcloud.vApp+xml" name="testerpart2"/>
+</Task>

Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_reset.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_reset.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_reset.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vapp_14031_power_action_reset.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,4 @@
+<Task href="https://services.vcloudexpress.terremark.com/api/v0.8/task/10555" type="application/vnd.vmware.vcloud.task+xml" status="queued" startTime="2009-11-14T00:54:50.417Z" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <Owner href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224" type="application/vnd.vmware.vcloud.vdc+xml" name="Miami Environment 1"/>
+  <Result href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" type="application/vnd.vmware.vcloud.vApp+xml" name="testerpart2"/>
+</Task>

Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,12 @@
+<Vdc href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224" type="application/vnd.vmware.vcloud.vdc+xml" name="Miami Environment 1" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <Link rel="down" href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224/catalog" type="application/vnd.vmware.vcloud.catalog+xml" name="Miami Environment 1"/>
+  <Link rel="down" href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224/publicIps" type="application/xml" name="Public IPs"/>
+  <Link rel="down" href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224/internetServices" type="application/xml" name="Internet Services"/>
+  <Description/>
+  <ResourceEntities>
+    <ResourceEntity href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" type="application/vnd.vmware.vcloud.vApp+xml" name="testerpart2"/>
+  </ResourceEntities>
+  <AvailableNetworks>
+    <Network href="https://services.vcloudexpress.terremark.com/api/v0.8/network/725" type="application/vnd.vmware.vcloud.network+xml" name="10.112.78.64/26"/>
+  </AvailableNetworks>
+</Vdc>

Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224_action_instantiateVAppTemplate.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224_action_instantiateVAppTemplate.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224_action_instantiateVAppTemplate.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224_action_instantiateVAppTemplate.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,3 @@
+<VApp href="https://services.vcloudexpress.terremark.com/api/v0.8/vapp/14031" type="application/vnd.vmware.vcloud.vApp+xml" name="testerpart2" status="0" size="10" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <Link rel="up" href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224" type="application/vnd.vmware.vcloud.vdc+xml"/>
+</VApp>

Added: incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224_catalog.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224_catalog.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224_catalog.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/terremark/api_v0_8_vdc_224_catalog.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,5 @@
+<Catalog href="https://services.vcloudexpress.terremark.com/api/v0.8/vdc/224/catalog" type="application/vnd.vmware.vcloud.catalog+xml" name="Miami Environment 1" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <CatalogItems>
+    <CatalogItem href="https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/5" type="application/vnd.vmware.vcloud.catalogItem+xml" name="CentOS 5.3 (32-bit)"/>
+  </CatalogItems>
+</Catalog>

Added: incubator/libcloud/trunk/test/compute/fixtures/voxel/unauthorized.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/fixtures/voxel/unauthorized.xml?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/fixtures/voxel/unauthorized.xml (added)
+++ incubator/libcloud/trunk/test/compute/fixtures/voxel/unauthorized.xml Mon Mar  7 23:44:06 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<rsp stat="fail">
+  <err code="1" msg="Invalid login or password"/>
+  <method>voxel.devices.list</method>
+  <parameters>
+    <param name="timestamp">2010-02-10T23:39:25.808107+0000</param>
+    <param name="key">authshouldfail</param>
+    <param name="api_sig">ae069bb835e998622caaddaeff8c98e0</param>
+  </parameters>
+  <string_to_sign>YOUR_SECRETtimestamp2010-02-10T23:39:25.808107+0000methodvoxel.devices.listkeyauthshouldfail</string_to_sign>
+</rsp>

Added: incubator/libcloud/trunk/test/compute/test_base.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_base.py?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_base.py (added)
+++ incubator/libcloud/trunk/test/compute/test_base.py Mon Mar  7 23:44:06 2011
@@ -0,0 +1,83 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import sys
+import unittest
+
+from libcloud.common.base import Response
+from libcloud.common.base import ConnectionKey, ConnectionUserAndKey
+from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver
+
+from test import MockResponse
+
+class FakeDriver(object):
+    type = 0
+
+class BaseTests(unittest.TestCase):
+
+    def test_base_node(self):
+        node = Node(id=0, name=0, state=0, public_ip=0, private_ip=0,
+            driver=FakeDriver())
+
+    def test_base_node_size(self):
+        node_size = NodeSize(id=0, name=0, ram=0, disk=0, bandwidth=0, price=0,
+            driver=FakeDriver())
+
+    def test_base_node_image(self):
+        node_image = NodeImage(id=0, name=0, driver=FakeDriver())
+
+    def test_base_response(self):
+        resp = Response(MockResponse(status=200, body='foo'))
+
+    def test_base_node_driver(self):
+        node_driver = NodeDriver('foo')
+
+    def test_base_connection_key(self):
+        conn = ConnectionKey('foo')
+
+    def test_base_connection_userkey(self):
+        conn = ConnectionUserAndKey('foo', 'bar')
+
+#    def test_drivers_interface(self):
+#        failures = []
+#        for driver in DRIVERS:
+#            creds = ProviderCreds(driver, 'foo', 'bar')
+#            try:
+#                verifyObject(INodeDriver, get_driver(driver)(creds))
+#            except BrokenImplementation:
+#                failures.append(DRIVERS[driver][1])
+#
+#        if failures:
+#            self.fail('the following drivers do not support the \
+#                       INodeDriver interface: %s' % (', '.join(failures)))
+
+#    def test_invalid_creds(self):
+#        failures = []
+#        for driver in DRIVERS:
+#            if driver == Provider.DUMMY:
+#                continue
+#            conn = connect(driver, 'bad', 'keys')
+#            try:
+#                conn.list_nodes()
+#            except InvalidCredsException:
+#                pass
+#            else:
+#                failures.append(DRIVERS[driver][1])
+#
+#        if failures:
+#            self.fail('the following drivers did not throw an \
+#                       InvalidCredsException: %s' % (', '.join(failures)))
+
+if __name__ == '__main__':
+    sys.exit(unittest.main())

Added: incubator/libcloud/trunk/test/compute/test_brightbox.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_brightbox.py?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_brightbox.py (added)
+++ incubator/libcloud/trunk/test/compute/test_brightbox.py Mon Mar  7 23:44:06 2011
@@ -0,0 +1,132 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import sys
+import unittest
+import httplib
+
+try:
+    import json
+except ImportError:
+    import simplejson as json
+
+from libcloud.common.types import InvalidCredsError
+from libcloud.compute.drivers.brightbox import BrightboxNodeDriver
+from libcloud.compute.types import NodeState
+
+from test import MockHttp
+from test.compute import TestCaseMixin
+from test.file_fixtures import ComputeFileFixtures
+from test.secrets import BRIGHTBOX_CLIENT_ID, BRIGHTBOX_CLIENT_SECRET
+
+
+class BrightboxTest(unittest.TestCase, TestCaseMixin):
+    def setUp(self):
+        BrightboxNodeDriver.connectionCls.conn_classes = (None, BrightboxMockHttp)
+        BrightboxMockHttp.type = None
+        self.driver = BrightboxNodeDriver(BRIGHTBOX_CLIENT_ID, BRIGHTBOX_CLIENT_SECRET)
+
+    def test_authentication(self):
+        BrightboxMockHttp.type = 'INVALID_CLIENT'
+        self.assertRaises(InvalidCredsError, self.driver.list_nodes)
+
+        BrightboxMockHttp.type = 'UNAUTHORIZED_CLIENT'
+        self.assertRaises(InvalidCredsError, self.driver.list_nodes)
+
+    def test_list_nodes(self):
+        nodes = self.driver.list_nodes()
+        self.assertEqual(len(nodes), 1)
+        self.assertTrue('109.107.42.129' in nodes[0].public_ip)
+        self.assertTrue('10.110.24.54' in nodes[0].private_ip)
+        self.assertEqual(nodes[0].state, NodeState.RUNNING)
+
+    def test_list_sizes(self):
+        sizes = self.driver.list_sizes()
+        self.assertEqual(len(sizes), 1)
+        self.assertEqual(sizes[0].id, 'typ-4nssg')
+        self.assertEqual(sizes[0].name, 'Brightbox Nano Instance')
+        self.assertEqual(sizes[0].ram, 512)
+
+    def test_list_images(self):
+        images = self.driver.list_images()
+        self.assertEqual(len(images), 1)
+        self.assertEqual(images[0].id, 'img-9vxqi')
+        self.assertEqual(images[0].name, 'Brightbox Lucid 32')
+        self.assertEqual(images[0].extra['arch'], '32-bit')
+
+    def test_reboot_node_response(self):
+        node = self.driver.list_nodes()[0]
+        self.assertRaises(NotImplementedError, self.driver.reboot_node, [node])
+
+    def test_destroy_node(self):
+        node = self.driver.list_nodes()[0]
+        self.assertTrue(self.driver.destroy_node(node))
+
+    def test_create_node(self):
+        size = self.driver.list_sizes()[0]
+        image = self.driver.list_images()[0]
+        node = self.driver.create_node(name='Test Node', image=image, size=size)
+        self.assertEqual('srv-3a97e', node.id)
+        self.assertEqual('Test Node', node.name)
+
+
+class BrightboxMockHttp(MockHttp):
+    fixtures = ComputeFileFixtures('brightbox')
+
+    def _token(self, method, url, body, headers):
+        if method == 'POST':
+            return self.response(httplib.OK, self.fixtures.load('token.json'))
+
+    def _token_INVALID_CLIENT(self, method, url, body, headers):
+        if method == 'POST':
+            return self.response(httplib.BAD_REQUEST, '{"error":"invalid_client"}')
+
+    def _token_UNAUTHORIZED_CLIENT(self, method, url, body, headers):
+        if method == 'POST':
+            return self.response(httplib.UNAUTHORIZED, '{"error":"unauthorized_client"}')
+
+    def _1_0_images(self, method, url, body, headers):
+        if method == 'GET':
+            return self.response(httplib.OK, self.fixtures.load('list_images.json'))
+
+    def _1_0_servers(self, method, url, body, headers):
+        if method == 'GET':
+            return self.response(httplib.OK, self.fixtures.load('list_servers.json'))
+        elif method == 'POST':
+            body = json.loads(body)
+
+            node = json.loads(self.fixtures.load('create_server.json'))
+
+            node['name'] = body['name']
+
+            return self.response(httplib.ACCEPTED, json.dumps(node))
+
+    def _1_0_servers_srv_3a97e(self, method, url, body, headers):
+        if method == 'DELETE':
+            return self.response(httplib.ACCEPTED, '')
+
+    def _1_0_server_types(self, method, url, body, headers):
+        if method == 'GET':
+            return self.response(httplib.OK, self.fixtures.load('list_server_types.json'))
+
+    def _1_0_zones(self, method, url, body, headers):
+        if method == 'GET':
+            return self.response(httplib.OK, self.fixtures.load('list_zones.json'))
+
+    def response(self, status, body):
+        return (status, body, {'content-type': 'application/json'}, httplib.responses[status])
+
+
+if __name__ == '__main__':
+    sys.exit(unittest.main())

Added: incubator/libcloud/trunk/test/compute/test_cloudsigma.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_cloudsigma.py?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_cloudsigma.py (added)
+++ incubator/libcloud/trunk/test/compute/test_cloudsigma.py Mon Mar  7 23:44:06 2011
@@ -0,0 +1,186 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+import unittest
+import httplib
+
+from libcloud.compute.base import Node
+from libcloud.compute.drivers.cloudsigma import CloudSigmaBaseNodeDriver
+from libcloud.compute.drivers.cloudsigma import str2dicts, str2list, dict2str
+
+from test import MockHttp
+from test.compute import TestCaseMixin
+from test.file_fixtures import ComputeFileFixtures
+
+
+class CloudSigmaTestCase(unittest.TestCase, TestCaseMixin):
+    def setUp(self):
+        CloudSigmaBaseNodeDriver.connectionCls.conn_classes = (None,
+                                                               CloudSigmaHttp)
+        self.driver = CloudSigmaBaseNodeDriver('foo', 'bar')
+
+    def test_list_nodes(self):
+        nodes = self.driver.list_nodes()
+        self.assertTrue(isinstance(nodes, list))
+        self.assertEqual(len(nodes), 1)
+
+        node = nodes[0]
+        self.assertEqual(node.public_ip[0], "1.2.3.4")
+        self.assertEqual(node.extra['smp'], 1)
+        self.assertEqual(node.extra['cpu'], 1100)
+        self.assertEqual(node.extra['mem'], 640)
+
+    def test_list_sizes(self):
+        images = self.driver.list_sizes()
+        self.assertEqual(len(images), 9)
+
+    def test_list_images(self):
+        sizes = self.driver.list_images()
+        self.assertEqual(len(sizes), 10)
+
+    def test_list_locations_response(self):
+        pass
+
+    def test_start_node(self):
+        nodes = self.driver.list_nodes()
+        node = nodes[0]
+        self.assertTrue(self.driver.ex_start_node(node))
+
+    def test_shutdown_node(self):
+        nodes = self.driver.list_nodes()
+        node = nodes[0]
+        self.assertTrue(self.driver.ex_stop_node(node))
+        self.assertTrue(self.driver.ex_shutdown_node(node))
+
+    def test_reboot_node(self):
+        node = self.driver.list_nodes()[0]
+        self.assertTrue(self.driver.reboot_node(node))
+
+    def test_destroy_node(self):
+        node = self.driver.list_nodes()[0]
+        self.assertTrue(self.driver.destroy_node(node))
+        nodes = self.driver.list_nodes()
+
+    def test_create_node(self):
+        size = self.driver.list_sizes()[0]
+        image = self.driver.list_images()[0]
+        node = self.driver.create_node(name = "cloudsigma node", image = image, size = size)
+        self.assertTrue(isinstance(node, Node))
+
+    def test_ex_static_ip_list(self):
+        ips = self.driver.ex_static_ip_list()
+        self.assertEqual(len(ips), 3)
+
+    def test_ex_static_ip_create(self):
+        result = self.driver.ex_static_ip_create()
+        self.assertEqual(len(result), 2)
+        self.assertEqual(len(result[0].keys()), 6)
+        self.assertEqual(len(result[1].keys()), 6)
+
+    def test_ex_static_ip_destroy(self):
+        result = self.driver.ex_static_ip_destroy('1.2.3.4')
+        self.assertTrue(result)
+
+    def test_ex_drives_list(self):
+        result = self.driver.ex_drives_list()
+        self.assertEqual(len(result), 2)
+
+    def test_ex_drive_destroy(self):
+        result = self.driver.ex_drive_destroy('d18119ce_7afa_474a_9242_e0384b160220')
+        self.assertTrue(result)
+
+    def test_ex_set_node_configuration(self):
+        node = self.driver.list_nodes()[0]
+        result = self.driver.ex_set_node_configuration(node, **{'smp': 2})
+        self.assertTrue(result)
+
+    def test_str2dicts(self):
+        string = 'mem 1024\ncpu 2200\n\nmem2048\cpu 1100'
+        result = str2dicts(string)
+        self.assertEqual(len(result), 2)
+
+    def test_str2list(self):
+        string = 'ip 1.2.3.4\nip 1.2.3.5\nip 1.2.3.6'
+        result = str2list(string)
+        self.assertEqual(len(result), 3)
+        self.assertEqual(result[0], '1.2.3.4')
+        self.assertEqual(result[1], '1.2.3.5')
+        self.assertEqual(result[2], '1.2.3.6')
+
+    def test_dict2str(self):
+        d = {'smp': 5, 'cpu': 2200, 'mem': 1024}
+        result = dict2str(d)
+        self.assertTrue(len(result) > 0)
+        self.assertTrue(result.find('smp 5') >= 0)
+        self.assertTrue(result.find('cpu 2200') >= 0)
+        self.assertTrue(result.find('mem 1024') >= 0)
+
+class CloudSigmaHttp(MockHttp):
+    fixtures = ComputeFileFixtures('cloudsigma')
+
+    def _drives_standard_info(self, method, url, body, headers):
+        body = self.fixtures.load('drives_standard_info.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_start(self, method, url, body, headers):
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_stop(self, method, url, body, headers):
+        return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.OK])
+
+    def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_destroy(self, method, url, body, headers):
+         return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT])
+
+    def _drives_d18119ce_7afa_474a_9242_e0384b160220_clone(self, method, url, body, headers):
+        body = self.fixtures.load('drives_clone.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _drives_a814def5_1789_49a0_bf88_7abe7bb1682a_info(self, method, url, body, headers):
+        body = self.fixtures.load('drives_single_info.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _drives_info(self, method, url, body, headers):
+        body = self.fixtures.load('drives_info.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _servers_create(self, method, url, body, headers):
+        body = self.fixtures.load('servers_create.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _servers_info(self, method, url, body, headers):
+        body = self.fixtures.load('servers_info.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _resources_ip_list(self, method, url, body, headers):
+        body = self.fixtures.load('resources_ip_list.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _resources_ip_create(self, method, url, body, headers):
+        body = self.fixtures.load('resources_ip_create.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _resources_ip_1_2_3_4_destroy(self, method, url, body, headers):
+        return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.OK])
+
+    def _drives_d18119ce_7afa_474a_9242_e0384b160220_destroy(self, method, url, body, headers):
+        return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.OK])
+
+    def _servers_62fe7cde_4fb9_4c63_bd8c_e757930066a0_set(self, method, url, body, headers):
+        body = self.fixtures.load('servers_set.txt')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+if __name__ == '__main__':
+    sys.exit(unittest.main())

Added: incubator/libcloud/trunk/test/compute/test_dreamhost.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_dreamhost.py?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_dreamhost.py (added)
+++ incubator/libcloud/trunk/test/compute/test_dreamhost.py Mon Mar  7 23:44:06 2011
@@ -0,0 +1,279 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import sys
+import unittest
+import httplib
+
+try:
+  import json
+except: 
+  import simplejson as json
+
+from libcloud.common.types import InvalidCredsError
+from libcloud.compute.drivers.dreamhost import DreamhostNodeDriver
+from libcloud.compute.types import NodeState
+
+from test import MockHttp
+from test.compute import TestCaseMixin
+from test.secrets import DREAMHOST_KEY
+
+class DreamhostTest(unittest.TestCase, TestCaseMixin):
+
+    def setUp(self):
+        DreamhostNodeDriver.connectionCls.conn_classes = (
+            None,
+            DreamhostMockHttp
+        )
+        DreamhostMockHttp.type = None
+        DreamhostMockHttp.use_param = 'cmd'
+        self.driver = DreamhostNodeDriver(DREAMHOST_KEY)
+
+    def test_invalid_creds(self):
+        """
+        Tests the error-handling for passing a bad API Key to the DreamHost API
+        """
+        DreamhostMockHttp.type = 'BAD_AUTH'
+        try:
+            self.driver.list_nodes()
+            self.assertTrue(False) # Above command should have thrown an InvalidCredsException
+        except InvalidCredsError:
+            self.assertTrue(True)
+
+
+    def test_list_nodes(self):
+        """
+        Test list_nodes for DreamHost PS driver.  Should return a list of two nodes:
+            -   account_id: 000000
+                ip: 75.119.203.51
+                memory_mb: 500
+                ps: ps22174
+                start_date: 2010-02-25
+                type: web
+            -   account_id: 000000
+                ip: 75.119.203.52
+                memory_mb: 1500
+                ps: ps22175
+                start_date: 2010-02-25
+                type: mysql
+        """
+
+        nodes = self.driver.list_nodes()
+        self.assertEqual(len(nodes), 2)
+        web_node = nodes[0]
+        mysql_node = nodes[1]
+
+        # Web node tests
+        self.assertEqual(web_node.id, 'ps22174')
+        self.assertEqual(web_node.state, NodeState.UNKNOWN)
+        self.assertTrue('75.119.203.51' in web_node.public_ip)
+        self.assertTrue(
+            web_node.extra.has_key('current_size') and
+            web_node.extra['current_size'] == 500
+        )
+        self.assertTrue(
+            web_node.extra.has_key('account_id') and
+            web_node.extra['account_id'] == 000000
+        )
+        self.assertTrue(
+            web_node.extra.has_key('type') and
+            web_node.extra['type'] == 'web'
+        )
+        # MySql node tests
+        self.assertEqual(mysql_node.id, 'ps22175')
+        self.assertEqual(mysql_node.state, NodeState.UNKNOWN)
+        self.assertTrue('75.119.203.52' in mysql_node.public_ip)
+        self.assertTrue(
+            mysql_node.extra.has_key('current_size') and
+            mysql_node.extra['current_size'] == 1500
+        )
+        self.assertTrue(
+            mysql_node.extra.has_key('account_id') and
+            mysql_node.extra['account_id'] == 000000
+        )
+        self.assertTrue(
+            mysql_node.extra.has_key('type') and
+            mysql_node.extra['type'] == 'mysql'
+        )
+
+    def test_create_node(self):
+        """
+        Test create_node for DreamHost PS driver.
+        This is not remarkably compatible with libcloud.  The DH API allows
+        users to specify what image they want to create and whether to move
+        all their data to the (web) PS. It does NOT accept a name, size, or
+        location.  The only information it returns is the PS's context id
+        Once the PS is ready it will appear in the list generated by list_ps.
+        """
+        new_node = self.driver.create_node(
+            image = self.driver.list_images()[0],
+            size = self.driver.list_sizes()[0],
+            movedata = 'no',
+        )
+        self.assertEqual(new_node.id, 'ps12345')
+        self.assertEqual(new_node.state, NodeState.PENDING)
+        self.assertTrue(
+            new_node.extra.has_key('type') and
+            new_node.extra['type'] == 'web'
+        )
+
+    def test_destroy_node(self):
+        """
+        Test destroy_node for DreamHost PS driver
+        """
+        node = self.driver.list_nodes()[0]
+        self.assertTrue(self.driver.destroy_node(node))
+
+    def test_destroy_node_failure(self):
+        """
+        Test destroy_node failure for DreamHost PS driver
+        """
+        node = self.driver.list_nodes()[0]
+
+        DreamhostMockHttp.type = 'API_FAILURE'
+        self.assertFalse(self.driver.destroy_node(node))
+
+    def test_reboot_node(self):
+        """
+        Test reboot_node for DreamHost PS driver.
+        """
+        node = self.driver.list_nodes()[0]
+        self.assertTrue(self.driver.reboot_node(node))
+
+    def test_reboot_node_failure(self):
+        """
+        Test reboot_node failure for DreamHost PS driver
+        """
+        node = self.driver.list_nodes()[0]
+
+        DreamhostMockHttp.type = 'API_FAILURE'
+        self.assertFalse(self.driver.reboot_node(node))
+
+    def test_resize_node(self):
+        """
+        Test resize_node for DreamHost PS driver
+        """
+        node = self.driver.list_nodes()[0]
+        self.assertTrue(self.driver._resize_node(node, 400))
+
+    def test_resize_node_failure(self):
+        """
+        Test reboot_node faliure for DreamHost PS driver
+        """
+        node = self.driver.list_nodes()[0]
+
+        DreamhostMockHttp.type = 'API_FAILURE'
+        self.assertFalse(self.driver._resize_node(node, 400))
+
+    def test_list_images(self):
+        """
+        Test list_images for DreamHost PS driver.
+        """
+        images = self.driver.list_images()
+        self.assertEqual(len(images), 2)
+        self.assertEqual(images[0].id, 'web')
+        self.assertEqual(images[0].name, 'web')
+        self.assertEqual(images[1].id, 'mysql')
+        self.assertEqual(images[1].name, 'mysql')
+
+    def test_list_sizes(self):
+        sizes = self.driver.list_sizes()
+        self.assertEqual(len(sizes), 5)
+
+        self.assertEqual(sizes[0].id, 'default')
+        self.assertEqual(sizes[0].bandwidth, None)
+        self.assertEqual(sizes[0].disk, None)
+        self.assertEqual(sizes[0].ram, 2300)
+        self.assertEqual(sizes[0].price, 115)
+
+    def test_list_locations(self):
+        try:
+            self.driver.list_locations()
+        except NotImplementedError:
+            pass
+
+    def test_list_locations_response(self):
+        self.assertRaises(NotImplementedError, self.driver.list_locations)
+
+class DreamhostMockHttp(MockHttp):
+
+    def _BAD_AUTH_dreamhost_ps_list_ps(self, method, url, body, headers):
+        body = json.dumps({'data' : 'invalid_api_key', 'result' : 'error'})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _dreamhost_ps_add_ps(self, method, url, body, headers):
+        body = json.dumps({'data' : {'added_web' : 'ps12345'}, 'result' : 'success'})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _dreamhost_ps_list_ps(self, method, url, body, headers):
+        data = [{
+            'account_id' : 000000,
+            'ip': '75.119.203.51',
+            'memory_mb' : 500,
+            'ps' : 'ps22174',
+            'start_date' : '2010-02-25',
+            'type' : 'web'
+        },
+        {
+            'account_id' : 000000,
+            'ip' : '75.119.203.52',
+            'memory_mb' : 1500,
+            'ps' : 'ps22175',
+            'start_date' : '2010-02-25',
+            'type' : 'mysql'
+        }]
+        result = 'success'
+        body = json.dumps({'data' : data, 'result' : result})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _dreamhost_ps_list_images(self, method, url, body, headers):
+        data = [{
+            'description' : 'Private web server',
+            'image' : 'web'
+        },
+        {
+            'description' : 'Private MySQL server',
+            'image' : 'mysql'
+        }]
+        result = 'success'
+        body = json.dumps({'data' : data, 'result' : result})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _dreamhost_ps_reboot(self, method, url, body, headers):
+        body = json.dumps({'data' : 'reboot_scheduled', 'result' : 'success'})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _API_FAILURE_dreamhost_ps_reboot(self, method, url, body, headers):
+        body = json.dumps({'data' : 'no_such_ps', 'result' : 'error'})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _dreamhost_ps_set_size(self, method, url, body, headers):
+        body = json.dumps({'data' : {'memory-mb' : '500'}, 'result' : 'success'})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _API_FAILURE_dreamhost_ps_set_size(self, method, url, body, headers):
+        body = json.dumps({'data' : 'internal_error_setting_size', 'result' : 'error'})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _dreamhost_ps_remove_ps(self, method, url, body, headers):
+        body = json.dumps({'data' : 'removed_web', 'result' : 'success'})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _API_FAILURE_dreamhost_ps_remove_ps(self, method, url, body, headers):
+        body = json.dumps({'data' : 'no_such_ps', 'result' : 'error'})
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+if __name__ == '__main__':
+    sys.exit(unittest.main())
+

Added: incubator/libcloud/trunk/test/compute/test_ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_ec2.py?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_ec2.py (added)
+++ incubator/libcloud/trunk/test/compute/test_ec2.py Mon Mar  7 23:44:06 2011
@@ -0,0 +1,273 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import sys
+import unittest
+import httplib
+
+from libcloud.compute.drivers.ec2 import EC2NodeDriver, EC2APSENodeDriver
+from libcloud.compute.drivers.ec2 import EC2APNENodeDriver, IdempotentParamError
+from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation
+
+from test import MockHttp
+from test.compute import TestCaseMixin
+from test.file_fixtures import ComputeFileFixtures
+
+from test.secrets import EC2_ACCESS_ID, EC2_SECRET
+
+class EC2Tests(unittest.TestCase, TestCaseMixin):
+
+    def setUp(self):
+        EC2NodeDriver.connectionCls.conn_classes = (None, EC2MockHttp)
+        EC2MockHttp.use_param = 'Action'
+        EC2MockHttp.type = None
+        self.driver = EC2NodeDriver(EC2_ACCESS_ID, EC2_SECRET)
+
+    def test_create_node(self):
+        image = NodeImage(id='ami-be3adfd7',
+                          name='ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml',
+                          driver=self.driver)
+        size = NodeSize('m1.small', 'Small Instance', None, None, None, None, driver=self.driver)
+        node = self.driver.create_node(name='foo', image=image, size=size)
+        self.assertEqual(node.id, 'i-2ba64342')
+
+    def test_create_node_idempotent(self):
+        EC2MockHttp.type = 'idempotent'
+        image = NodeImage(id='ami-be3adfd7',
+                          name='ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml',
+                          driver=self.driver)
+        size = NodeSize('m1.small', 'Small Instance', None, None, None, None, driver=self.driver)
+        token = 'testclienttoken'
+        node = self.driver.create_node(name='foo', image=image, size=size,
+                ex_clienttoken=token)
+        self.assertEqual(node.id, 'i-2ba64342')
+        self.assertEqual(node.extra['clienttoken'], token)
+
+        # from: http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/index.html?Run_Instance_Idempotency.html
+
+        #    If you repeat the request with the same client token, but change
+        #    another request parameter, Amazon EC2 returns an
+        #    IdempotentParameterMismatch error.
+
+        # In our case, changing the parameter doesn't actually matter since we
+        # are forcing the error response fixture.
+        EC2MockHttp.type = 'idempotent_mismatch'
+
+        idem_error = None
+        try:
+            self.driver.create_node(name='foo', image=image, size=size,
+                    ex_mincount='2', ex_maxcount='2', # different count
+                    ex_clienttoken=token)
+        except IdempotentParamError, e:
+            idem_error = e
+        self.assertTrue(idem_error is not None)
+
+    def test_create_node_no_availability_zone(self):
+        image = NodeImage(id='ami-be3adfd7',
+                          name='ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml',
+                          driver=self.driver)
+        size = NodeSize('m1.small', 'Small Instance', None, None, None, None,
+                        driver=self.driver)
+        node = self.driver.create_node(name='foo', image=image, size=size)
+        location = NodeLocation(0, 'Amazon US N. Virginia', 'US', self.driver)
+        self.assertEqual(node.id, 'i-2ba64342')
+        node = self.driver.create_node(name='foo', image=image, size=size,
+                                       location=location)
+        self.assertEqual(node.id, 'i-2ba64342')
+
+    def test_list_nodes(self):
+        node = self.driver.list_nodes()[0]
+        public_ips = sorted(node.public_ip)
+        self.assertEqual(node.id, 'i-4382922a')
+        self.assertEqual(len(node.public_ip), 2)
+
+        self.assertEqual(public_ips[0], '1.2.3.4')
+        self.assertEqual(public_ips[1], '1.2.3.5')
+
+    def test_list_location(self):
+        locations = self.driver.list_locations()
+        self.assertTrue(len(locations) > 0)
+        self.assertTrue(locations[0].availability_zone != None)
+
+    def test_reboot_node(self):
+        node = Node('i-4382922a', None, None, None, None, self.driver)
+        ret = self.driver.reboot_node(node)
+        self.assertTrue(ret)
+
+    def test_destroy_node(self):
+        node = Node('i-4382922a', None, None, None, None, self.driver)
+        ret = self.driver.destroy_node(node)
+        self.assertTrue(ret)
+
+    def test_list_sizes(self):
+        region_old = self.driver.region_name
+
+        for region_name in [ 'us-east-1', 'us-west-1', 'eu-west-1',
+                             'ap-southeast-1' ]:
+            self.driver.region_name = region_name
+            sizes = self.driver.list_sizes()
+
+            ids = [s.id for s in sizes]
+            self.assertTrue('t1.micro' in ids)
+            self.assertTrue('m1.small' in ids)
+            self.assertTrue('m1.large' in ids)
+            self.assertTrue('m1.xlarge' in ids)
+            self.assertTrue('c1.medium' in ids)
+            self.assertTrue('c1.xlarge' in ids)
+            self.assertTrue('m2.xlarge' in ids)
+            self.assertTrue('m2.2xlarge' in ids)
+            self.assertTrue('m2.4xlarge' in ids)
+
+            if region_name == 'us-east-1':
+                self.assertEqual(len(sizes), 11)
+                self.assertTrue('cg1.4xlarge' in ids)
+                self.assertTrue('cc1.4xlarge' in ids)
+            else:
+                self.assertEqual(len(sizes), 9)
+
+        self.driver.region_name = region_old
+
+    def test_list_images(self):
+        images = self.driver.list_images()
+        image = images[0]
+        self.assertEqual(len(images), 1)
+        self.assertEqual(image.name, 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml')
+        self.assertEqual(image.id, 'ami-be3adfd7')
+
+    def test_ex_list_availability_zones(self):
+        availability_zones = self.driver.ex_list_availability_zones()
+        availability_zone = availability_zones[0]
+        self.assertTrue(len(availability_zones) > 0)
+        self.assertEqual(availability_zone.name, 'eu-west-1a')
+        self.assertEqual(availability_zone.zone_state, 'available')
+        self.assertEqual(availability_zone.region_name, 'eu-west-1')
+
+    def test_ex_describe_tags(self):
+        node = Node('i-4382922a', None, None, None, None, self.driver)
+        tags = self.driver.ex_describe_tags(node)
+
+        self.assertEqual(len(tags), 3)
+        self.assertTrue('tag' in tags)
+        self.assertTrue('owner' in tags)
+        self.assertTrue('stack' in tags)
+
+    def test_ex_create_tags(self):
+        node = Node('i-4382922a', None, None, None, None, self.driver)
+        self.driver.ex_create_tags(node, {'sample': 'tag'})
+
+    def test_ex_delete_tags(self):
+        node = Node('i-4382922a', None, None, None, None, self.driver)
+        self.driver.ex_delete_tags(node, {'sample': 'tag'})
+
+    def test_ex_describe_addresses_for_node(self):
+        node1 = Node('i-4382922a', None, None, None, None, self.driver)
+        ip_addresses1 = self.driver.ex_describe_addresses_for_node(node1)
+        node2 = Node('i-4382922b', None, None, None, None, self.driver)
+        ip_addresses2 = sorted(self.driver.ex_describe_addresses_for_node(node2))
+        node3 = Node('i-4382922g', None, None, None, None, self.driver)
+        ip_addresses3 = sorted(self.driver.ex_describe_addresses_for_node(node3))
+
+        self.assertEqual(len(ip_addresses1), 1)
+        self.assertEqual(ip_addresses1[0], '1.2.3.4')
+
+        self.assertEqual(len(ip_addresses2), 2)
+        self.assertEqual(ip_addresses2[0], '1.2.3.5')
+        self.assertEqual(ip_addresses2[1], '1.2.3.6')
+
+        self.assertEqual(len(ip_addresses3), 0)
+
+    def test_ex_describe_addresses(self):
+        node1 = Node('i-4382922a', None, None, None, None, self.driver)
+        node2 = Node('i-4382922g', None, None, None, None, self.driver)
+        nodes_elastic_ips1 = self.driver.ex_describe_addresses([node1])
+        nodes_elastic_ips2 = self.driver.ex_describe_addresses([node2])
+
+        self.assertEqual(len(nodes_elastic_ips1), 1)
+        self.assertTrue(node1.id in nodes_elastic_ips1)
+        self.assertEqual(nodes_elastic_ips1[node1.id], ['1.2.3.4'])
+
+        self.assertEqual(len(nodes_elastic_ips2), 1)
+        self.assertTrue(node2.id in nodes_elastic_ips2)
+        self.assertEqual(nodes_elastic_ips2[node2.id], [])
+
+
+class EC2MockHttp(MockHttp):
+
+    fixtures = ComputeFileFixtures('ec2')
+
+    def _DescribeInstances(self, method, url, body, headers):
+        body = self.fixtures.load('describe_instances.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _DescribeAvailabilityZones(self, method, url, body, headers):
+        body = self.fixtures.load('describe_availability_zones.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _RebootInstances(self, method, url, body, headers):
+        body = self.fixtures.load('reboot_instances.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _DescribeImages(self, method, url, body, headers):
+        body = self.fixtures.load('describe_images.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _RunInstances(self, method, url, body, headers):
+        body = self.fixtures.load('run_instances.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _idempotent_RunInstances(self, method, url, body, headers):
+        body = self.fixtures.load('run_instances_idem.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _idempotent_mismatch_RunInstances(self, method, url, body, headers):
+        body = self.fixtures.load('run_instances_idem_mismatch.xml')
+        return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.BAD_REQUEST])
+
+    def _TerminateInstances(self, method, url, body, headers):
+        body = self.fixtures.load('terminate_instances.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _DescribeTags(self, method, url, body, headers):
+        body = self.fixtures.load('describe_tags.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _CreateTags(self, method, url, body, headers):
+        body = self.fixtures.load('create_tags.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _DeleteTags(self, method, url, body, headers):
+        body = self.fixtures.load('delete_tags.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _DescribeAddresses(self, method, url, body, headers):
+        body = self.fixtures.load('describe_addresses_multi.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+
+class EC2APSETests(EC2Tests):
+    def setUp(self):
+        EC2APSENodeDriver.connectionCls.conn_classes = (None, EC2MockHttp)
+        EC2MockHttp.use_param = 'Action'
+        EC2MockHttp.type = None
+        self.driver = EC2APSENodeDriver(EC2_ACCESS_ID, EC2_SECRET)
+
+class EC2APNETests(EC2Tests):
+    def setUp(self):
+        EC2APNENodeDriver.connectionCls.conn_classes = (None, EC2MockHttp)
+        EC2MockHttp.use_param = 'Action'
+        EC2MockHttp.type = None
+        self.driver = EC2APNENodeDriver(EC2_ACCESS_ID, EC2_SECRET)
+
+if __name__ == '__main__':
+    sys.exit(unittest.main())

Added: incubator/libcloud/trunk/test/compute/test_ecp.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_ecp.py?rev=1079029&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_ecp.py (added)
+++ incubator/libcloud/trunk/test/compute/test_ecp.py Mon Mar  7 23:44:06 2011
@@ -0,0 +1,128 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import sys
+import unittest
+import httplib
+
+from libcloud.compute.drivers.ecp import ECPNodeDriver
+from libcloud.compute.types import NodeState
+
+from test import MockHttp
+from test.compute import TestCaseMixin
+from test.file_fixtures import ComputeFileFixtures
+
+from test.secrets import ECP_USER_NAME, ECP_PASSWORD
+
+class ECPTests(unittest.TestCase, TestCaseMixin):
+
+    def setUp(self):
+        ECPNodeDriver.connectionCls.conn_classes = (None,
+                                                            ECPMockHttp)
+        self.driver = ECPNodeDriver(ECP_USER_NAME, ECP_PASSWORD)
+
+
+    def test_list_nodes(self):
+        nodes = self.driver.list_nodes()
+        self.assertEqual(len(nodes),2)
+        node = nodes[0]
+        self.assertEqual(node.id, '1')
+        self.assertEqual(node.name, 'dummy-1')
+        self.assertEqual(node.public_ip[0], "42.78.124.75")
+        self.assertEqual(node.state, NodeState.RUNNING)
+
+
+    def test_list_sizes(self):
+        sizes = self.driver.list_sizes()
+        self.assertEqual(len(sizes),3)
+        size = sizes[0]
+        self.assertEqual(size.id,'1')
+        self.assertEqual(size.ram,512)
+        self.assertEqual(size.disk,0)
+        self.assertEqual(size.bandwidth,0)
+        self.assertEqual(size.price,0)
+
+    def test_list_images(self):
+        images = self.driver.list_images()
+        self.assertEqual(len(images),2)
+        self.assertEqual(images[0].name,"centos54: AUTO import from /opt/enomalism2/repo/5d407a68-c76c-11de-86e5-000475cb7577.xvm2")
+        self.assertEqual(images[0].id, "1")
+        self.assertEqual(images[1].name,"centos54 two: AUTO import from /opt/enomalism2/repo/5d407a68-c76c-11de-86e5-000475cb7577.xvm2")
+        self.assertEqual(images[1].id, "2")
+
+    def test_reboot_node(self):
+        # Raises exception on failure
+        node = self.driver.list_nodes()[0]
+        self.driver.reboot_node(node)
+
+    def test_destroy_node(self):
+        # Raises exception on failure
+        node = self.driver.list_nodes()[0]
+        self.driver.destroy_node(node)
+
+    def test_create_node(self):
+        # Raises exception on failure
+        size = self.driver.list_sizes()[0]
+        image = self.driver.list_images()[0]
+        node = self.driver.create_node(name="api.ivan.net.nz", image=image, size=size)
+        self.assertEqual(node.name, "api.ivan.net.nz")
+        self.assertEqual(node.id, "1234")
+
+class ECPMockHttp(MockHttp):
+
+    fixtures = ComputeFileFixtures('ecp')
+
+    def _modules_hosting(self, method, url, body, headers):
+        headers = {}
+        headers['set-cookie'] = 'vcloud-token=testtoken'
+        body = 'Anything'
+        return (httplib.OK, body, headers, httplib.responses[httplib.OK])
+
+    def _rest_hosting_vm_1(self, method, url, body, headers):
+        if method == 'GET':
+            body = self.fixtures.load('vm_1_get.json')
+        if method == 'POST':
+            if body.find('delete',0):
+                body = self.fixtures.load('vm_1_action_delete.json')
+            if body.find('stop',0):
+                body = self.fixtures.load('vm_1_action_stop.json')
+            if body.find('start',0):
+                body = self.fixtures.load('vm_1_action_start.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _rest_hosting_vm(self, method, url, body, headers):
+        if method == 'PUT':
+            body = self.fixtures.load('vm_put.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _rest_hosting_vm_list(self, method, url, body, headers):
+        body = self.fixtures.load('vm_list.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _rest_hosting_htemplate_list(self, method, url, body, headers):
+        body = self.fixtures.load('htemplate_list.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _rest_hosting_network_list(self, method, url, body, headers):
+        body = self.fixtures.load('network_list.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _rest_hosting_ptemplate_list(self, method, url, body, headers):
+        body = self.fixtures.load('ptemplate_list.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+
+
+if __name__ == '__main__':
+    sys.exit(unittest.main())



Mime
View raw message