You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/03/26 18:57:51 UTC
[05/30] Client: Added VCR fixtures for testing
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0439fc75/client/tests/fixtures/test_0009_support_start_instance.yml
----------------------------------------------------------------------
diff --git a/client/tests/fixtures/test_0009_support_start_instance.yml b/client/tests/fixtures/test_0009_support_start_instance.yml
new file mode 100644
index 0000000..bd19a84
--- /dev/null
+++ b/client/tests/fixtures/test_0009_support_start_instance.yml
@@ -0,0 +1,217 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://localhost:3001/api
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 200
+ message:
+ headers:
+ content-type:
+ - application/xml
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1368'
+ x-content-type-options:
+ - nosniff
+ etag:
+ - e43d25244dc2b8ce1da6fa91131507ee
+ cache-control:
+ - max-age=0, private, must-revalidate
+ date:
+ - Wed, 06 Mar 2013 08:56:18 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<api driver='mock' version='1.1.1'>\n <link href='http://localhost:3001/api/instance_states'
+ rel='instance_states'>\n </link>\n <link href='http://localhost:3001/api/storage_volumes'
+ rel='storage_volumes'>\n </link>\n <link href='http://localhost:3001/api/metrics'
+ rel='metrics'>\n </link>\n <link href='http://localhost:3001/api/hardware_profiles'
+ rel='hardware_profiles'>\n </link>\n <link href='http://localhost:3001/api/instances'
+ rel='instances'>\n <feature name='metrics' rel='create'>\n <param
+ name='metrics' />\n </feature>\n <feature name='realm_filter' rel='index'>\n
+ \ <param name='realm_id' />\n </feature>\n <feature name='user_name'
+ rel='create'>\n <param name='name' />\n </feature>\n <feature name='authentication_key'
+ rel='create'>\n <param name='keyname' />\n </feature>\n </link>\n
+ \ <link href='http://localhost:3001/api/realms' rel='realms'>\n </link>\n
+ \ <link href='http://localhost:3001/api/storage_snapshots' rel='storage_snapshots'>\n
+ \ </link>\n <link href='http://localhost:3001/api/images' rel='images'>\n
+ \ </link>\n <link href='http://localhost:3001/api/addresses' rel='addresses'>\n
+ \ </link>\n <link href='http://localhost:3001/api/drivers' rel='drivers'>\n
+ \ </link>\n <link href='http://localhost:3001/api/buckets' rel='buckets'>\n
+ \ </link>\n <link href='http://localhost:3001/api/keys' rel='keys'>\n </link>\n</api>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:18 GMT
+- request:
+ method: post
+ uri: http://localhost:3001/api/instances?image_id=img1
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 201
+ message:
+ headers:
+ content-type:
+ - application/xml
+ location:
+ - http://localhost:3001/api/instances/inst14
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1175'
+ x-content-type-options:
+ - nosniff
+ etag:
+ - 846e96034593a904f856ed5c0ef1ba97
+ cache-control:
+ - max-age=0, private, must-revalidate
+ date:
+ - Wed, 06 Mar 2013 08:56:18 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<?xml version='1.0' encoding='utf-8' ?>\n<instance href='http://localhost:3001/api/instances/inst14'
+ id='inst14'>\n <name>i-1362560178</name>\n <owner_id>mockuser</owner_id>\n
+ \ <image href='http://localhost:3001/api/images/img1' id='img1'></image>\n
+ \ <realm href='http://localhost:3001/api/realms/us' id='us'></realm>\n <state>RUNNING</state>\n
+ \ <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1-small'
+ id='m1-small'>\n </hardware_profile>\n <actions>\n <link href='http://localhost:3001/api/instances/inst14/reboot'
+ method='post' rel='reboot' />\n <link href='http://localhost:3001/api/instances/inst14/stop'
+ method='post' rel='stop' />\n <link href='http://localhost:3001/api/instances/inst14/run;id=inst14'
+ method='post' rel='run' />\n <link href='http://localhost:3001/api/images;instance_id=inst14'
+ method='post' rel='create_image' />\n </actions>\n <public_addresses><address
+ type='hostname'>img1.inst14.public.com</address></public_addresses>\n <private_addresses><address
+ type='hostname'>img1.inst14.private.com</address></private_addresses>\n <storage_volumes></storage_volumes>\n
+ \ <authentication type='key'>\n </authentication>\n</instance>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:18 GMT
+- request:
+ method: post
+ uri: http://localhost:3001/api/instances/inst14/stop
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 202
+ message:
+ headers:
+ content-type:
+ - application/xml
+ x-backend-runtime:
+ - '0.0021376609802246094'
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1173'
+ x-content-type-options:
+ - nosniff
+ date:
+ - Wed, 06 Mar 2013 08:56:18 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<?xml version='1.0' encoding='utf-8' ?>\n<instance href='http://localhost:3001/api/instances/inst14'
+ id='inst14'>\n <name>i-1362560178</name>\n <owner_id>mockuser</owner_id>\n
+ \ <image href='http://localhost:3001/api/images/img1' id='img1'></image>\n
+ \ <realm href='http://localhost:3001/api/realms/us' id='us'></realm>\n <state>STOPPED</state>\n
+ \ <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1-small'
+ id='m1-small'>\n </hardware_profile>\n <actions>\n <link href='http://localhost:3001/api/instances/inst14/start'
+ method='post' rel='start' />\n <link href='http://localhost:3001/api/instances/inst14'
+ method='delete' rel='destroy' />\n <link href='http://localhost:3001/api/instances/inst14/run;id=inst14'
+ method='post' rel='run' />\n <link href='http://localhost:3001/api/images;instance_id=inst14'
+ method='post' rel='create_image' />\n </actions>\n <public_addresses><address
+ type='hostname'>img1.inst14.public.com</address></public_addresses>\n <private_addresses><address
+ type='hostname'>img1.inst14.private.com</address></private_addresses>\n <storage_volumes></storage_volumes>\n
+ \ <authentication type='key'>\n </authentication>\n</instance>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:18 GMT
+- request:
+ method: post
+ uri: http://localhost:3001/api/instances/inst14/start
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 202
+ message:
+ headers:
+ content-type:
+ - application/xml
+ x-backend-runtime:
+ - '0.001978158950805664'
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1175'
+ x-content-type-options:
+ - nosniff
+ date:
+ - Wed, 06 Mar 2013 08:56:18 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<?xml version='1.0' encoding='utf-8' ?>\n<instance href='http://localhost:3001/api/instances/inst14'
+ id='inst14'>\n <name>i-1362560178</name>\n <owner_id>mockuser</owner_id>\n
+ \ <image href='http://localhost:3001/api/images/img1' id='img1'></image>\n
+ \ <realm href='http://localhost:3001/api/realms/us' id='us'></realm>\n <state>RUNNING</state>\n
+ \ <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1-small'
+ id='m1-small'>\n </hardware_profile>\n <actions>\n <link href='http://localhost:3001/api/instances/inst14/reboot'
+ method='post' rel='reboot' />\n <link href='http://localhost:3001/api/instances/inst14/stop'
+ method='post' rel='stop' />\n <link href='http://localhost:3001/api/instances/inst14/run;id=inst14'
+ method='post' rel='run' />\n <link href='http://localhost:3001/api/images;instance_id=inst14'
+ method='post' rel='create_image' />\n </actions>\n <public_addresses><address
+ type='hostname'>img1.inst14.public.com</address></public_addresses>\n <private_addresses><address
+ type='hostname'>img1.inst14.private.com</address></private_addresses>\n <storage_volumes></storage_volumes>\n
+ \ <authentication type='key'>\n </authentication>\n</instance>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:18 GMT
+recorded_with: VCR 2.4.0
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0439fc75/client/tests/fixtures/test_0009_supports_features.yml
----------------------------------------------------------------------
diff --git a/client/tests/fixtures/test_0009_supports_features.yml b/client/tests/fixtures/test_0009_supports_features.yml
new file mode 100644
index 0000000..c7191f8
--- /dev/null
+++ b/client/tests/fixtures/test_0009_supports_features.yml
@@ -0,0 +1,60 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://localhost:3001/api
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 200
+ message:
+ headers:
+ content-type:
+ - application/xml
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1368'
+ x-content-type-options:
+ - nosniff
+ etag:
+ - e43d25244dc2b8ce1da6fa91131507ee
+ cache-control:
+ - max-age=0, private, must-revalidate
+ date:
+ - Wed, 06 Mar 2013 08:56:15 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<api driver='mock' version='1.1.1'>\n <link href='http://localhost:3001/api/instance_states'
+ rel='instance_states'>\n </link>\n <link href='http://localhost:3001/api/storage_volumes'
+ rel='storage_volumes'>\n </link>\n <link href='http://localhost:3001/api/metrics'
+ rel='metrics'>\n </link>\n <link href='http://localhost:3001/api/hardware_profiles'
+ rel='hardware_profiles'>\n </link>\n <link href='http://localhost:3001/api/instances'
+ rel='instances'>\n <feature name='metrics' rel='create'>\n <param
+ name='metrics' />\n </feature>\n <feature name='realm_filter' rel='index'>\n
+ \ <param name='realm_id' />\n </feature>\n <feature name='user_name'
+ rel='create'>\n <param name='name' />\n </feature>\n <feature name='authentication_key'
+ rel='create'>\n <param name='keyname' />\n </feature>\n </link>\n
+ \ <link href='http://localhost:3001/api/realms' rel='realms'>\n </link>\n
+ \ <link href='http://localhost:3001/api/storage_snapshots' rel='storage_snapshots'>\n
+ \ </link>\n <link href='http://localhost:3001/api/images' rel='images'>\n
+ \ </link>\n <link href='http://localhost:3001/api/addresses' rel='addresses'>\n
+ \ </link>\n <link href='http://localhost:3001/api/drivers' rel='drivers'>\n
+ \ </link>\n <link href='http://localhost:3001/api/buckets' rel='buckets'>\n
+ \ </link>\n <link href='http://localhost:3001/api/keys' rel='keys'>\n </link>\n</api>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:15 GMT
+recorded_with: VCR 2.4.0
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0439fc75/client/tests/fixtures/test_0010_support_reboot_instance.yml
----------------------------------------------------------------------
diff --git a/client/tests/fixtures/test_0010_support_reboot_instance.yml b/client/tests/fixtures/test_0010_support_reboot_instance.yml
new file mode 100644
index 0000000..1afeabf
--- /dev/null
+++ b/client/tests/fixtures/test_0010_support_reboot_instance.yml
@@ -0,0 +1,166 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://localhost:3001/api
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 200
+ message:
+ headers:
+ content-type:
+ - application/xml
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1368'
+ x-content-type-options:
+ - nosniff
+ etag:
+ - e43d25244dc2b8ce1da6fa91131507ee
+ cache-control:
+ - max-age=0, private, must-revalidate
+ date:
+ - Wed, 06 Mar 2013 08:56:17 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<api driver='mock' version='1.1.1'>\n <link href='http://localhost:3001/api/instance_states'
+ rel='instance_states'>\n </link>\n <link href='http://localhost:3001/api/storage_volumes'
+ rel='storage_volumes'>\n </link>\n <link href='http://localhost:3001/api/metrics'
+ rel='metrics'>\n </link>\n <link href='http://localhost:3001/api/hardware_profiles'
+ rel='hardware_profiles'>\n </link>\n <link href='http://localhost:3001/api/instances'
+ rel='instances'>\n <feature name='metrics' rel='create'>\n <param
+ name='metrics' />\n </feature>\n <feature name='realm_filter' rel='index'>\n
+ \ <param name='realm_id' />\n </feature>\n <feature name='user_name'
+ rel='create'>\n <param name='name' />\n </feature>\n <feature name='authentication_key'
+ rel='create'>\n <param name='keyname' />\n </feature>\n </link>\n
+ \ <link href='http://localhost:3001/api/realms' rel='realms'>\n </link>\n
+ \ <link href='http://localhost:3001/api/storage_snapshots' rel='storage_snapshots'>\n
+ \ </link>\n <link href='http://localhost:3001/api/images' rel='images'>\n
+ \ </link>\n <link href='http://localhost:3001/api/addresses' rel='addresses'>\n
+ \ </link>\n <link href='http://localhost:3001/api/drivers' rel='drivers'>\n
+ \ </link>\n <link href='http://localhost:3001/api/buckets' rel='buckets'>\n
+ \ </link>\n <link href='http://localhost:3001/api/keys' rel='keys'>\n </link>\n</api>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:17 GMT
+- request:
+ method: post
+ uri: http://localhost:3001/api/instances?image_id=img1
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 201
+ message:
+ headers:
+ content-type:
+ - application/xml
+ location:
+ - http://localhost:3001/api/instances/inst12
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1175'
+ x-content-type-options:
+ - nosniff
+ etag:
+ - 45aa1a1069561afacf53bfa0617937c2
+ cache-control:
+ - max-age=0, private, must-revalidate
+ date:
+ - Wed, 06 Mar 2013 08:56:17 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<?xml version='1.0' encoding='utf-8' ?>\n<instance href='http://localhost:3001/api/instances/inst12'
+ id='inst12'>\n <name>i-1362560177</name>\n <owner_id>mockuser</owner_id>\n
+ \ <image href='http://localhost:3001/api/images/img1' id='img1'></image>\n
+ \ <realm href='http://localhost:3001/api/realms/us' id='us'></realm>\n <state>RUNNING</state>\n
+ \ <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1-small'
+ id='m1-small'>\n </hardware_profile>\n <actions>\n <link href='http://localhost:3001/api/instances/inst12/reboot'
+ method='post' rel='reboot' />\n <link href='http://localhost:3001/api/instances/inst12/stop'
+ method='post' rel='stop' />\n <link href='http://localhost:3001/api/instances/inst12/run;id=inst12'
+ method='post' rel='run' />\n <link href='http://localhost:3001/api/images;instance_id=inst12'
+ method='post' rel='create_image' />\n </actions>\n <public_addresses><address
+ type='hostname'>img1.inst12.public.com</address></public_addresses>\n <private_addresses><address
+ type='hostname'>img1.inst12.private.com</address></private_addresses>\n <storage_volumes></storage_volumes>\n
+ \ <authentication type='key'>\n </authentication>\n</instance>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:17 GMT
+- request:
+ method: post
+ uri: http://localhost:3001/api/instances/inst12/reboot
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 202
+ message:
+ headers:
+ content-type:
+ - application/xml
+ x-backend-runtime:
+ - '0.0019261837005615234'
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1175'
+ x-content-type-options:
+ - nosniff
+ date:
+ - Wed, 06 Mar 2013 08:56:17 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<?xml version='1.0' encoding='utf-8' ?>\n<instance href='http://localhost:3001/api/instances/inst12'
+ id='inst12'>\n <name>i-1362560177</name>\n <owner_id>mockuser</owner_id>\n
+ \ <image href='http://localhost:3001/api/images/img1' id='img1'></image>\n
+ \ <realm href='http://localhost:3001/api/realms/us' id='us'></realm>\n <state>RUNNING</state>\n
+ \ <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1-small'
+ id='m1-small'>\n </hardware_profile>\n <actions>\n <link href='http://localhost:3001/api/instances/inst12/reboot'
+ method='post' rel='reboot' />\n <link href='http://localhost:3001/api/instances/inst12/stop'
+ method='post' rel='stop' />\n <link href='http://localhost:3001/api/instances/inst12/run;id=inst12'
+ method='post' rel='run' />\n <link href='http://localhost:3001/api/images;instance_id=inst12'
+ method='post' rel='create_image' />\n </actions>\n <public_addresses><address
+ type='hostname'>img1.inst12.public.com</address></public_addresses>\n <private_addresses><address
+ type='hostname'>img1.inst12.private.com</address></private_addresses>\n <storage_volumes></storage_volumes>\n
+ \ <authentication type='key'>\n </authentication>\n</instance>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:17 GMT
+recorded_with: VCR 2.4.0
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/0439fc75/client/tests/fixtures/test_0010_supports_feature_.yml
----------------------------------------------------------------------
diff --git a/client/tests/fixtures/test_0010_supports_feature_.yml b/client/tests/fixtures/test_0010_supports_feature_.yml
new file mode 100644
index 0000000..c7191f8
--- /dev/null
+++ b/client/tests/fixtures/test_0010_supports_feature_.yml
@@ -0,0 +1,60 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://localhost:3001/api
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - application/xml
+ Authorization:
+ - Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
+ User-Agent:
+ - Faraday v0.8.6
+ response:
+ status:
+ code: 200
+ message:
+ headers:
+ content-type:
+ - application/xml
+ server:
+ - Apache-Deltacloud/1.1.1
+ x-deltacloud-driver:
+ - mock
+ content-length:
+ - '1368'
+ x-content-type-options:
+ - nosniff
+ etag:
+ - e43d25244dc2b8ce1da6fa91131507ee
+ cache-control:
+ - max-age=0, private, must-revalidate
+ date:
+ - Wed, 06 Mar 2013 08:56:15 GMT
+ connection:
+ - close
+ body:
+ encoding: US-ASCII
+ string: ! "<api driver='mock' version='1.1.1'>\n <link href='http://localhost:3001/api/instance_states'
+ rel='instance_states'>\n </link>\n <link href='http://localhost:3001/api/storage_volumes'
+ rel='storage_volumes'>\n </link>\n <link href='http://localhost:3001/api/metrics'
+ rel='metrics'>\n </link>\n <link href='http://localhost:3001/api/hardware_profiles'
+ rel='hardware_profiles'>\n </link>\n <link href='http://localhost:3001/api/instances'
+ rel='instances'>\n <feature name='metrics' rel='create'>\n <param
+ name='metrics' />\n </feature>\n <feature name='realm_filter' rel='index'>\n
+ \ <param name='realm_id' />\n </feature>\n <feature name='user_name'
+ rel='create'>\n <param name='name' />\n </feature>\n <feature name='authentication_key'
+ rel='create'>\n <param name='keyname' />\n </feature>\n </link>\n
+ \ <link href='http://localhost:3001/api/realms' rel='realms'>\n </link>\n
+ \ <link href='http://localhost:3001/api/storage_snapshots' rel='storage_snapshots'>\n
+ \ </link>\n <link href='http://localhost:3001/api/images' rel='images'>\n
+ \ </link>\n <link href='http://localhost:3001/api/addresses' rel='addresses'>\n
+ \ </link>\n <link href='http://localhost:3001/api/drivers' rel='drivers'>\n
+ \ </link>\n <link href='http://localhost:3001/api/buckets' rel='buckets'>\n
+ \ </link>\n <link href='http://localhost:3001/api/keys' rel='keys'>\n </link>\n</api>\n"
+ http_version:
+ recorded_at: Wed, 06 Mar 2013 08:56:15 GMT
+recorded_with: VCR 2.4.0