incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1090287 [21/21] - in /incubator/deltacloud/trunk/server: ./ lib/deltacloud/drivers/rhevm/ tests/ tests/drivers/rhevm/ tests/drivers/rhevm/fixtures/
Date Fri, 08 Apr 2011 15:04:28 GMT
Added: incubator/deltacloud/trunk/server/tests/drivers/rhevm/fixtures/post-8df81dde5740cfcc811f8cc6a144ac381f417a77.yml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/drivers/rhevm/fixtures/post-8df81dde5740cfcc811f8cc6a144ac381f417a77.yml?rev=1090287&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/tests/drivers/rhevm/fixtures/post-8df81dde5740cfcc811f8cc6a144ac381f417a77.yml
(added)
+++ incubator/deltacloud/trunk/server/tests/drivers/rhevm/fixtures/post-8df81dde5740cfcc811f8cc6a144ac381f417a77.yml
Fri Apr  8 15:04:27 2011
@@ -0,0 +1,240 @@
+--- 
+- !ruby/struct:VCR::HTTPInteraction 
+  request: !ruby/struct:VCR::Request 
+    method: :get
+    uri: https://rhev-m%40deltacloud.local:RedHat001@rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell
+    body: 
+    headers: 
+      accept: 
+      - application/xml
+      accept-encoding: 
+      - gzip, deflate
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 200
+      message: OK
+    headers: 
+      expires: 
+      - Wed, 31 Dec 1969 16:00:00 PST
+      content-type: 
+      - application/xml
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Fri, 08 Apr 2011 22:48:46 GMT
+      content-length: 
+      - "2163"
+      link: 
+      - <https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/capabilities>;
rel=capabilities,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/clusters>;
rel=clusters,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/clusters?search={query}>;
rel=clusters/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/datacenters>;
rel=datacenters,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/datacenters?search={query}>;
rel=datacenters/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/events>;
rel=events,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/events?search={query}>;
rel=events/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/hosts>;
rel=hosts,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/hosts?search={query}>;
rel=hosts/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/networks>;
rel=ne
 tworks,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/roles>; rel=roles,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/storagedomains>;
rel=storagedomains,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/storagedomains?search={query}>;
rel=storagedomains/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/tags>;
rel=tags,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/templates>;
rel=templates,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/templates?search={query}>;
rel=templates/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/users>;
rel=users,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/users?search={query}>;
rel=users/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vmpools>;
rel=vmpools,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vmpools?search={query}>;
rel=vmpools/sea
 rch,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms>; rel=vms,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms?search={query}>;
rel=vms/search
+      cache-control: 
+      - no-cache
+      pragma: 
+      - No-cache
+    body: |
+      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+      <api>
+          <link rel="capabilities" href="/rhevm-api-powershell/capabilities"/>
+          <link rel="clusters" href="/rhevm-api-powershell/clusters"/>
+          <link rel="clusters/search" href="/rhevm-api-powershell/clusters?search={query}"/>
+          <link rel="datacenters" href="/rhevm-api-powershell/datacenters"/>
+          <link rel="datacenters/search" href="/rhevm-api-powershell/datacenters?search={query}"/>
+          <link rel="events" href="/rhevm-api-powershell/events"/>
+          <link rel="events/search" href="/rhevm-api-powershell/events?search={query}"/>
+          <link rel="hosts" href="/rhevm-api-powershell/hosts"/>
+          <link rel="hosts/search" href="/rhevm-api-powershell/hosts?search={query}"/>
+          <link rel="networks" href="/rhevm-api-powershell/networks"/>
+          <link rel="roles" href="/rhevm-api-powershell/roles"/>
+          <link rel="storagedomains" href="/rhevm-api-powershell/storagedomains"/>
+          <link rel="storagedomains/search" href="/rhevm-api-powershell/storagedomains?search={query}"/>
+          <link rel="tags" href="/rhevm-api-powershell/tags"/>
+          <link rel="templates" href="/rhevm-api-powershell/templates"/>
+          <link rel="templates/search" href="/rhevm-api-powershell/templates?search={query}"/>
+          <link rel="users" href="/rhevm-api-powershell/users"/>
+          <link rel="users/search" href="/rhevm-api-powershell/users?search={query}"/>
+          <link rel="vmpools" href="/rhevm-api-powershell/vmpools"/>
+          <link rel="vmpools/search" href="/rhevm-api-powershell/vmpools?search={query}"/>
+          <link rel="vms" href="/rhevm-api-powershell/vms"/>
+          <link rel="vms/search" href="/rhevm-api-powershell/vms?search={query}"/>
+          <system_version revision="51796" build="4" minor="2" major="2"/>
+          <summary>
+              <vms>
+                  <total>10</total>
+                  <active>10</active>
+              </vms>
+              <hosts>
+                  <total>1</total>
+                  <active>1</active>
+              </hosts>
+              <users>
+                  <total>5</total>
+                  <active>4</active>
+              </users>
+              <storage_domains>
+                  <total>2</total>
+                  <active>2</active>
+              </storage_domains>
+          </summary>
+      </api>
+
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction 
+  request: !ruby/struct:VCR::Request 
+    method: :post
+    uri: https://rhev-m%40deltacloud.local:RedHat001@rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms
+    body: <vm><name>mock-test1</name><template id='bb2e79bd-fd73-46a1-b391-a390b1998f03'/><cluster
id='0'/><type>DESKTOP</type></vm>
+    headers: 
+      accept: 
+      - application/xml
+      content-type: 
+      - application/xml
+      accept-encoding: 
+      - gzip, deflate
+      content-length: 
+      - "122"
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 202
+      message: Accepted
+    headers: 
+      content-type: 
+      - application/xml
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Fri, 08 Apr 2011 22:48:48 GMT
+      content-length: 
+      - "2606"
+    body: |
+      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+      <vm id="b5422bb3-979a-423c-87cb-1cd93c2ab239" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239">
+          <name>mock-test1</name>
+          <description>F14 Minimal installation with Ruby preinstalled</description>
+          <actions>
+              <link rel="migrate" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/migrate"/>
+              <link rel="export" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/export"/>
+              <link rel="ticket" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/ticket"/>
+              <link rel="shutdown" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/shutdown"/>
+              <link rel="start" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/start"/>
+              <link rel="stop" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/stop"/>
+              <link rel="suspend" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/suspend"/>
+              <link rel="detach" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/detach"/>
+          </actions>
+          <creation_status>IN_PROGRESS</creation_status>
+          <link rel="cdroms" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/cdroms"/>
+          <link rel="disks" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/disks"/>
+          <link rel="nics" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/nics"/>
+          <link rel="snapshots" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/snapshots"/>
+          <link rel="tags" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/tags"/>
+          <link rel="statistics" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/statistics"/>
+          <link rel="creation_status" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/creation_status/2cb10e2a-6639-408b-a75b-4998dbbc179a"/>
+          <type>DESKTOP</type>
+          <status>IMAGE_LOCKED</status>
+          <memory>536870912</memory>
+          <cpu>
+              <topology cores="1" sockets="1"/>
+          </cpu>
+          <os type="OtherLinux">
+              <boot dev="hd"/>
+          </os>
+          <highly_available priority="0">false</highly_available>
+          <display>
+              <type>SPICE</type>
+              <monitors>1</monitors>
+          </display>
+          <cluster id="0" href="/rhevm-api-powershell/clusters/0"/>
+          <template id="bb2e79bd-fd73-46a1-b391-a390b1998f03" href="/rhevm-api-powershell/templates/bb2e79bd-fd73-46a1-b391-a390b1998f03"/>
+          <origin>RHEV</origin>
+          <stateless>false</stateless>
+      </vm>
+
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction 
+  request: !ruby/struct:VCR::Request 
+    method: :get
+    uri: https://rhev-m%40deltacloud.local:RedHat001@rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/disks
+    body: 
+    headers: 
+      accept: 
+      - application/xml
+      accept-encoding: 
+      - gzip, deflate
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 200
+      message: OK
+    headers: 
+      expires: 
+      - Wed, 31 Dec 1969 16:00:00 PST
+      content-type: 
+      - application/xml
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Fri, 08 Apr 2011 22:48:48 GMT
+      content-length: 
+      - "771"
+      cache-control: 
+      - no-cache
+      pragma: 
+      - No-cache
+    body: |
+      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+      <disks>
+          <disk id="557028d9-82db-49de-889e-2ef46654e7c0" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/disks/557028d9-82db-49de-889e-2ef46654e7c0">
+              <description>_mock-test1_4/8/2011 3:48:48 PM</description>
+              <vm id="b5422bb3-979a-423c-87cb-1cd93c2ab239" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239"/>
+              <size>7113539584</size>
+              <type>SYSTEM</type>
+              <status>LOCKED</status>
+              <interface>VIRTIO</interface>
+              <format>COW</format>
+              <sparse>true</sparse>
+              <bootable>true</bootable>
+              <wipe_after_delete>false</wipe_after_delete>
+              <propagate_errors>false</propagate_errors>
+          </disk>
+      </disks>
+
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction 
+  request: !ruby/struct:VCR::Request 
+    method: :get
+    uri: https://rhev-m%40deltacloud.local:RedHat001@rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/nics
+    body: 
+    headers: 
+      accept: 
+      - application/xml
+      accept-encoding: 
+      - gzip, deflate
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 200
+      message: OK
+    headers: 
+      expires: 
+      - Wed, 31 Dec 1969 16:00:00 PST
+      content-type: 
+      - application/xml
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Fri, 08 Apr 2011 22:48:48 GMT
+      content-length: 
+      - "601"
+      cache-control: 
+      - no-cache
+      pragma: 
+      - No-cache
+    body: |
+      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+      <nics>
+          <nic id="da320823-34e0-4b84-abbe-4cdac00de038" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239/nics/da320823-34e0-4b84-abbe-4cdac00de038">
+              <name>nic1</name>
+              <vm id="b5422bb3-979a-423c-87cb-1cd93c2ab239" href="/rhevm-api-powershell/vms/b5422bb3-979a-423c-87cb-1cd93c2ab239"/>
+              <network id="00000000-0000-0000-0000-000000000009" href="/rhevm-api-powershell/networks/00000000-0000-0000-0000-000000000009"/>
+              <type>PV</type>
+              <mac address="00:1a:4a:22:20:34"/>
+          </nic>
+      </nics>
+
+    http_version: "1.1"

Added: incubator/deltacloud/trunk/server/tests/drivers/rhevm/fixtures/post-e6ef0d15fa869bf38d040855c89472533ae30df8.yml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/drivers/rhevm/fixtures/post-e6ef0d15fa869bf38d040855c89472533ae30df8.yml?rev=1090287&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/tests/drivers/rhevm/fixtures/post-e6ef0d15fa869bf38d040855c89472533ae30df8.yml
(added)
+++ incubator/deltacloud/trunk/server/tests/drivers/rhevm/fixtures/post-e6ef0d15fa869bf38d040855c89472533ae30df8.yml
Fri Apr  8 15:04:27 2011
@@ -0,0 +1,240 @@
+--- 
+- !ruby/struct:VCR::HTTPInteraction 
+  request: !ruby/struct:VCR::Request 
+    method: :get
+    uri: https://rhev-m%40deltacloud.local:RedHat001@rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell
+    body: 
+    headers: 
+      accept: 
+      - application/xml
+      accept-encoding: 
+      - gzip, deflate
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 200
+      message: OK
+    headers: 
+      expires: 
+      - Wed, 31 Dec 1969 16:00:00 PST
+      content-type: 
+      - application/xml
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Fri, 08 Apr 2011 22:48:48 GMT
+      content-length: 
+      - "2163"
+      link: 
+      - <https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/capabilities>;
rel=capabilities,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/clusters>;
rel=clusters,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/clusters?search={query}>;
rel=clusters/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/datacenters>;
rel=datacenters,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/datacenters?search={query}>;
rel=datacenters/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/events>;
rel=events,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/events?search={query}>;
rel=events/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/hosts>;
rel=hosts,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/hosts?search={query}>;
rel=hosts/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/networks>;
rel=ne
 tworks,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/roles>; rel=roles,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/storagedomains>;
rel=storagedomains,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/storagedomains?search={query}>;
rel=storagedomains/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/tags>;
rel=tags,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/templates>;
rel=templates,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/templates?search={query}>;
rel=templates/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/users>;
rel=users,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/users?search={query}>;
rel=users/search,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vmpools>;
rel=vmpools,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vmpools?search={query}>;
rel=vmpools/sea
 rch,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms>; rel=vms,<https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms?search={query}>;
rel=vms/search
+      cache-control: 
+      - no-cache
+      pragma: 
+      - No-cache
+    body: |
+      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+      <api>
+          <link rel="capabilities" href="/rhevm-api-powershell/capabilities"/>
+          <link rel="clusters" href="/rhevm-api-powershell/clusters"/>
+          <link rel="clusters/search" href="/rhevm-api-powershell/clusters?search={query}"/>
+          <link rel="datacenters" href="/rhevm-api-powershell/datacenters"/>
+          <link rel="datacenters/search" href="/rhevm-api-powershell/datacenters?search={query}"/>
+          <link rel="events" href="/rhevm-api-powershell/events"/>
+          <link rel="events/search" href="/rhevm-api-powershell/events?search={query}"/>
+          <link rel="hosts" href="/rhevm-api-powershell/hosts"/>
+          <link rel="hosts/search" href="/rhevm-api-powershell/hosts?search={query}"/>
+          <link rel="networks" href="/rhevm-api-powershell/networks"/>
+          <link rel="roles" href="/rhevm-api-powershell/roles"/>
+          <link rel="storagedomains" href="/rhevm-api-powershell/storagedomains"/>
+          <link rel="storagedomains/search" href="/rhevm-api-powershell/storagedomains?search={query}"/>
+          <link rel="tags" href="/rhevm-api-powershell/tags"/>
+          <link rel="templates" href="/rhevm-api-powershell/templates"/>
+          <link rel="templates/search" href="/rhevm-api-powershell/templates?search={query}"/>
+          <link rel="users" href="/rhevm-api-powershell/users"/>
+          <link rel="users/search" href="/rhevm-api-powershell/users?search={query}"/>
+          <link rel="vmpools" href="/rhevm-api-powershell/vmpools"/>
+          <link rel="vmpools/search" href="/rhevm-api-powershell/vmpools?search={query}"/>
+          <link rel="vms" href="/rhevm-api-powershell/vms"/>
+          <link rel="vms/search" href="/rhevm-api-powershell/vms?search={query}"/>
+          <system_version revision="51796" build="4" minor="2" major="2"/>
+          <summary>
+              <vms>
+                  <total>11</total>
+                  <active>10</active>
+              </vms>
+              <hosts>
+                  <total>1</total>
+                  <active>1</active>
+              </hosts>
+              <users>
+                  <total>5</total>
+                  <active>4</active>
+              </users>
+              <storage_domains>
+                  <total>2</total>
+                  <active>2</active>
+              </storage_domains>
+          </summary>
+      </api>
+
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction 
+  request: !ruby/struct:VCR::Request 
+    method: :post
+    uri: https://rhev-m%40deltacloud.local:RedHat001@rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms
+    body: <vm><name>mock-test2</name><template id='bb2e79bd-fd73-46a1-b391-a390b1998f03'/><cluster
id='0'/><type>SERVER</type></vm>
+    headers: 
+      accept: 
+      - application/xml
+      content-type: 
+      - application/xml
+      accept-encoding: 
+      - gzip, deflate
+      content-length: 
+      - "121"
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 202
+      message: Accepted
+    headers: 
+      content-type: 
+      - application/xml
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Fri, 08 Apr 2011 22:48:52 GMT
+      content-length: 
+      - "2605"
+    body: |
+      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+      <vm id="459acd4b-6964-4998-b619-f35e7c021e01" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01">
+          <name>mock-test2</name>
+          <description>F14 Minimal installation with Ruby preinstalled</description>
+          <actions>
+              <link rel="migrate" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/migrate"/>
+              <link rel="export" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/export"/>
+              <link rel="ticket" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/ticket"/>
+              <link rel="shutdown" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/shutdown"/>
+              <link rel="start" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/start"/>
+              <link rel="stop" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/stop"/>
+              <link rel="suspend" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/suspend"/>
+              <link rel="detach" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/detach"/>
+          </actions>
+          <creation_status>IN_PROGRESS</creation_status>
+          <link rel="cdroms" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/cdroms"/>
+          <link rel="disks" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/disks"/>
+          <link rel="nics" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/nics"/>
+          <link rel="snapshots" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/snapshots"/>
+          <link rel="tags" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/tags"/>
+          <link rel="statistics" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/statistics"/>
+          <link rel="creation_status" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/creation_status/5c671d39-4f06-4ab2-a249-758ef4942246"/>
+          <type>SERVER</type>
+          <status>IMAGE_LOCKED</status>
+          <memory>536870912</memory>
+          <cpu>
+              <topology cores="1" sockets="1"/>
+          </cpu>
+          <os type="OtherLinux">
+              <boot dev="hd"/>
+          </os>
+          <highly_available priority="0">false</highly_available>
+          <display>
+              <type>SPICE</type>
+              <monitors>1</monitors>
+          </display>
+          <cluster id="0" href="/rhevm-api-powershell/clusters/0"/>
+          <template id="bb2e79bd-fd73-46a1-b391-a390b1998f03" href="/rhevm-api-powershell/templates/bb2e79bd-fd73-46a1-b391-a390b1998f03"/>
+          <origin>RHEV</origin>
+          <stateless>false</stateless>
+      </vm>
+
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction 
+  request: !ruby/struct:VCR::Request 
+    method: :get
+    uri: https://rhev-m%40deltacloud.local:RedHat001@rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/disks
+    body: 
+    headers: 
+      accept: 
+      - application/xml
+      accept-encoding: 
+      - gzip, deflate
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 200
+      message: OK
+    headers: 
+      expires: 
+      - Wed, 31 Dec 1969 16:00:00 PST
+      content-type: 
+      - application/xml
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Fri, 08 Apr 2011 22:48:52 GMT
+      content-length: 
+      - "771"
+      cache-control: 
+      - no-cache
+      pragma: 
+      - No-cache
+    body: |
+      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+      <disks>
+          <disk id="c36cf3dd-8b89-454a-91e4-9c8af5680612" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/disks/c36cf3dd-8b89-454a-91e4-9c8af5680612">
+              <description>_mock-test2_4/8/2011 3:48:52 PM</description>
+              <vm id="459acd4b-6964-4998-b619-f35e7c021e01" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01"/>
+              <size>7113539584</size>
+              <type>SYSTEM</type>
+              <status>LOCKED</status>
+              <interface>VIRTIO</interface>
+              <format>COW</format>
+              <sparse>true</sparse>
+              <bootable>true</bootable>
+              <wipe_after_delete>false</wipe_after_delete>
+              <propagate_errors>false</propagate_errors>
+          </disk>
+      </disks>
+
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction 
+  request: !ruby/struct:VCR::Request 
+    method: :get
+    uri: https://rhev-m%40deltacloud.local:RedHat001@rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/nics
+    body: 
+    headers: 
+      accept: 
+      - application/xml
+      accept-encoding: 
+      - gzip, deflate
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 200
+      message: OK
+    headers: 
+      expires: 
+      - Wed, 31 Dec 1969 16:00:00 PST
+      content-type: 
+      - application/xml
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Fri, 08 Apr 2011 22:48:52 GMT
+      content-length: 
+      - "601"
+      cache-control: 
+      - no-cache
+      pragma: 
+      - No-cache
+    body: |
+      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+      <nics>
+          <nic id="c036acb0-d63b-46ec-a24b-636e1c9ae0d6" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01/nics/c036acb0-d63b-46ec-a24b-636e1c9ae0d6">
+              <name>nic1</name>
+              <vm id="459acd4b-6964-4998-b619-f35e7c021e01" href="/rhevm-api-powershell/vms/459acd4b-6964-4998-b619-f35e7c021e01"/>
+              <network id="00000000-0000-0000-0000-000000000009" href="/rhevm-api-powershell/networks/00000000-0000-0000-0000-000000000009"/>
+              <type>PV</type>
+              <mac address="00:1a:4a:22:20:35"/>
+          </nic>
+      </nics>
+
+    http_version: "1.1"

Added: incubator/deltacloud/trunk/server/tests/drivers/rhevm/hardware_profiles_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/drivers/rhevm/hardware_profiles_test.rb?rev=1090287&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/tests/drivers/rhevm/hardware_profiles_test.rb (added)
+++ incubator/deltacloud/trunk/server/tests/drivers/rhevm/hardware_profiles_test.rb Fri Apr
 8 15:04:27 2011
@@ -0,0 +1,53 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RHEVMTest
+
+  class HardwareProfilesTest < Test::Unit::TestCase
+    include Rack::Test::Methods
+
+    def app
+      Sinatra::Application
+    end
+
+    def test_01_it_returns_hardware_profiles
+      get_auth_url '/api;driver=rhevm/hardware_profiles'
+      (last_xml_response/'hardware_profiles/hardware_profile').length.should == 2
+    end
+
+    def test_02_each_hardware_profile_has_a_name
+      get_auth_url '/api;driver=rhevm/hardware_profiles'
+      (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
+        (profile/'name').text.should_not == nil
+        (profile/'name').text.should_not == ''
+      end
+    end
+
+    def test_03_each_hardware_profile_has_correct_properties
+      get_auth_url '/api;driver=rhevm/hardware_profiles'
+      (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
+        (profile/'property[@name="architecture"]').first[:value].should == 'x86_64'
+        (profile/'property[@name="memory"]').first[:unit].should == 'MB'
+        (profile/'property[@name="memory"]').first[:kind].should == 'range'
+        (profile/'property[@name="storage"]').first[:unit].should == 'GB'
+        (profile/'property[@name="storage"]').first[:kind].should == 'range'
+      end
+    end
+
+    def test_04_it_returns_single_hardware_profile
+      get_auth_url '/api;driver=rhevm/hardware_profiles/DESKTOP'
+      (last_xml_response/'hardware_profile/name').first.text.should == 'DESKTOP'
+      (last_xml_response/'hardware_profile/property[@name="architecture"]').first[:value].should
== 'x86_64'
+      (last_xml_response/'hardware_profile/property[@name="memory"]').first[:value].should
== '512'
+      (last_xml_response/'hardware_profile/property[@name="storage"]').first[:value].should
== '1'
+    end
+
+    def test_05_it_filter_hardware_profiles
+      get_auth_url '/api;driver=rhevm/hardware_profiles?architecture=i386'
+      (last_xml_response/'hardware_profiles/hardware_profile').length.should == 0
+      get_auth_url '/api;driver=rhevm/hardware_profiles?architecture=x86_64'
+      (last_xml_response/'hardware_profiles/hardware_profile').length.should == 2
+    end
+
+  end
+end

Added: incubator/deltacloud/trunk/server/tests/drivers/rhevm/images_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/drivers/rhevm/images_test.rb?rev=1090287&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/tests/drivers/rhevm/images_test.rb (added)
+++ incubator/deltacloud/trunk/server/tests/drivers/rhevm/images_test.rb Fri Apr  8 15:04:27
2011
@@ -0,0 +1,42 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RHEVMTest
+
+  class ImagesTest < Test::Unit::TestCase
+    include Rack::Test::Methods
+
+    def app
+      Sinatra::Application
+    end
+
+    def test_01_it_returns_images
+      get_auth_url '/api;driver=rhevm/images'
+      (last_xml_response/'images/image').length.should > 0
+    end
+
+    def test_02_each_image_has_correct_properties
+      get_auth_url '/api;driver=rhevm/images'
+      (last_xml_response/'images/image').each do |image|
+        (image/'name').should_not == nil
+        (image/'name').should_not == ''
+        (image/'description').should_not == nil
+        (image/'description').should_not == ''
+        (image/'architecture').should_not == nil
+        (image/'architecture').should_not == ''
+        (image/'state').text.should == 'OK'
+        (image/'owner_id').text.should == ENV['API_USER']
+        (image/'actions/link').length.should == 1
+        (image/'actions/link').first[:rel].should == 'create_instance'
+      end
+    end
+
+    def test_03_it_returns_single_image
+      get_auth_url '/api;driver=rhevm/images/bb2e79bd-fd73-46a1-b391-a390b1998f03'
+      (last_xml_response/'image').length.should == 1
+      (last_xml_response/'image/name').text.should == 'F14-Minimal-Srv'
+      (last_xml_response/'image/state').text.should == 'OK'
+    end
+
+  end
+end

Added: incubator/deltacloud/trunk/server/tests/drivers/rhevm/instances_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/drivers/rhevm/instances_test.rb?rev=1090287&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/tests/drivers/rhevm/instances_test.rb (added)
+++ incubator/deltacloud/trunk/server/tests/drivers/rhevm/instances_test.rb Fri Apr  8 15:04:27
2011
@@ -0,0 +1,162 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RHEVMTest
+
+  class InstancesTest < Test::Unit::TestCase
+    include Rack::Test::Methods
+
+    def app
+      Sinatra::Application
+    end
+
+    def test_01_01_it_can_create_instance_without_hardware_profile
+      params = {
+        :image_id => 'bb2e79bd-fd73-46a1-b391-a390b1998f03',
+        :name => 'mock-test1',
+        :'api[driver]' => 'rhevm',
+      }
+      post_url '/api/instances', params
+      last_response.status.should == 201 # Created
+      @@instance = last_xml_response
+      (@@instance/'instance').length.should > 0
+      (@@instance/'instance/name').first.text.should_not == nil
+      (@@instance/'instance/name').first.text.should == 'mock-test1'
+      (@@instance/'instance/owner_id').first.text.should_not == ''
+      (@@instance/'instance/owner_id').first.text.should == ENV['API_USER']
+      (@@instance/'instance/state').first.text.should == 'STOPPED'
+    end
+
+    def test_01_02_it_can_create_instance_with_hardware_profile
+      params = {
+        :image_id => 'bb2e79bd-fd73-46a1-b391-a390b1998f03',
+        :name => 'mock-test2',
+        :hwp_id => 'SERVER',
+        :'api[driver]' => 'rhevm',
+      }
+      post_url '/api/instances', params
+      last_response.status.should == 201 # Created
+      @@instance2 = last_xml_response
+      (@@instance2/'instance').length.should > 0
+      (@@instance2/'instance/name').first.text.should_not == nil
+      (@@instance2/'instance/name').first.text.should == 'mock-test2'
+      (@@instance2/'instance/owner_id').first.text.should_not == ''
+      (@@instance2/'instance/owner_id').first.text.should == ENV['API_USER']
+      (@@instance2/'instance/state').first.text.should == 'STOPPED'
+    end
+
+    def test_03_02_created_instance_has_correct_hardware_profile
+      (@@instance2/'instance/hardware_profile').length.should == 1
+      (@@instance2/'instance/hardware_profile').first[:id].should == "SERVER"
+      (@@instance2/'instance/hardware_profile').first[:href].should_not == nil
+    end
+
+    def test_03_01_instance_can_be_started
+      params = {
+        :'api[driver]' => 'rhevm'
+      }
+      post_url "/api/instances/#{(@@instance/'instance').first[:id]}/start", params
+      last_response.status.should == 204
+    end
+
+    def test_04_01_created_instance_goes_to_running_state
+      20.times do |tick|
+        get_auth_url "/api;driver=rhevm/instances/#{(@@instance/'instance').first[:id]}",
{ :tick => tick}
+        last_response.status.should_not == 500
+        state = (last_xml_response/'instance/state').first.text
+        break if state=='RUNNING'
+        sleep(5)
+      end
+      @@instance = last_xml_response
+      get_auth_url "/api;driver=rhevm/instances/#{(@@instance/'instance').first[:id]}"
+      last_response.status.should_not == 500
+      (last_xml_response/'instance/state').first.text.should == 'RUNNING'
+      (last_xml_response/'instance/actions/link[@rel="reboot"]').first.should_not == nil
+      (last_xml_response/'instance/actions/link[@rel="stop"]').first.should_not == nil
+    end
+
+    def test_03_02_instance_can_be_started
+      params = {
+        :'api[driver]' => 'rhevm'
+      }
+      post_url "/api/instances/#{(@@instance2/'instance').first[:id]}/start", params
+      last_response.status.should == 204
+    end
+
+    def test_04_02_created_instance_goes_to_running_state
+      20.times do |tick|
+        get_auth_url "/api;driver=rhevm/instances/#{(@@instance2/'instance').first[:id]}",
{ :tick => tick}
+        last_response.status.should_not == 500
+        state = (last_xml_response/'instance/state').first.text
+        break if state=='RUNNING'
+        sleep(5)
+      end
+      @@instance2 = last_xml_response
+      get_auth_url "/api;driver=rhevm/instances/#{(@@instance2/'instance').first[:id]}"
+      last_response.status.should_not == 500
+      (last_xml_response/'instance/state').first.text.should == 'RUNNING'
+      (last_xml_response/'instance/actions/link[@rel="reboot"]').first.should_not == nil
+      (last_xml_response/'instance/actions/link[@rel="stop"]').first.should_not == nil
+    end
+
+    def test_05_01_created_instance_can_be_stopped
+      params = {
+        :'api[driver]' => 'rhevm',
+      }
+      post_url "/api/instances/#{(@@instance/'instance').first[:id]}/stop", params
+      last_response.status.should == 204
+      20.times do |tick|
+        get_auth_url "/api;driver=rhevm/instances/#{(@@instance/'instance').first[:id]}",
{ :tick => tick}
+        last_response.status.should_not == 500
+        state = (last_xml_response/'instance/state').first.text
+        break if state=='STOPPED'
+        sleep(5)
+      end
+    end
+
+    def test_05_02_created_instance_can_be_stopped
+      params = {
+        :'api[driver]' => 'rhevm',
+      }
+      post_url "/api/instances/#{(@@instance2/'instance').first[:id]}/stop", params
+      last_response.status.should == 204
+      20.times do |tick|
+        get_auth_url "/api;driver=rhevm/instances/#{(@@instance2/'instance').first[:id]}",
{ :tick => tick}
+        last_response.status.should_not == 500
+        state = (last_xml_response/'instance/state').first.text
+        break if state=='STOPPED'
+        sleep(5)
+      end
+    end
+
+    def test_06_01_created_instance_can_be_destroyed
+      params = {
+        :'api[driver]' => 'rhevm',
+      }
+      delete_url "/api/instances/#{(@@instance/'instance').first[:id]}", params
+      last_response.status.should == 204
+      20.times do |tick|
+        get_auth_url "/api;driver=rhevm/instances/#{(@@instance/'instance').first[:id]}",
{ :tick => tick}
+        last_response.status.should_not == 500
+        break if last_response.status == 404
+        sleep(5)
+      end
+      last_response.status.should == 404
+    end
+
+    def test_06_02_created_instance_can_be_destroyed
+      params = {
+        :'api[driver]' => 'rhevm',
+      }
+      delete_url "/api/instances/#{(@@instance2/'instance').first[:id]}", params, authenticate
+      last_response.status.should == 204
+      20.times do |tick|
+        get_auth_url "/api;driver=rhevm/instances/#{(@@instance2/'instance').first[:id]}",
{ :tick => tick}
+        last_response.status.should_not == 500
+        break if last_response.status == 404
+        sleep(5)
+      end
+      last_response.status.should == 404
+    end
+  end
+end

Added: incubator/deltacloud/trunk/server/tests/drivers/rhevm/realms_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/drivers/rhevm/realms_test.rb?rev=1090287&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/tests/drivers/rhevm/realms_test.rb (added)
+++ incubator/deltacloud/trunk/server/tests/drivers/rhevm/realms_test.rb Fri Apr  8 15:04:27
2011
@@ -0,0 +1,35 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RHEVMTest
+
+  class RealmsTest < Test::Unit::TestCase
+    include Rack::Test::Methods
+
+    def app
+      Sinatra::Application
+    end
+
+    def test_01_it_returns_realms
+      get_auth_url '/api;driver=rhevm/realms'
+      (last_xml_response/'realms/realm').length.should == 1
+    end
+
+    def test_02_each_realm_has_a_name
+      get_auth_url '/api;driver=rhevm/realms'
+      (last_xml_response/'realms/realm').each do |profile|
+        (profile/'name').text.should_not == nil
+        (profile/'name').text.should_not == ''
+        (profile/'name').text.should == 'Default'
+      end
+    end
+
+    def test_03_it_returns_single_realm
+      get_auth_url '/api;driver=rhevm/realms/us'
+      (last_xml_response/'realm').first[:id].should == '0'
+      (last_xml_response/'realm/name').first.text.should == 'Default'
+      (last_xml_response/'realm/state').first.text.should == 'AVAILABLE'
+    end
+
+  end
+end

Added: incubator/deltacloud/trunk/server/tests/drivers/rhevm/setup.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/drivers/rhevm/setup.rb?rev=1090287&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/tests/drivers/rhevm/setup.rb (added)
+++ incubator/deltacloud/trunk/server/tests/drivers/rhevm/setup.rb Fri Apr  8 15:04:27 2011
@@ -0,0 +1,14 @@
+ENV['API_USER']     = 'rhev-m@deltacloud.local'
+ENV['API_PASSWORD'] = 'RedHat001'
+ENV['API_PROVIDER'] = 'https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell'
+
+require 'vcr'
+
+DeltacloudTestCommon::record!
+
+VCR.config do |c|
+  c.cassette_library_dir = 'tests/drivers/rhevm/fixtures/'
+  c.stub_with :webmock
+  c.default_cassette_options = { :record => :new_episodes }
+end
+



Mime
View raw message