deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [7/31] git commit: Deprecates old driver-specific cucumber tests and features
Date Wed, 25 Jul 2012 13:56:38 GMT
Deprecates old driver-specific cucumber tests and features


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/a53f9b4b
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/a53f9b4b
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/a53f9b4b

Branch: refs/heads/master
Commit: a53f9b4b9a2076abff906ff321ab56e34024985c
Parents: fef23f9
Author: marios <marios@redhat.com>
Authored: Fri Jul 20 19:43:44 2012 +0300
Committer: marios <marios@redhat.com>
Committed: Tue Jul 24 12:01:36 2012 +0300

----------------------------------------------------------------------
 tests/deprecated/README                            |    6 +
 tests/deprecated/ec2/api.feature                   |   65 +
 tests/deprecated/ec2/hardware_profiles.feature     |   29 +
 tests/deprecated/ec2/images.feature                |   63 +
 tests/deprecated/ec2/instance_states.feature       |   36 +
 tests/deprecated/ec2/instances.feature             |  170 +++
 tests/deprecated/ec2/keys.feature                  |   55 +
 tests/deprecated/ec2/realms.feature                |   27 +
 tests/deprecated/ec2/step_definitions/api_steps.rb |  157 +++
 .../step_definitions/hardware_profiles_steps.rb    |   25 +
 .../ec2/step_definitions/images_steps.rb           |   81 ++
 .../ec2/step_definitions/instance_states_steps.rb  |   34 +
 .../ec2/step_definitions/instances_steps.rb        |  159 +++
 .../deprecated/ec2/step_definitions/keys_steps.rb  |   60 +
 .../deprecated/ec2/step_definitions/rake_steps.rb  |   19 +
 .../ec2/step_definitions/storage_volumes_steps.rb  |   90 ++
 tests/deprecated/ec2/storage_volumes.feature       |   52 +
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   48 +
 ...volume.02b8ed437c66c556e77e4b7813a2ae5043c68a8f |    4 +
 ..._owner.ffb952b433edf7fe6cb4e04c86f82ac9ce0faa51 |  927 +++++++++++++++
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   36 +
 ...tances.378a10da4274bad1f6351b08d0168a5b65a85aaf |   13 +
 ...volume.a4845bca9d929ab74a5a42691c1d2484ea6b4034 |    3 +
 ..._owner.ffb952b433edf7fe6cb4e04c86f82ac9ce0faa51 |  927 +++++++++++++++
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   31 +
 ...olumes.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   10 +
 ...y_pair.62cbf61fbce67eeb64a226a50e1cb41fc80fc6fd |   40 +
 ...tances.c4b6748639aec6ee0563714c9b6663e90253577b |   13 +
 ..._zones.da39a3ee5e6b4b0d3255bfef95601890afd80709 |    5 +
 ..._zones.fe7704c2394fbc2dd726f797e7080c707d4ee4a5 |    2 +
 ...images.b6822a0a41541a8dbabe1babc57ed0d4d37f3dbe |    7 +
 ...images.c4b6748639aec6ee0563714c9b6663e90253577b |    8 +
 ..._owner.12fef75ad6850ccb88e5261ab3b9906125134088 |   10 +
 ..._owner.ffb952b433edf7fe6cb4e04c86f82ac9ce0faa51 |  927 +++++++++++++++
 ...tances.182e6c7756332fe7efdc0f859e27632e2f01dc47 |   14 +
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   42 +
 ..._pairs.29f1306f3c32628192103d291b06fdd6213d1f20 |    3 +
 ..._pairs.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   82 ++
 ...olumes.64f65f4a7b5665ecd96359803f4354cc118776dd |    6 +
 ...olumes.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   12 +
 ...olumes.e3bd97aff62d5f6c7e157e9b722910eb09daf486 |    3 +
 ...olumes.eb6199d82eb26b3ffa00cccf5ab82ce8eecc1de9 |    6 +
 ...y_pair.2fadff67b41d6a6fd0a728f47a3312a5303f760c |    1 +
 ...tances.8702fc199a628a156f600c9fbd4c985b47a25762 |   17 +
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   49 +
 ..._pairs.2fadff67b41d6a6fd0a728f47a3312a5303f760c |    3 +
 ..._pairs.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   84 ++
 ...tances.8702fc199a628a156f600c9fbd4c985b47a25762 |    2 +
 ...output.182e6c7756332fe7efdc0f859e27632e2f01dc47 |   25 +
 ...tances.c4b6748639aec6ee0563714c9b6663e90253577b |   13 +
 ...tances.8702fc199a628a156f600c9fbd4c985b47a25762 |   17 +
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   48 +
 ...tances.8702fc199a628a156f600c9fbd4c985b47a25762 |    1 +
 ...tances.b5f0a55c4b7b77954ce958af619973e1764f1d5c |   13 +
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   48 +
 ...tances.b5f0a55c4b7b77954ce958af619973e1764f1d5c |    2 +
 tests/deprecated/ec2/support/ec2_mock_driver.rb    |   72 ++
 ...ancers.da39a3ee5e6b4b0d3255bfef95601890afd80709 |    5 +
 tests/deprecated/ec2/support/env.rb                |   59 +
 tests/deprecated/ec2/support/method_serializer.rb  |   83 ++
 ...uckets.da39a3ee5e6b4b0d3255bfef95601890afd80709 |    1 +
 tests/deprecated/mock/api.feature                  |   55 +
 tests/deprecated/mock/hardware_profiles.feature    |   29 +
 tests/deprecated/mock/images.feature               |   63 +
 tests/deprecated/mock/instance_states.feature      |   36 +
 tests/deprecated/mock/instances.feature            |  161 +++
 tests/deprecated/mock/realms.feature               |   27 +
 tests/deprecated/mock/respond_to.feature           |   71 ++
 .../deprecated/mock/step_definitions/api_steps.rb  |  152 +++
 .../step_definitions/hardware_profiles_steps.rb    |   25 +
 .../mock/step_definitions/images_steps.rb          |   83 ++
 .../mock/step_definitions/instance_states_steps.rb |   34 +
 .../mock/step_definitions/instances_steps.rb       |  120 ++
 .../deprecated/mock/step_definitions/rake_steps.rb |   19 +
 .../mock/step_definitions/respond_to_steps.rb      |   33 +
 tests/deprecated/mock/storage_snapshots.feature    |   27 +
 tests/deprecated/mock/storage_volumes.feature      |   44 +
 tests/deprecated/mock/support/env.rb               |   29 +
 tests/deprecated/rhevm/hardware_profiles.feature   |   34 +
 tests/deprecated/rhevm/images.feature              |   30 +
 tests/deprecated/rhevm/instances.feature           |   66 +
 tests/deprecated/rhevm/realms.feature              |   25 +
 .../step_definitions/hardware_profiles_steps.rb    |   82 ++
 .../rhevm/step_definitions/images_steps.rb         |   12 +
 .../rhevm/step_definitions/instances_steps.rb      |   55 +
 .../step_definitions/storage_volumes_steps.rb      |    4 +
 tests/deprecated/rhevm/storage_volumes.feature     |   28 +
 tests/deprecated/rhevm/support/env.rb              |   65 +
 .../05cb6c3cbcd67f935e8a3c8e94cac942.fixture       |    1 +
 .../18ec06387f4e0a980cbbbbedeee85d71.fixture       |    1 +
 .../32c55dd505856722696e5923cbde59b7.fixture       |    1 +
 .../530d1fad492a210b11e64a6714645727.fixture       |    1 +
 .../64ff6e46deac14db514471f2f0d1e48c.fixture       |    1 +
 .../7774dd583eb8e29229cb4f9e4f7dc10c.fixture       |    1 +
 .../7e8842773bdafb5d319076e1c2d28adb.fixture       |    1 +
 .../7fbe6810c9082b32ba685ad9afe7804c.fixture       |    1 +
 .../812b32fd276b1d09f3238088bc3a69a6.fixture       |    1 +
 .../9361e31db701da1105c6adb528e6dc61.fixture       |    1 +
 .../982d14009191fe725d6a18a96f397c83.fixture       |    1 +
 .../9b71abd5067c1079052d4c88f81f7f81.fixture       |    1 +
 .../b3374f5480b46b5751c5ae508b9c4914.fixture       |    1 +
 .../bebe17c656cd81972487b80da37f002e.fixture       |    1 +
 .../c02f885ab565fc077632ddda1b92db80.fixture       |    1 +
 .../c9a5c35d6c00ea0207e2faa354504a41.fixture       |    1 +
 .../d0a9e8781f9f06027b818c4cb6f612ae.fixture       |    1 +
 .../d281d71e7c066ae78c4a00da2066149a.fixture       |    1 +
 .../ee8de9dfd3d696e5bfc1537a6405aab1.fixture       |    1 +
 .../fb8424ef5b5bcaa21c59e124fe316c1c.fixture       |    1 +
 tests/deprecated/sbc/hardware_profile.feature      |   37 +
 tests/deprecated/sbc/images.feature                |   29 +
 tests/deprecated/sbc/instances.feature             |   45 +
 tests/deprecated/sbc/realms.feature                |   31 +
 .../sbc/step_definitions/common_steps.rb           |   77 ++
 .../sbc/step_definitions/images_steps.rb           |    7 +
 .../sbc/step_definitions/instances_steps.rb        |   26 +
 tests/deprecated/sbc/support/env.rb                |   49 +
 .../0d9cd0facc9d0b175788bf0967d00f4a.fixture       |    1 +
 .../2186a78c8079ee4b675bc1d6e75675ab.fixture       |    1 +
 .../291f0f35b96fa2b9e5cae3d1e5b89878.fixture       |    1 +
 .../8f56d1e1fc0703e54eaedf61057b936a.fixture       |    1 +
 .../f16b6558d39821a706056d936f3d6d90.fixture       |    1 +
 .../ff671e15c30a18a501dd6d4e6db77c9e.fixture       |    1 +
 tests/ec2/api.feature                              |   65 -
 tests/ec2/hardware_profiles.feature                |   29 -
 tests/ec2/images.feature                           |   63 -
 tests/ec2/instance_states.feature                  |   36 -
 tests/ec2/instances.feature                        |  170 ---
 tests/ec2/keys.feature                             |   55 -
 tests/ec2/realms.feature                           |   27 -
 tests/ec2/step_definitions/api_steps.rb            |  157 ---
 .../step_definitions/hardware_profiles_steps.rb    |   25 -
 tests/ec2/step_definitions/images_steps.rb         |   81 --
 .../ec2/step_definitions/instance_states_steps.rb  |   34 -
 tests/ec2/step_definitions/instances_steps.rb      |  159 ---
 tests/ec2/step_definitions/keys_steps.rb           |   60 -
 tests/ec2/step_definitions/rake_steps.rb           |   19 -
 .../ec2/step_definitions/storage_volumes_steps.rb  |   90 --
 tests/ec2/storage_volumes.feature                  |   52 -
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   48 -
 ...volume.02b8ed437c66c556e77e4b7813a2ae5043c68a8f |    4 -
 ..._owner.ffb952b433edf7fe6cb4e04c86f82ac9ce0faa51 |  927 ---------------
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   36 -
 ...tances.378a10da4274bad1f6351b08d0168a5b65a85aaf |   13 -
 ...volume.a4845bca9d929ab74a5a42691c1d2484ea6b4034 |    3 -
 ..._owner.ffb952b433edf7fe6cb4e04c86f82ac9ce0faa51 |  927 ---------------
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   31 -
 ...olumes.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   10 -
 ...y_pair.62cbf61fbce67eeb64a226a50e1cb41fc80fc6fd |   40 -
 ...tances.c4b6748639aec6ee0563714c9b6663e90253577b |   13 -
 ..._zones.da39a3ee5e6b4b0d3255bfef95601890afd80709 |    5 -
 ..._zones.fe7704c2394fbc2dd726f797e7080c707d4ee4a5 |    2 -
 ...images.b6822a0a41541a8dbabe1babc57ed0d4d37f3dbe |    7 -
 ...images.c4b6748639aec6ee0563714c9b6663e90253577b |    8 -
 ..._owner.12fef75ad6850ccb88e5261ab3b9906125134088 |   10 -
 ..._owner.ffb952b433edf7fe6cb4e04c86f82ac9ce0faa51 |  927 ---------------
 ...tances.182e6c7756332fe7efdc0f859e27632e2f01dc47 |   14 -
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   42 -
 ..._pairs.29f1306f3c32628192103d291b06fdd6213d1f20 |    3 -
 ..._pairs.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   82 --
 ...olumes.64f65f4a7b5665ecd96359803f4354cc118776dd |    6 -
 ...olumes.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   12 -
 ...olumes.e3bd97aff62d5f6c7e157e9b722910eb09daf486 |    3 -
 ...olumes.eb6199d82eb26b3ffa00cccf5ab82ce8eecc1de9 |    6 -
 ...y_pair.2fadff67b41d6a6fd0a728f47a3312a5303f760c |    1 -
 ...tances.8702fc199a628a156f600c9fbd4c985b47a25762 |   17 -
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   49 -
 ..._pairs.2fadff67b41d6a6fd0a728f47a3312a5303f760c |    3 -
 ..._pairs.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   84 --
 ...tances.8702fc199a628a156f600c9fbd4c985b47a25762 |    2 -
 ...output.182e6c7756332fe7efdc0f859e27632e2f01dc47 |   25 -
 ...tances.c4b6748639aec6ee0563714c9b6663e90253577b |   13 -
 ...tances.8702fc199a628a156f600c9fbd4c985b47a25762 |   17 -
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   48 -
 ...tances.8702fc199a628a156f600c9fbd4c985b47a25762 |    1 -
 ...tances.b5f0a55c4b7b77954ce958af619973e1764f1d5c |   13 -
 ...tances.da39a3ee5e6b4b0d3255bfef95601890afd80709 |   48 -
 ...tances.b5f0a55c4b7b77954ce958af619973e1764f1d5c |    2 -
 tests/ec2/support/ec2_mock_driver.rb               |   72 --
 ...ancers.da39a3ee5e6b4b0d3255bfef95601890afd80709 |    5 -
 tests/ec2/support/env.rb                           |   59 -
 tests/ec2/support/method_serializer.rb             |   83 --
 ...uckets.da39a3ee5e6b4b0d3255bfef95601890afd80709 |    1 -
 tests/mock/api.feature                             |   55 -
 tests/mock/hardware_profiles.feature               |   29 -
 tests/mock/images.feature                          |   63 -
 tests/mock/instance_states.feature                 |   36 -
 tests/mock/instances.feature                       |  161 ---
 tests/mock/realms.feature                          |   27 -
 tests/mock/respond_to.feature                      |   71 --
 tests/mock/step_definitions/api_steps.rb           |  152 ---
 .../step_definitions/hardware_profiles_steps.rb    |   25 -
 tests/mock/step_definitions/images_steps.rb        |   83 --
 .../mock/step_definitions/instance_states_steps.rb |   34 -
 tests/mock/step_definitions/instances_steps.rb     |  120 --
 tests/mock/step_definitions/rake_steps.rb          |   19 -
 tests/mock/step_definitions/respond_to_steps.rb    |   33 -
 tests/mock/storage_snapshots.feature               |   27 -
 tests/mock/storage_volumes.feature                 |   44 -
 tests/mock/support/env.rb                          |   29 -
 tests/rhevm/hardware_profiles.feature              |   34 -
 tests/rhevm/images.feature                         |   30 -
 tests/rhevm/instances.feature                      |   66 -
 tests/rhevm/realms.feature                         |   25 -
 .../step_definitions/hardware_profiles_steps.rb    |   82 --
 tests/rhevm/step_definitions/images_steps.rb       |   12 -
 tests/rhevm/step_definitions/instances_steps.rb    |   55 -
 .../step_definitions/storage_volumes_steps.rb      |    4 -
 tests/rhevm/storage_volumes.feature                |   28 -
 tests/rhevm/support/env.rb                         |   65 -
 .../05cb6c3cbcd67f935e8a3c8e94cac942.fixture       |    1 -
 .../18ec06387f4e0a980cbbbbedeee85d71.fixture       |    1 -
 .../32c55dd505856722696e5923cbde59b7.fixture       |    1 -
 .../530d1fad492a210b11e64a6714645727.fixture       |    1 -
 .../64ff6e46deac14db514471f2f0d1e48c.fixture       |    1 -
 .../7774dd583eb8e29229cb4f9e4f7dc10c.fixture       |    1 -
 .../7e8842773bdafb5d319076e1c2d28adb.fixture       |    1 -
 .../7fbe6810c9082b32ba685ad9afe7804c.fixture       |    1 -
 .../812b32fd276b1d09f3238088bc3a69a6.fixture       |    1 -
 .../9361e31db701da1105c6adb528e6dc61.fixture       |    1 -
 .../982d14009191fe725d6a18a96f397c83.fixture       |    1 -
 .../9b71abd5067c1079052d4c88f81f7f81.fixture       |    1 -
 .../b3374f5480b46b5751c5ae508b9c4914.fixture       |    1 -
 .../bebe17c656cd81972487b80da37f002e.fixture       |    1 -
 .../c02f885ab565fc077632ddda1b92db80.fixture       |    1 -
 .../c9a5c35d6c00ea0207e2faa354504a41.fixture       |    1 -
 .../d0a9e8781f9f06027b818c4cb6f612ae.fixture       |    1 -
 .../d281d71e7c066ae78c4a00da2066149a.fixture       |    1 -
 .../ee8de9dfd3d696e5bfc1537a6405aab1.fixture       |    1 -
 .../fb8424ef5b5bcaa21c59e124fe316c1c.fixture       |    1 -
 tests/sbc/hardware_profile.feature                 |   37 -
 tests/sbc/images.feature                           |   29 -
 tests/sbc/instances.feature                        |   45 -
 tests/sbc/realms.feature                           |   31 -
 tests/sbc/step_definitions/common_steps.rb         |   77 --
 tests/sbc/step_definitions/images_steps.rb         |    7 -
 tests/sbc/step_definitions/instances_steps.rb      |   26 -
 tests/sbc/support/env.rb                           |   49 -
 .../0d9cd0facc9d0b175788bf0967d00f4a.fixture       |    1 -
 .../2186a78c8079ee4b675bc1d6e75675ab.fixture       |    1 -
 .../291f0f35b96fa2b9e5cae3d1e5b89878.fixture       |    1 -
 .../8f56d1e1fc0703e54eaedf61057b936a.fixture       |    1 -
 .../f16b6558d39821a706056d936f3d6d90.fixture       |    1 -
 .../ff671e15c30a18a501dd6d4e6db77c9e.fixture       |    1 -
 243 files changed, 6586 insertions(+), 6580 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/README
----------------------------------------------------------------------
diff --git a/tests/deprecated/README b/tests/deprecated/README
new file mode 100644
index 0000000..2167c8f
--- /dev/null
+++ b/tests/deprecated/README
@@ -0,0 +1,6 @@
+The tests under this directory are no longer being used.
+
+In July 2012 it was decided to move to using MiniTest as
+the test suite for all our spec/unit tests.
+
+The cucumber features/step_definitions are kept here for reference.

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/api.feature
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/api.feature b/tests/deprecated/ec2/api.feature
new file mode 100644
index 0000000..1b12003
--- /dev/null
+++ b/tests/deprecated/ec2/api.feature
@@ -0,0 +1,65 @@
+Feature: Accessing API entry points
+
+  Scenario: API driver and version
+    Given URI /api exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get root element 'api'
+    And this element should have attribute 'driver' with value 'ec2'
+    And this element should have attribute 'version' with value '1.0.0'
+
+  Scenario: List of entry points
+    Given URI /api exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get list of valid entry points:
+    | realms     |
+    | instances  |
+    | keys  |
+    | buckets |
+    | images     |
+    | drivers |
+    | load_balancers |
+    | instance_states |
+    | hardware_profiles  |
+    | storage_snapshots  |
+    | storage_volumes    |
+    | addresses |
+    | firewalls |
+    | metrics |
+    And this URI should be available in XML, JSON, HTML format
+
+  Scenario: Following entry points
+    Given URI /api exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get list of valid entry points:
+    | realms     |
+    | instances  |
+    | keys  |
+    | buckets |
+    | drivers |
+    | images     |
+    | load_balancers |
+    | instance_states |
+    | hardware_profiles  |
+    | storage_snapshots  |
+    | storage_volumes    |
+    | addresses |
+    | firewalls |
+    | metrics |
+    And each link should have 'rel' attribute with valid name
+    And each link should have 'href' attribute with valid URL
+    When client follow this attribute
+    Then client should get a valid response
+
+  Scenario: Instance features
+    Given URI /api exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get list of features inside 'instances':
+    | authentication_key |
+    | attach_snapshot |
+    | user_data |
+    | instance_count |
+    | firewalls |

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/hardware_profiles.feature
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/hardware_profiles.feature b/tests/deprecated/ec2/hardware_profiles.feature
new file mode 100644
index 0000000..d42eba3
--- /dev/null
+++ b/tests/deprecated/ec2/hardware_profiles.feature
@@ -0,0 +1,29 @@
+Feature: Accessing hardware profiles
+
+  Scenario: I want to get list of all hardware profiles
+    Given URI /api/hardware_profiles exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get root element 'hardware_profiles'
+    And this URI should be available in XML, HTML, JSON format
+
+  Scenario: I want to show hardware profile details
+    Given URI /api/hardware_profiles exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get root element 'hardware_profiles'
+    When client want to show 'm1.small' hardware_profile
+    And client should get this hardware_profile
+    And it should have a href attribute
+    And it should have a fixed property 'cpu'
+    And it should have a fixed property 'memory'
+    And it should have a fixed property 'storage'
+    And this URI should be available in XML, HTML, JSON format
+
+  Scenario: Filtering images by architecture
+    Given URI /api/hardware_profiles exists
+    And authentification is required for this URI
+    When client access this URI with parameters:
+    | architecture | i386 |
+    Then client should get some hardware_profiles
+    And each hardware_profile should have 'architecture' property set to 'i386'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/images.feature
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/images.feature b/tests/deprecated/ec2/images.feature
new file mode 100644
index 0000000..139b385
--- /dev/null
+++ b/tests/deprecated/ec2/images.feature
@@ -0,0 +1,63 @@
+Feature: Listing and showing images
+
+  Scenario: Listing available images
+    Given URI /api/images exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'images'
+    And this element contains some images
+    And each image should have:
+    | name |
+    | description |
+    | architecture |
+    | owner_id |
+    | state |
+    | actions |
+    | hardware_profiles |
+    And each image should have 'href' attribute with valid URL
+    And this URI should be available in XML, JSON, HTML format
+
+  Scenario: Following image href attribute
+    Given URI /api/images exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'images'
+    And this element contains some images
+    When client want to show first image
+    Then client should follow href attribute in image
+    And client should get valid response with requested image
+    And this image should have:
+    | name |
+    | description |
+    | architecture |
+    | owner_id |
+    | state |
+    | actions |
+    | hardware_profiles |
+    And this URI should be available in XML, JSON, HTML format
+
+  Scenario: Filtering images by owner_id
+    Given URI /api/images exists
+    And authentification is required for this URI
+    When client access this URI with parameters:
+    | owner_id | 205605819716 |
+    Then client should get some images
+    And each image should have 'owner_id' element set to '205605819716'
+
+  Scenario: Filtering images by architecture
+    Given URI /api/images exists
+    And authentification is required for this URI
+    When client access this URI with parameters:
+    | architecture | i386 |
+    Then client should get some images
+    And each image should have 'architecture' element set to 'i386'
+
+  Scenario: Filtering images by architecture and owner_id
+    Given URI /api/images exists
+    And authentification is required for this URI
+    When client access this URI with parameters:
+    | architecture | i386 |
+    | owner_id | 205605819716 |
+    Then client should get some images
+    And each image should have 'architecture' element set to 'i386'
+    And each image should have 'owner_id' element set to '205605819716'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/instance_states.feature
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/instance_states.feature b/tests/deprecated/ec2/instance_states.feature
new file mode 100644
index 0000000..3008ef0
--- /dev/null
+++ b/tests/deprecated/ec2/instance_states.feature
@@ -0,0 +1,36 @@
+Feature: Instance states and transitions
+
+  Scenario: Getting list of states
+    Given URI /api/instance_states exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get root element 'states'
+    And this element contains some states
+    And this URI should be available in XML, JSON, HTML format
+
+
+  Scenario: State names
+    Given URI /api/instance_states exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get root element 'states'
+    And states element contains some states
+    And each state should have 'name' attribute
+    And first state should have 'name' attribute set to 'start'
+    And last state should have 'name' attribute set to 'finish'
+
+  Scenario: Transitions
+    Given URI /api/instance_states exists
+    And authentification is not required for this URI
+    When client access this URI
+    Then client should get root element 'states'
+    And states element contains some states
+    And some states should have transitions
+    And each transitions should have 'to' attribute
+
+  Scenario: State diagram
+    Given URI /api/instance_states exists
+    And authentification is not required for this URI
+    When client access this URI
+    And client wants PNG format
+    Then client should get PNG image

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/instances.feature
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/instances.feature b/tests/deprecated/ec2/instances.feature
new file mode 100644
index 0000000..1cf3134
--- /dev/null
+++ b/tests/deprecated/ec2/instances.feature
@@ -0,0 +1,170 @@
+Feature: Managing instances
+
+  @prefix-create
+  Scenario: Basic instance creation
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client want to create a new instance
+    Then client should choose first image
+    When client request for a new instance
+    Then new instance should be created
+    And this instance should have chosed image
+    And this instance should be in 'PENDING' state
+    And this instance should have valid id
+    And this instance should have name
+
+  @prefix-create-hwp
+  Scenario: Choosing hardware profile for instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client want to create a new instance
+    Then client should choose first image
+    And client choose first hardware profile
+    When client request for a new instance
+    Then new instance should be created
+    And this instance should have chosed image
+    And this instance should be in 'PENDING' state
+    And this instance should have valid id
+    And this instance should have last hardware profile
+    And this instance should have name
+
+  @prefix-create-public_ip
+  Scenario: Choosing public ip address for instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client want to create a new instance
+    Then client should choose first image
+    And client choose public IP address '184.73.218.247'
+    When client request for a new instance
+    Then new instance should be created
+    And this instance should have chosed image
+    And this instance should be in 'PENDING' state
+    And this instance should have valid id
+    And this instance should have name
+    And IP address for this instance should be '184.73.218.247'
+
+  Scenario: Listing current instances
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'instances'
+    And this element contains some instances
+    And each instance should have:
+    | name |
+    | authentication |
+    | launch_time |
+    | owner_id |
+    | image |
+    | firewalls |
+    | realm |
+    | state |
+    | hardware_profile |
+    | actions |
+    | public_addresses |
+    | private_addresses |
+    | storage_volumes |
+    And each instance should have 'href' attribute with valid URL
+    And this URI should be available in XML, JSON, HTML format
+
+  Scenario: Filtering instances by state
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI with parameters:
+    | state | RUNNING |
+    Then client should get some instances
+    And each instance should have 'state' element set to 'RUNNING'
+    And each instance should have address type set to "hostname"
+
+  Scenario: Get details about first instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'instances'
+    And this element contains some instances
+    When client want to show first instance
+    Then client follow href attribute in first instance
+    Then client should get this instance
+    And this instance should have:
+    | name |
+    | owner_id |
+    | image |
+    | firewalls |
+    | realm |
+    | state |
+    | hardware_profile |
+    | actions |
+    | public_addresses |
+    | private_addresses |
+    | storage_volumes |
+    | authentication |
+    | launch_time |
+
+  Scenario: Following image href in instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'instances'
+    And this element contains some instances
+    When client follow image href attribute in first instance
+    Then client should get valid image
+
+  Scenario: Following realm href in instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'instances'
+    And this element contains some instances
+    When client follow realm href attribute in first instance
+    Then client should get valid realm
+
+  Scenario: Following hardware profile href in instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'instances'
+    And this element contains some instances
+    When client follow hardware_profile href attribute in first instance
+    Then client should get valid hardware_profile
+
+  @prefix-actions
+  Scenario: Instance actions
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'instances'
+    And this element contains some instances
+    And each running instance should have actions
+    And each actions should have some links
+    And each link should have valid href attribute
+    And each link should have valid method attribute
+    And each link should have valid rel attribute
+
+  @prefix-reboot
+  Scenario: Reboot instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'instances'
+    And this element contains some instances
+    When client want to 'reboot' RUNNING instance
+    And client follow link in actions
+
+  @prefix-stop
+  Scenario: Stop instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'instances'
+    And this element contains some instances
+    When client want to 'stop' last instance
+    And client follow link in actions
+
+
+  @prefix-destroy
+  Scenario: Destroying created instance
+    Given URI /api/instances exists
+    And authentification is required for this URI
+    When client want to 'stop' RUNNING instance
+    And client follow link in actions
+    Then client should get created instance
+    And this instance should be destroyed

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/keys.feature
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/keys.feature b/tests/deprecated/ec2/keys.feature
new file mode 100644
index 0000000..c9101b5
--- /dev/null
+++ b/tests/deprecated/ec2/keys.feature
@@ -0,0 +1,55 @@
+Feature: Managing keys
+
+  Scenario: Basic key creation
+    Given URI /api/keys exists
+    And authentification is required for this URI
+    When client want to create a new key
+    Then client should choose name 'test001'
+    When client request for a new key
+    Then new key should be created
+    And this instance should have id attribute set to 'test001'
+    And this instance should have valid fingerprint
+    And this instance should have valid pem key
+    And this instance should have credential_type set to 'key'
+    And this instance should have state set to AVAILABLE
+    And this instance should have destroy action
+
+  Scenario: Listing current keys
+    Given URI /api/keys exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'keys'
+    And this element contains some keys
+    And each instance should have:
+    | name |
+    | fingerprint |
+    | state |
+    | actions |
+    And each key should have 'href' attribute with valid URL
+    And this URI should be available in XML, JSON, HTML format
+
+ Scenario: Get details about last key
+    Given URI /api/keys exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'keys'
+    And this element contains some keys
+    When client want to show first key
+    Then client follow href attribute in first key
+    Then client should get this key
+    And this instance should have:
+    | name |
+    | actions |
+    | credential_type |
+    | fingerprint |
+    | state |
+
+  @prefix-destroy
+  Scenario: Destroying created key
+    Given URI /api/keys exists
+    And authentification is required for this URI
+    When client want to 'destroy' last key
+    And client follow destroy link in actions
+    Then client should get created key
+    And this key should be destroyed
+

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/realms.feature
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/realms.feature b/tests/deprecated/ec2/realms.feature
new file mode 100644
index 0000000..e40d869
--- /dev/null
+++ b/tests/deprecated/ec2/realms.feature
@@ -0,0 +1,27 @@
+Feature: Accessing realms
+
+  Scenario: Getting list of available realms
+    Given URI /api/realms exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'realms'
+    And this element contains some realms
+    And each realm should have:
+    | name |
+    | state |
+    And each realm should have 'href' attribute with valid URL
+    And this URI should be available in XML, JSON, HTML format
+
+  Scenario: Following realm href attribute
+    Given URI /api/realms exists
+    And authentification is required for this URI
+    When client access this URI
+    Then client should get root element 'realms'
+    And this element contains some realms
+    When client want to show first realm
+    Then client should follow href attribute in realm
+    And client should get valid response with requested realm
+    And this realm should have:
+    | name |
+    | state |
+    And this URI should be available in XML, JSON, HTML format

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/step_definitions/api_steps.rb
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/step_definitions/api_steps.rb b/tests/deprecated/ec2/step_definitions/api_steps.rb
new file mode 100644
index 0000000..27172e8
--- /dev/null
+++ b/tests/deprecated/ec2/step_definitions/api_steps.rb
@@ -0,0 +1,157 @@
+Given /^URI ([\w\/\-_]+) exists$/ do |uri|
+  get uri, {}
+  last_response.status.should_not == 404
+  last_response.status.should_not == 500
+  @uri = uri
+end
+
+Given /^URI ([\w\/\-_]+) exists in (.+) format$/ do |uri, format|
+  @uri = uri
+  case format.downcase
+    when 'xml' then
+      header 'Accept', 'application/xml;q=9'
+    when 'json' then
+      header 'Accept', 'application/json;q=9'
+    when 'html' then
+      header 'Accept', 'application/xml+xhtml;q=9'
+  end
+  get @uri, {}
+  last_response.status.should_not == 404
+  last_response.status.should_not == 500
+end
+
+Given /^authentification is not required for this URI$/ do
+  last_response.status.should_not == 401
+end
+
+When /^client access this URI$/ do
+  get @uri, {}
+  last_response.status.should_not == 404
+end
+
+Then /^client should get root element '(.+)'$/ do |element|
+  @last_element = output_xml.xpath('/'+element).first
+  @last_element.should_not be_nil
+  @last_element.name.should == element
+end
+
+Then /^this element should have attribute '(.+)' with value '(.+)'$/ do |atr, val|
+  @last_element[atr.to_sym].should == val
+end
+
+Then /^client should get list of valid entry points:$/ do |table|
+  @entry_points = table.raw.flatten.sort
+  links = []
+  output_xml.xpath('/api/link').each do |entry_point|
+    links << entry_point['rel']
+  end
+  @entry_points.should == links.sort
+end
+
+Then /^this URI should be available in (.+) format$/ do |formats|
+  @no_header = true
+  formats.split(',').each do |format|
+    case format.downcase
+    when 'xml' then
+      header 'Accept', 'application/xml;q=9'
+    when 'json' then
+      header 'Accept', 'application/json;q=9'
+    when 'html' then
+      header 'Accept', 'application/xml+xhtml;q=9'
+    end
+    get @uri, {}
+    last_response.status.should == 200
+  end
+  @no_header = false
+end
+
+Then /^client should get list of valid entry points$/ do
+  links = []
+  output_xml.xpath('/api/link').each do |entry_point|
+    links << entry_point['rel']
+  end
+  @entry_points.should == links.sort
+end
+
+Then /^each (\w+) should have '(.+)' attribute with valid (.+)$/ do |el, attr, t|
+  case el
+    when 'link' then
+      path = '/api/link'
+    when 'image' then
+      path = '/images/image'
+    when 'instance' then
+      path = '/instances/instance'
+    when 'key' then
+      path = '/keys/key'
+    when 'realm' then
+      path = '/realms/realm'
+  end
+  output_xml.xpath(path).each do |entry_point|
+    @entry_points.include?(entry_point[attr]).should == true if t=='name'
+    if t=='URL'
+      entry_point[:href].should_not be_nil
+    end
+  end
+  @last_attribute = attr
+end
+
+Then /^each ([\w\-]+) should have '(.+)' attribute set to '(.+)'$/ do |el, attr, v|
+  case el
+    when 'image' then
+      path = "/images/image"
+    when 'hardware_profile' then
+      path = "/hardware_profiles/hardware_profile"
+    when 'instance' then
+      path = "/instances/instance"
+  end
+  output_xml.xpath(path).each do |element|
+    element[attr].should == v
+  end
+end
+
+Then /^each ([\w\-]+) should have '(.+)' element set to '(.+)'$/ do |el, child, v|
+  case el
+    when 'image' then
+      path = "/images/image"
+    when 'hardware_profile' then
+      path = "/hardware_profiles/hardware_profile"
+    when 'instance' then
+      path = "/instances/instance"
+  end
+  output_xml.xpath(path).each do |element|
+     element.xpath(child).should_not be_nil
+     element.xpath(child).first.content.should == v
+  end
+end
+
+Then /^each ([\w\-]+) should have '(.+)' property set to '(.+)'$/ do |el, property, v|
+  case el
+    when 'hardware_profile' then
+      path = "/hardware_profiles/hardware_profile"
+  end
+  output_xml.xpath(path).each do |element|
+    property_elm=element.xpath("property[@name=\"#{property}\"]")
+    property_elm.should_not be_nil 
+    property_elm.first["value"].should == v
+  end
+end
+
+When /^client follow this attribute$/ do
+  output_xml.xpath('/api/link').each do |entry_point|
+    get entry_point[@last_attribute], {}
+  end
+end
+
+Then /^client should get a valid response$/ do
+  puts last_response.body
+  last_response.status.should_not == 500
+end
+
+Then /^client should get list of features inside '(.+)':$/ do |element,table|
+  features = table.raw.flatten.sort
+  instance_features = []
+  output_xml.xpath('/api/link[@rel="'+element+'"]/feature').each do |feature|
+    instance_features << feature[:name]
+  end
+  features.should == instance_features.sort
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/step_definitions/hardware_profiles_steps.rb
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/step_definitions/hardware_profiles_steps.rb b/tests/deprecated/ec2/step_definitions/hardware_profiles_steps.rb
new file mode 100644
index 0000000..373ed5c
--- /dev/null
+++ b/tests/deprecated/ec2/step_definitions/hardware_profiles_steps.rb
@@ -0,0 +1,25 @@
+Then /^it should have a (\w+) attribute$/ do |name|
+  attr = output_xml.xpath('/hardware_profile').first[name]
+  attr.should_not be_nil
+end
+
+Then /^it should have a (\w+) property '(.+)'$/ do |kind, name|
+  props = output_xml.xpath("/hardware_profile/property[@name = '#{name}']")
+  props.size.should == 1
+  prop = props.first
+  prop['kind'].should == kind
+  prop['unit'].should_not be_nil
+  if kind == 'range'
+    ranges = prop.xpath('range')
+    ranges.size.should == 1
+    range = ranges.first
+    range['first'].should_not be_nil
+    range['last'].should_not be_nil
+  end
+  if kind == 'enum'
+    enums = prop.xpath('enum')
+    enums.size.should == 1
+    enums.first.xpath('entry').size.should_not == 0
+  end
+end
+

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/step_definitions/images_steps.rb
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/step_definitions/images_steps.rb b/tests/deprecated/ec2/step_definitions/images_steps.rb
new file mode 100644
index 0000000..bc360ad
--- /dev/null
+++ b/tests/deprecated/ec2/step_definitions/images_steps.rb
@@ -0,0 +1,81 @@
+Given /^authentification is required for this URI$/ do
+  authorize CONFIG[:username], CONFIG[:password]
+  get @uri
+  last_response.status.should == 200
+end
+
+Then /^this element contains some (.+)$/ do |items|
+  item = items.singularize
+  output_xml.xpath("/#{@last_element.name}/#{item}").size.should > 0
+end
+
+Then /^each ([\w\-]+) should have:$/ do |item, table|
+  properties = table.raw.flatten.sort
+  output_xml.xpath("/#{@last_element.name}/#{item}").each do |element|
+    childrens = (element > '*').collect { |c| c.name }
+    childrens.sort.should == properties
+  end
+end
+
+Then /^this ([\w\-]+) should have:$/ do |item, table|
+  properties = table.raw.flatten.sort
+  output_xml.xpath("/#{item}").each do |element|
+    childrens = (element > '*').collect { |c| c.name }
+    childrens.sort.should == properties
+  end
+end
+
+When /^client want to show first (.+)$/ do |element|
+  case element
+    when 'image':
+      path = '/images/image'
+    when 'instance':
+      path = '/instances/instance'
+    when 'realm':
+      path = '/realms/realm'
+    when 'hardware-profile'
+      path = '/hardware_profiles/hardware_profile'
+    when 'key':
+      path = '/keys/key'
+  end
+  @element = output_xml.xpath(path).first
+  @element.should_not be_nil
+end
+
+When /^client want to show '(.+)' (.+)$/ do |id, el|
+  @uri = "/api/#{el.pluralize.tr('-', '_')}/#{id}"
+  get @uri, {}
+  @element = output_xml.xpath("/#{el}").first
+  @element.should_not be_nil
+end
+
+Then /^client follow (\w+) attribute in first (.+)$/ do |attr, el|
+  url = output_xml.xpath("/#{el.pluralize}/#{el}").first[:href]
+  url.should_not be_nil
+  get url, {}
+end
+
+Then /^client should get this (.+)$/ do |el|
+  last_response.status.should == 200
+end
+
+
+Then /^client should follow href attribute in (\w+)$/ do |element|
+  get @element[:href], {}
+end
+
+Then /^client should get valid response with requested (\w+)$/ do |element|
+  last_response.status.should == 200
+  output_xml.xpath('/'+element+'/@id').first.text.should == @element.xpath('@id').text
+end
+
+When /^client access this URI with parameters:$/ do |table|
+  params = {}
+  table.raw.each { |i| params[i[0]]=i[1] }
+  get @uri, params
+end
+
+Then /^client should get some ([\w\-]+)$/ do |elements|
+  last_response.status.should == 200
+  output_xml.xpath('/'+elements+'/'+elements.singularize).size.should > 0
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/step_definitions/instance_states_steps.rb
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/step_definitions/instance_states_steps.rb b/tests/deprecated/ec2/step_definitions/instance_states_steps.rb
new file mode 100644
index 0000000..ec5b31b
--- /dev/null
+++ b/tests/deprecated/ec2/step_definitions/instance_states_steps.rb
@@ -0,0 +1,34 @@
+Then /^states element contains some states$/ do
+  output_xml.xpath('/states/state').size.should > 0
+end
+
+Then /^each state should have '(.+)' attribute$/ do |attr|
+  output_xml.xpath('/states/state').each do |state|
+    state[attr].should_not be_nil
+  end
+end
+
+Then /^(\w+) state should have '(.+)' attribute set to '(\w+)'$/ do |pos, attr, value|
+  output_xml.xpath('/states/state').first[attr].should==value if pos=='first'
+  output_xml.xpath('/states/state').last[attr].should==value if pos=='last'
+end
+
+Then /^some states should have transitions$/ do
+  @transitions = output_xml.xpath('/states/state/transition')
+  @transitions.size.should > 0
+end
+
+Then /^each transitions should have 'to' attribute$/ do
+  @transitions.each do |t|
+    t[:to].should_not be_nil
+  end
+end
+
+When /^client wants (\w+) format$/ do |format|
+  get "#{@uri}", { :format => format.downcase }
+end
+
+Then /^client should get PNG image$/ do
+  last_response.status.should == 200
+  last_response.headers['Content-Type'].should =~ /^image\/png/
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/step_definitions/instances_steps.rb
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/step_definitions/instances_steps.rb b/tests/deprecated/ec2/step_definitions/instances_steps.rb
new file mode 100644
index 0000000..b8dd871
--- /dev/null
+++ b/tests/deprecated/ec2/step_definitions/instances_steps.rb
@@ -0,0 +1,159 @@
+When /^client follow ([\w\-]+) href attribute in first instance$/ do |element|
+  get output_xml.xpath('/instances/instance[1]/'+element).first[:href], {}
+end
+
+Then /^client should get valid ([\w\-]+)$/ do |element|
+  last_response.status.should == 200
+  output_xml.xpath("/#{element}").first.should_not be_nil
+end
+
+Then /^each running instance should have actions$/ do
+  output_xml.xpath('/instances/instance').each do |instance|
+    next if instance.xpath('state').text!='RUNNING'
+    instance.xpath('actions').first.should_not be_nil
+  end
+end
+
+Then /^each actions should have some links$/ do
+  output_xml.xpath('/instances/instance').each do |instance|
+    next if instance.xpath('state').text!='RUNNING'
+    instance.xpath('actions/link').first.should_not be_nil
+  end
+end
+
+Then /^each link should have valid (\w+) attribute$/ do |attr|
+  output_xml.xpath('/instances/instance').each do |instance|
+    next if instance.xpath('state').text!='RUNNING'
+    instance.xpath('actions/link').first[attr].should_not be_nil
+  end
+end
+
+When /^client want to '(\w+)' (first|last|RUNNING) instance$/ do |action, position|
+  @action = action
+  if position=='first'
+    @instance = output_xml.xpath('/instances/instance').first
+  elsif position == 'RUNNING'
+    @instance = output_xml.xpath('/instances/instance/state[text()="RUNNING"]').first.parent
+  else
+    @instance = output_xml.xpath('/instances/instance').last
+  end
+end
+
+When /^client follow link in actions$/ do
+
+  unless @instance.xpath('id')
+    l = output_xml.xpath('/instances/instance[1]/actions/link[@rel="'+@action+'"]').first
+  else
+    l = @instance.xpath('actions/link[@rel="'+@action+'"]').first
+  end
+
+  post l[:href]
+
+  last_response.status.should_not == 500
+end
+
+Then /^client should get (first|last) instance$/ do |position|
+  if position == 'last'
+    output_xml.xpath('/instance/id').last.should_not be_nil
+  else
+    output_xml.xpath('/instance/id').first.should_not be_nil
+  end
+end
+
+Then /^this instance should be in '(.+)' state$/ do |state|
+  output_xml.xpath('/instance/state').first.text.should == state
+end
+
+Then /^each instance should have address type set to "([^"]*)"$/ do |t|
+  output_xml.xpath('/instances/instance/public_addresses/address').first[:type].should == t
+  output_xml.xpath('/instances/instance/private_addresses/address').first[:type].should == t
+end
+
+
+When /^client want to create a new instance$/ do
+end
+
+Then /^client should choose (\w+) image$/ do |position|
+  get '/api/images', {}
+  if position=='first'
+    @image = output_xml.xpath('/images/image').first
+  else
+    @image = output_xml.xpath('/images/image').last
+  end
+  @image.should_not be_nil
+end
+
+When /^client request for a new instance$/ do
+  params = {
+    :image_id => @image.xpath('@id').first.text
+  }
+  params[:hwp_id] = @hwp_id if @hwp_id
+  params[:public_ip] = @public_ip if @public_ip
+  post "#{@uri}", params
+end
+
+Then /^new instance should be created$/ do
+  last_response.status.should == 201
+end
+
+Then /^this instance should have chosed image$/ do
+  output_xml.xpath('/instance/image').first[:href].should == @image[:href]
+end
+
+Then /^this instance should have valid id$/ do
+  output_xml.xpath('instance/@id').first.should_not be_nil
+end
+
+Then /^this instance should have name$/ do
+  output_xml.xpath('instance/name').first.should_not be_nil
+end
+
+When /^client want to '(\w+)' created instance$/ do |action|
+  get @instance_url, {}
+  last_response.status.should == 200
+  @action = action
+  @instance = output_xml.xpath('/instance')
+end
+
+Then /^client should get created instance$/ do
+  last_response.status.should == 202
+  #get last_response.headers['Location']
+end
+
+When /^this instance should be destroyed$/ do
+  # TODO: Fix this bug in mock driver ?
+end
+
+Then /^client should get HTML form$/ do
+  last_response.status.should == 200
+  (last_response.body.strip =~ /^<!DOCTYPE html/).should be_true
+end
+
+When /^client choose (\w+) hardware profile$/ do |position|
+  get '/api/hardware_profiles', {}
+  if position=='last'
+    @hwp_id = output_xml.xpath('/hardware_profiles/hardware_profile/@id').last.text
+  else
+    @hwp_id = output_xml.xpath('/hardware_profiles/hardware_profile/@id').first.text
+  end
+end
+
+When /^client choose public IP address '([\w\.]+)'$/ do |address|
+  @public_up = address
+end
+
+Then /^this instance should have last hardware profile$/ do
+  output_xml.xpath('instance/hardware_profile/@id').first.text.should == @hwp_id
+end
+
+Given /^I set mock scenario to (\w+)$/ do |scenario|
+  @scenario = scenario
+end
+
+Then /^I set mock scenario to default$/ do
+  @scenario = ''
+end
+
+Then /^IP address for this instance should be '([\w\.]+)'$/ do |address|
+end
+

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/step_definitions/keys_steps.rb
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/step_definitions/keys_steps.rb b/tests/deprecated/ec2/step_definitions/keys_steps.rb
new file mode 100644
index 0000000..bc95207
--- /dev/null
+++ b/tests/deprecated/ec2/step_definitions/keys_steps.rb
@@ -0,0 +1,60 @@
+When /^client want to create a new key$/ do
+end
+
+Then /^client should choose name '(\w+)'$/ do |name|
+  @name = name
+end
+
+Then /^this instance should have id attribute set to '(\w+)'$/ do |name|
+  output_xml.xpath('/key/@id').text.should == name
+end
+
+Then /^this instance should have valid fingerprint$/ do
+  output_xml.xpath('/key/fingerprint').text.should_not == nil
+  output_xml.xpath('/key/fingerprint').text.size > 0
+end
+
+Then /^this instance should have valid pem key$/ do
+  output_xml.xpath('/key/pem').text.strip =~ /$-----BEGIN RSA PRIVATE KEY-----/
+end
+
+When /^client request for a new key$/ do
+  params = {
+    :name => @name
+  }
+  post "/api/keys", params
+end
+
+Then /^new key should be created$/ do
+  output_xml.xpath('/key').size.should == 1
+end
+
+Then /^this instance should have state set to (\w+)$/ do |value|
+  output_xml.xpath('/key/state').text.should == value.strip
+end
+
+Then /^this instance should have credential_type set to '(\w+)'$/ do |type|
+  output_xml.xpath('/key/@type').text.should == type
+end
+
+Then /^this instance should have destroy action$/ do
+  output_xml.xpath('/key/actions/link[@rel="destroy"]').should_not == nil
+end
+
+When /^client want to 'destroy' last key$/ do
+  get "/api/keys"
+  @credential = output_xml.xpath('/keys/key').last
+end
+
+When /^client follow destroy link in actions$/ do
+  @link = output_xml.xpath('/keys/key/actions/link[@rel="destroy"]').last
+  delete @link['href']
+end
+
+Then /^client should get created key$/ do
+  #output_xml.xpath('/key/state').text.should == "AVAILABLE"
+end
+
+Then /^this key should be destroyed$/ do
+  last_response.status.should == 204
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/step_definitions/rake_steps.rb
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/step_definitions/rake_steps.rb b/tests/deprecated/ec2/step_definitions/rake_steps.rb
new file mode 100644
index 0000000..269a1dc
--- /dev/null
+++ b/tests/deprecated/ec2/step_definitions/rake_steps.rb
@@ -0,0 +1,19 @@
+require 'fileutils'
+require 'rake'
+require 'find'
+
+Given /^I have a clean (.+) directory$/ do |dir|
+  FileUtils.rm_rf dir  
+end
+
+When /^I run a '(\w+)' task$/ do |task|
+  @rake = Rake::Application.new
+ Rake.application = @rake
+ load "Rakefile"
+ @task = Rake::Task[task]
+ @task.invoke
+end
+
+Then /^I should see a (\d+) (\w+) file inside (\w+) directory$/ do |count, ext, dir|
+  Dir["#{dir}/deltacloud-*.#{ext}"].size.should == count.to_i
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/step_definitions/storage_volumes_steps.rb
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/step_definitions/storage_volumes_steps.rb b/tests/deprecated/ec2/step_definitions/storage_volumes_steps.rb
new file mode 100644
index 0000000..a6cd0a4
--- /dev/null
+++ b/tests/deprecated/ec2/step_definitions/storage_volumes_steps.rb
@@ -0,0 +1,90 @@
+When /^client want create a new ([\w_]+)$/ do |object|
+end
+
+When /^client want to list all storage_volumes$/ do
+end
+
+When /^client want to attach storage volume to RUNNING instance$/ do
+  get "/api/instances", { :state => "RUNNING" }
+  @instance_id = (output_xml/"/instances/instance").first[:id]
+  get "/api/storage_volumes"
+  @storage_volume_id = (output_xml/"/storage_volumes/storage_volume").first[:id]
+end
+
+Then /^client should POST on ([\w_\/\$]+) using$/ do |uri, table|
+  params = {}
+  uri.gsub!(/\$storage_volume_id/, @storage_volume_id) if @storage_volume_id
+  table.raw.each do |key, value|
+    if value =~ /\$(.*)/
+      value = case $1.strip
+                when 'instance_id' then @instance_id 
+              end
+    end
+    params[key.to_sym] = value.strip
+  end
+  post uri, params
+end
+
+Then /^client should do a POST on ([\w_\/\$]+)$/ do |uri|
+  get "/api/storage_volumes"
+  @storage_volume_id = (output_xml/"/storage_volumes/storage_volume").first[:id]
+  uri.gsub!(/\$storage_volume_id/, @storage_volume_id) if @storage_volume_id
+end
+
+Then /^client should GET on ([\w_\/]+)$/ do |uri|
+  get uri
+end
+
+Then /^a new storage_volume should be created$/ do
+  last_response.status.should == 201
+end
+
+Then /^a list of ([\w_]+) should be returned$/ do |collection|
+  last_response.status.should == 200
+  (output_xml/"/#{collection}").size.should_not == 0
+end
+
+Then /^this storage_volume should have (\w+) set to '(\w+)'$/ do |key, val|
+  (output_xml/"/storage_volume/#{key}").text.should == val
+end
+
+Then /^this storage_volume should have (\w+) with valid date$/ do |key|
+  (output_xml/"/storage_volume/#{key}").text.class.should_not == nil
+end
+
+Then /^each (\w+) should have (\w+) with valid date$/ do |object, key|
+  (output_xml/"/#{object}s/#{object}").each do |item|
+    (item/"#{key}").should_not == nil
+  end
+end
+
+Then /^this storage_volume should have actions:$/ do |table|
+  table.raw.each do |key|
+    (output_xml/"/storage_volume/actions/link[@rel = '#{key}']").should_not == nil
+  end
+end
+
+Then /^each (\w+) should have (\w+)$/ do |object, key|
+  (output_xml/"/#{object}s/#{object}").each do |item|
+    (item/"#{key}").should_not == nil
+  end
+end
+
+Then /^storage_volume should be attached to this instance$/ do
+  get "/api/storage_volumes/vol-de30ccb4"
+  puts last_response.body
+  (output_xml/"/storage_volume/mount/instance").first['id'].should == 'i-7f6a021e'
+end
+
+Then /^this storage_volume should have mounted instance with:$/ do |table|
+  table.raw.each do |key|
+    (output_xml/"/storage_volume/mount/#{key}").should_not == nil
+  end
+end
+
+When /^client want to detach created storage volume$/ do
+end
+
+Then /^storage_volume should be detached from$/ do
+  last_response.status.should == 200
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/storage_volumes.feature
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/storage_volumes.feature b/tests/deprecated/ec2/storage_volumes.feature
new file mode 100644
index 0000000..ac1bd63
--- /dev/null
+++ b/tests/deprecated/ec2/storage_volumes.feature
@@ -0,0 +1,52 @@
+Feature: Managing storage volumes
+
+  @prefix-create
+  Scenario: Create a new storage volume
+    Given URI /api/storage_volumes exists
+    And authentification is required for this URI
+    When client want create a new storage_volume
+    Then client should POST on /api/storage_volumes using
+      | capacity | 1 |
+      | realm_id | us-east-1a |
+    And a new storage_volume should be created
+    And this storage_volume should have capacity set to '1'
+    And this storage_volume should have created_at with valid date
+    And this storage_volume should have state set to 'CREATING'
+    And this storage_volume should have actions:
+      | attach |
+      | detach |
+      | destroy |
+
+  @prefix-list
+  Scenario: Getting a list of all storage volumes
+    Given URI /api/storage_volumes exists
+    And authentification is required for this URI
+    When client want to list all storage_volumes
+    Then client should GET on /api/storage_volumes
+    And a list of storage_volumes should be returned
+    And each storage_volume should have id
+    And each storage_volume should have created_at with valid date
+    And each storage_volume should have state
+    And each storage_volume should have capacity
+    And each storage_volume should have actions
+
+  @prefix-attach
+  Scenario: Attach storage volume to instance
+    Given URI /api/storage_volumes exists
+    And authentification is required for this URI
+    When client want to attach storage volume to RUNNING instance
+    Then client should POST on /api/storage_volumes/$storage_volume_id/attach using
+      | device | /dev/sdc |
+      | instance_id | i-7f6a021e |
+    And storage_volume should be attached to this instance
+    And this storage_volume should have mounted instance with:
+      | instance |
+      | device |
+
+  @prefix-detach
+  Scenario: Detach storage volume to instance
+    Given URI /api/storage_volumes exists
+    And authentification is required for this URI
+    When client want to detach created storage volume
+    Then client should do a POST on /api/storage_volumes/$storage_volume_id/detach
+    And storage_volume should be detached from

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/support/ec2/actions_describe_instances.da39a3ee5e6b4b0d3255bfef95601890afd80709
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/support/ec2/actions_describe_instances.da39a3ee5e6b4b0d3255bfef95601890afd80709 b/tests/deprecated/ec2/support/ec2/actions_describe_instances.da39a3ee5e6b4b0d3255bfef95601890afd80709
new file mode 100644
index 0000000..adea4bb
--- /dev/null
+++ b/tests/deprecated/ec2/support/ec2/actions_describe_instances.da39a3ee5e6b4b0d3255bfef95601890afd80709
@@ -0,0 +1,48 @@
+BAhbC3scOhFhd3NfaW1hZ2VfaWQiEWFtaS05MmJhNDNmYjoTYXdzX3N0YXRl
+X2NvZGUiIUNsaWVudC5Vc2VySW5pdGlhdGVkU2h1dGRvd246FmF3c19wcm9k
+dWN0X2NvZGVzWwA6DmF3c19zdGF0ZSIPdGVybWluYXRlZDoNZG5zX25hbWUi
+ADoVbW9uaXRvcmluZ19zdGF0ZSINZGlzYWJsZWQ6EXNzaF9rZXlfbmFtZSIR
+amVua2luc190ZXN0Og9hd3NfZ3JvdXBzWwYiEnF1aWNrLXN0YXJ0LTE6EWFy
+Y2hpdGVjdHVyZSIJaTM4NjoUYXdzX2xhdW5jaF90aW1lIh0yMDExLTA4LTA4
+VDA5OjIzOjAwLjAwMFo6CXRhZ3N7BiIJTmFtZSIAOhVyb290X2RldmljZV90
+eXBlIghlYnM6EWF3c19wbGF0Zm9ybSIMd2luZG93czoWYXdzX2luc3RhbmNl
+X3R5cGUiDXQxLm1pY3JvOhpibG9ja19kZXZpY2VfbWFwcGluZ3NbADoPYXdz
+X3JlYXNvbiIUVXNlciBpbml0aWF0ZWQgOg5hd3Nfb3duZXIiETI5Mzc4Nzc0
+OTg4NDoaYXdzX2F2YWlsYWJpbGl0eV96b25lIg91cy1lYXN0LTFhOhVhbWlf
+bGF1bmNoX2luZGV4IgYwOhdhd3NfcmVzZXJ2YXRpb25faWQiD3ItZjU3NmY4
+OWE6FGF3c19pbnN0YW5jZV9pZCIPaS02OTM2NWUwODoVcm9vdF9kZXZpY2Vf
+bmFtZSIOL2Rldi9zZGExOhVwcml2YXRlX2Ruc19uYW1lIgB7HDsAIhFhbWkt
+OGMxZmVjZTU7BiIhQ2xpZW50LlVzZXJJbml0aWF0ZWRTaHV0ZG93bjsHWwA7
+CCIPdGVybWluYXRlZDsJIgA7CiINZGlzYWJsZWQ7CyIRamVua2luc190ZXN0
+OwxbBiIdZmlyZXdhbGwtaW5zdC0xMzEwNTU4MjY2Ow0iCWkzODY7DiIdMjAx
+MS0wOC0wOFQwOToyNDo1Mi4wMDBaOhJhd3Nfa2VybmVsX2lkIhFha2ktNDA3
+ZDk1Mjk7D3sGIglOYW1lIgA7ECIIZWJzOxIiDXQxLm1pY3JvOxNbADsUIhRV
+c2VyIGluaXRpYXRlZCA7FSIRMjkzNzg3NzQ5ODg0OxYiD3VzLWVhc3QtMWI7
+FyIGMDsYIg9yLWYzNzdmOTljOxkiD2ktMjMzNzVmNDI7GiIOL2Rldi9zZGEx
+OxsiAHsdOwAiEWFtaS04YzFmZWNlNTsGIgcxNjsHWwA7CCIMcnVubmluZzsJ
+Ii1lYzItNjctMjAyLTUyLTI2LmNvbXB1dGUtMS5hbWF6b25hd3MuY29tOwoi
+DWRpc2FibGVkOwsiEWplbmtpbnNfdGVzdDsMWwYiHWZpcmV3YWxsLWluc3Qt
+MTMxMDU1ODI2NjobYXdzX3ByaXZhdGVfaXBfYWRkcmVzcyIRMTAuMjExLjE1
+LjIxOw0iCWkzODY7DiIdMjAxMS0wOC0wOFQxMDowOTo1MS4wMDBaOxwiEWFr
+aS00MDdkOTUyOTsPewYiCU5hbWUiADsQIghlYnM7EiINdDEubWljcm87E1sG
+ewYiDi9kZXYvc2RhMSIRdm9sLWM0MzdjYmFlOxQiADsVIhEyOTM3ODc3NDk4
+ODQ7FiIPdXMtZWFzdC0xYTsXIgYwOxgiD3ItNTcxZDkzMzg7GSIPaS0zMzY4
+MDA1MjsaIg4vZGV2L3NkYTE7GyIuZG9tVS0xMi0zMS0zOS0wQS0wQy1FNy5j
+b21wdXRlLTEuaW50ZXJuYWx7HDsAIhFhbWktMTZhMzU3N2Y7BiIGMDsHWwA7
+CCIMcGVuZGluZzsJIgA7CiINZGlzYWJsZWQ7CyIAOwxbBiIMZGVmYXVsdDsN
+IglpMzg2Ow4iHTIwMTEtMDgtMDhUMTA6MTI6MDguMDAwWjscIhFha2ktNDA3
+ZDk1Mjk7D3sAOxAiCGViczsSIg1tMS5zbWFsbDsTWwZ7BiIOL2Rldi9zZGEx
+IhF2b2wtYzYzMGNjYWM7FCIAOxUiETI5Mzc4Nzc0OTg4NDsWIg91cy1lYXN0
+LTFiOxciBjA7GCIPci1mZjFhOTQ5MDsZIg9pLTc3NmEwMjE2OxoiDi9kZXYv
+c2RhMTsbIgB7HDsAIhFhbWktMTZhMzU3N2Y7BiIGMDsHWwA7CCIMcGVuZGlu
+ZzsJIgA7CiINZGlzYWJsZWQ7CyIAOwxbBiIMZGVmYXVsdDsNIglpMzg2Ow4i
+HTIwMTEtMDgtMDhUMTA6MTI6MTMuMDAwWjscIhFha2ktNDA3ZDk1Mjk7D3sA
+OxAiCGViczsSIg10MS5taWNybzsTWwZ7BiIOL2Rldi9zZGExIhF2b2wtZGUz
+MGNjYjQ7FCIAOxUiETI5Mzc4Nzc0OTg4NDsWIg91cy1lYXN0LTFhOxciBjA7
+GCIPci1mNzFhOTQ5ODsZIg9pLTdmNmEwMjFlOxoiDi9kZXYvc2RhMTsbIgB7
+HDsAIhFhbWktMTZhMzU3N2Y7BiIGMDsHWwA7CCIMcGVuZGluZzsJIgA7CiIN
+ZGlzYWJsZWQ7CyIAOwxbBiIMZGVmYXVsdDsNIglpMzg2Ow4iHTIwMTEtMDgt
+MDhUMTA6MTI6MTUuMDAwWjscIhFha2ktNDA3ZDk1Mjk7D3sAOxAiCGViczsS
+Ig1tMS5zbWFsbDsTWwA7FCIAOxUiETI5Mzc4Nzc0OTg4NDsWIg91cy1lYXN0
+LTFiOxciBjA7GCIPci1mMzFhOTQ5YzsZIg9pLTQzNmEwMjIyOxoiDi9kZXYv
+c2RhMTsbIgA=

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a53f9b4b/tests/deprecated/ec2/support/ec2/attach_volume.02b8ed437c66c556e77e4b7813a2ae5043c68a8f
----------------------------------------------------------------------
diff --git a/tests/deprecated/ec2/support/ec2/attach_volume.02b8ed437c66c556e77e4b7813a2ae5043c68a8f b/tests/deprecated/ec2/support/ec2/attach_volume.02b8ed437c66c556e77e4b7813a2ae5043c68a8f
new file mode 100644
index 0000000..2402fbd
--- /dev/null
+++ b/tests/deprecated/ec2/support/ec2/attach_volume.02b8ed437c66c556e77e4b7813a2ae5043c68a8f
@@ -0,0 +1,4 @@
+BAh7CjoLYXdzX2lkIhF2b2wtYTIzMGNjYzg6GmF3c19hdHRhY2htZW50X3N0
+YXR1cyIOYXR0YWNoaW5nOg9hd3NfZGV2aWNlIg0vZGV2L3NkYzoUYXdzX2F0
+dGFjaGVkX2F0dToJVGltZQ0K3RvAqJa8RToUYXdzX2luc3RhbmNlX2lkIg9p
+LTdmNmEwMjFl


Mime
View raw message