From: Ronelle Landy <[email protected]>
---
tests/Rakefile | 2 +-
tests/deltacloud/addresses_test.rb | 28 ++++++++++++++++++++++++++
tests/deltacloud/common_tests_collections.rb | 6 ++--
tests/deltacloud/drivers_test.rb | 28 ++++++++++++++++++++++++++
4 files changed, 60 insertions(+), 4 deletions(-)
create mode 100644 tests/deltacloud/addresses_test.rb
create mode 100644 tests/deltacloud/drivers_test.rb
diff --git a/tests/Rakefile b/tests/Rakefile
index f7e6fe5..30f878d 100644
--- a/tests/Rakefile
+++ b/tests/Rakefile
@@ -23,7 +23,7 @@ namespace :test do
end
namespace :deltacloud do
- ["base_api", "buckets", "images", "instances", "instance_states", "keys",
"realms", "storage_volumes", "storage_snapshots", "hardware_profiles"].each do
|col|
+ ["addresses", "base_api", "buckets", "drivers", "firewalls", "images",
"instances", "instance_states", "keys", "load_balancers", "metrics", "realms",
"storage_volumes", "storage_snapshots", "hardware_profiles"].each do |col|
Rake::TestTask.new(col) do |t|
t.test_files = FileList["deltacloud/#{col}_test.rb"]
end
diff --git a/tests/deltacloud/addresses_test.rb
b/tests/deltacloud/addresses_test.rb
new file mode 100644
index 0000000..faba98b
--- /dev/null
+++ b/tests/deltacloud/addresses_test.rb
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership. The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+$:.unshift File.join(File.dirname(__FILE__), '..')
+require "deltacloud/test_setup.rb"
+
+describe 'Deltacloud API keys collection' do
+ include Deltacloud::Test::Methods
+
+ need_collection :addresses
+
+ #Run the 'common' tests for all collections defined in
common_tests_collections.rb
+ CommonCollectionsTest::run_collection_and_member_tests_for("addresses")
+
+end
diff --git a/tests/deltacloud/common_tests_collections.rb
b/tests/deltacloud/common_tests_collections.rb
index a80ae39..b754eab 100644
--- a/tests/deltacloud/common_tests_collections.rb
+++ b/tests/deltacloud/common_tests_collections.rb
@@ -39,7 +39,7 @@ module CommonCollectionsTest
end
it "must require authentication to access the #{test_collection}
collection" do
- skip "Skipping for #{test_collection} as auth may not be required
here" if ["hardware_profiles", "instance_states"].include?(test_collection)
+ skip "Skipping for #{test_collection} as auth may not be required
here" if ["hardware_profiles", "instance_states",
"drivers"].include?(test_collection)
proc { get(test_collection, :noauth => true) }.must_raise
RestClient::Request::Unauthorized
end
@@ -101,7 +101,7 @@ module CommonCollectionsTest
end
it "must have the \"name\" element defined for each
#{test_collection.singularize} in collection" do
- skip "Skipping for #{test_collection} as name may not be required
here" if ["metrics", "load_balancers"].include?(test_collection)
+ skip "Skipping for #{test_collection} as name may not be required
here" if ["metrics", "load_balancers", "addresses"].include?(test_collection)
res = get(test_collection)
(res.xml/"#{test_collection}/#{test_collection.singularize}").each do
|r|
(r/'name').wont_be_nil
@@ -118,7 +118,7 @@ module CommonCollectionsTest
end
it "must have the \"name\" element for the
#{test_collection.singularize} and it should match with the one in collection"
do
- skip "Skipping for #{test_collection} as name may not be required
here" if ["metrics", "load_balancers"].include?(test_collection)
+ skip "Skipping for #{test_collection} as name may not be required
here" if ["metrics", "load_balancers", "addresses"].include?(test_collection)
res = get(test_collection)
(res.xml/"#{test_collection}/#{test_collection.singularize}").each do
|r|
element = get(test_collection+"/#{r[:id]}")
diff --git a/tests/deltacloud/drivers_test.rb b/tests/deltacloud/drivers_test.rb
new file mode 100644
index 0000000..a3e4144
--- /dev/null
+++ b/tests/deltacloud/drivers_test.rb
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership. The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+$:.unshift File.join(File.dirname(__FILE__), '..')
+require "deltacloud/test_setup.rb"
+
+describe 'Deltacloud API keys collection' do
+ include Deltacloud::Test::Methods
+
+ need_collection :drivers
+
+ #Run the 'common' tests for all collections defined in
common_tests_collections.rb
+ CommonCollectionsTest::run_collection_and_member_tests_for("drivers")
+
+end
--
1.7.7.6