[PATCH 14/14] CIMI: remove unused model methods

2013-03-13 Thread lutter
From: David Lutterkort Collection.all and Resource.all_uri do not make sense any more since they ultimately depend on find, which is now a service method. --- server/lib/cimi/models/collection.rb | 6 -- server/lib/cimi/models/resource.rb | 6 -- 2 files changed, 12 deletions(-) diff

[PATCH 13/14] CIMI: a very simple test of volume creation

2013-03-13 Thread lutter
From: David Lutterkort --- server/tests/cimi/collections/volumes_test.rb | 42 +++ 1 file changed, 42 insertions(+) create mode 100644 server/tests/cimi/collections/volumes_test.rb diff --git a/server/tests/cimi/collections/volumes_test.rb b/server/tests/cimi/collectio

[PATCH 11/14] * server/lib/cimi/service/machine_template.rb (delete!): fix 500 error

2013-03-13 Thread lutter
From: David Lutterkort The method was simply busted. Now also allows deletion of nonexisting templates --- server/lib/cimi/service/machine_template.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/lib/cimi/service/machine_template.rb b/server/lib/cimi/service/mac

[PATCH 09/14] CIMI: Use CIMI::Service namespace in Rabbit collections

2013-03-13 Thread lutter
From: Michal Fojtik Signed-off-by: Michal fojtik TrackedAt: http://tracker.deltacloud.org/patch/4f61366999285c2dfbc497bdc0581c8b657d9191 --- server/lib/cimi/collections/address_templates.rb | 8 ++--- server/lib/cimi/collections/addresses.rb | 8 ++--- server/lib/cimi/collections

[PATCH 12/14] CIMI::Model::Schema::Ref: do not support looking up the referenced object

2013-03-13 Thread lutter
From: David Lutterkort This now depends on service objects and can therefore not be used from models --- server/lib/cimi/models/schema.rb | 14 -- 1 file changed, 14 deletions(-) diff --git a/server/lib/cimi/models/schema.rb b/server/lib/cimi/models/schema.rb index b6651a7..5a2049b

[PATCH 10/14] CIMI: make ResourceMetadata work with the Model/Service split

2013-03-13 Thread lutter
From: David Lutterkort Extension attributes now need to be mentioned twice: in the model class they are declared like any other attribute. In the service class, resource metadata can be added using metadata attr_name, :type => TYPE, :constraints => PROC --- server/lib/cimi/models/cloud_entry_

[PATCH 07/14] CIMI: Added Service::Base#parse method

2013-03-13 Thread lutter
From: Michal Fojtik Make possible to call .parse on Service models from Rabbit collections. Signed-off-by: Michal fojtik TrackedAt: http://tracker.deltacloud.org/patch/a16895d3bb6ab3596fb77fee96d041e01c3a1747 --- server/lib/cimi/service/base.rb | 7 +++ 1 file changed, 7 insertions(+) di

[PATCH 06/14] CIMI: Migrated MachineImage to services

2013-03-13 Thread lutter
From: Michal Fojtik Signed-off-by: Michal fojtik TrackedAt: http://tracker.deltacloud.org/patch/ac7d8b3fe7354da3cb2d29400632bfe36694556d --- server/lib/cimi/collections/machine_images.rb | 6 ++-- server/lib/cimi/models/machine_image.rb | 28 --- server/lib/cimi/service.rb

[PATCH 05/14] CIMI: Apply $filter and $select in Base#list

2013-03-13 Thread lutter
From: Michal Fojtik No need to have ugly chained methods in collections. Signed-off-by: Michal fojtik TrackedAt: http://tracker.deltacloud.org/patch/c2417e1f3383ae4a76e1d40d04440daed149bf95 --- server/lib/cimi/collections/machines.rb | 2 +- server/lib/cimi/service/base.rb | 2 +- 2 f

[PATCH 02/14] CIMI (schema): properly generate and track embedded collection classes

2013-03-13 Thread lutter
From: David Lutterkort --- server/lib/cimi/models/schema.rb | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/lib/cimi/models/schema.rb b/server/lib/cimi/models/schema.rb index b4e9377..9c27c6f 100644 --- a/server/lib/cimi/models/schema.rb +++ b/server/lib/cimi/mo

[PATCH 01/14] CIMI Models: rename hash in DSL to hash_map

2013-03-13 Thread lutter
From: David Lutterkort Since 'hash' is used for putting objects into Hash, overriding it as a class method causes surprises when a class is used as a hash key. --- server/lib/cimi/models/base.rb| 2 +- server/lib/cimi/models/schema.rb | 2 +- server/lib/cimi/models/system_te

[PATCH 04/14] CIMI: split models into model and service objects

2013-03-13 Thread lutter
From: David Lutterkort The current CIMI::Model classes address two concerns: * serialization/deserialization of CIMI objects * interaction with the current driver and the DB This patch splits these two concerns into two separate class hierarchies: CIMI::Model for (de)serialization and CIMI:

[PATCH 03/14] DB Entity: make sure we instantiate the correct subclass

2013-03-13 Thread lutter
From: David Lutterkort We only ever instantiated Database::Entity, but never any of its subclasses. We now keep a map of CIMI::Model => Database::Entity subclass and call new on the appropriate subclass of Entity. --- server/lib/db/entity.rb | 17 - 1 file changed, 16 insertions(

RFC: Separate CIMI (de)serialization from server functionality (rev 3)

2013-03-13 Thread lutter
This is the third take on splitting server-side functionality out of our models. As in previous attempts, CIMI::Model is now solely concerned with (se)serialization, whereas CIMI::Service does all the actual server-side functionality. FWIW, the unit and blackbox tests all pass for me with this pa

[PATCH 4/6] RHEVM unit tests: allow triggering of rerecording with env var VCR_RECORD

2013-03-07 Thread lutter
From: David Lutterkort Setting VCR_RECORD=all will rerecord the fixtures --- server/tests/drivers/rhevm/common.rb | 9 - server/tests/test_helper.rb | 8 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/server/tests/drivers/rhevm/common.rb b/server/tests

[PATCH 3/6] * server/tests/test_helper.rb: simplify defaulting of user/passeword/provider

2013-03-07 Thread lutter
From: David Lutterkort --- server/tests/test_helper.rb | 39 --- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/server/tests/test_helper.rb b/server/tests/test_helper.rb index 61ee26d..55d2ff5 100644 --- a/server/tests/test_helper.rb +++ b/ser

[PATCH 5/6] * server/tests/test_helper.rb: allow accessing preferred items from config

2013-03-07 Thread lutter
From: David Lutterkort --- server/tests/test_helper.rb | 7 +++ 1 file changed, 7 insertions(+) diff --git a/server/tests/test_helper.rb b/server/tests/test_helper.rb index 9d37ccf..8bcb374 100644 --- a/server/tests/test_helper.rb +++ b/server/tests/test_helper.rb @@ -124,6 +124,13 @@ modul

Parametrize RHEV-M unit tests

2013-03-07 Thread lutter
These patches change things so that the RHEV-M tests do not depend on any hardcoded values. Rather, everything is now read from ~/.deltacloud/config. The new entries for rhevm in that file should be: rhevm: user: USERNAME password: PASSWORD provider: https://rhevm.example.co

[PATCH 1/6] RHEVM tests: have VCR match only on path and query, not full URI

2013-03-07 Thread lutter
From: David Lutterkort --- server/tests/drivers/rhevm/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/tests/drivers/rhevm/common.rb b/server/tests/drivers/rhevm/common.rb index 14a51f9..b3d3a63 100644 --- a/server/tests/drivers/rhevm/common.rb +++ b/server/t

[PATCH 2/6] RHEVM tests: do not record username/password/hostname with VCR

2013-03-07 Thread lutter
From: David Lutterkort --- server/tests/drivers/rhevm/common.rb | 8 1 file changed, 8 insertions(+) diff --git a/server/tests/drivers/rhevm/common.rb b/server/tests/drivers/rhevm/common.rb index b3d3a63..88d7d36 100644 --- a/server/tests/drivers/rhevm/common.rb +++ b/server/tests/dri

[PATCH 7/8] Pull all DB setup logic into the database initializer

2013-03-06 Thread lutter
From: David Lutterkort This ensures in particular that our tests always run under the same environment. --- server/bin/deltacloud-db-upgrade | 11 +-- server/lib/initializers/database_initialize.rb | 27 ++ server/tests/cimi/db/db_helper.rb

[PATCH 8/8] Remove global constants DATABASE and DATABASE_LOCATION

2013-03-06 Thread lutter
From: David Lutterkort Also streamlines how we create/retrieve the current DB --- server/lib/db.rb | 16 ++-- server/lib/initializers/database_initialize.rb | 17 +++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/server/l

[PATCH 4/8] * tests/deltacloud/launcher_test.rb: start deltacloudd with -e test

2013-03-06 Thread lutter
From: David Lutterkort This avoids triggering rerun accidentally; otherwise, we can't kill the server reliably, plus we're testing a dev-only code path --- server/tests/deltacloud/launcher_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/tests/deltacloud/l

[PATCH 6/8] * bin/deltacloudd: explicitly pass pattern to rerun

2013-03-06 Thread lutter
From: David Lutterkort This works around a bug in rerun where the pattern winds up being nil --- server/bin/deltacloudd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/bin/deltacloudd b/server/bin/deltacloudd index 9246058..71e55d3 100755 --- a/server/bin/deltacloudd

[PATCH 5/8] * server/Rakefile (mock:fixtures:setup): do not chain calls to gsub!

2013-03-06 Thread lutter
From: David Lutterkort String#gsub! returns nil when nothing was substituted --- server/Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/Rakefile b/server/Rakefile index da068b8..ec7dd4e 100644 --- a/server/Rakefile +++ b/server/Rakefile @@ -66,7 +66,8 @@ nam

Revamp how we setup the DB and misc fixes

2013-03-06 Thread lutter
These are mostly minor fixes, especially to address some breakage I had because I am using rerun. The major change in these patches is that all tests now run in the test environemnt, and that they run against an (empty) in-memory DB David

[PATCH 3/8] * bin/deltacloudd: explicitly ask for webrick when --webrick is passed in

2013-03-06 Thread lutter
From: David Lutterkort --- server/bin/deltacloudd | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/bin/deltacloudd b/server/bin/deltacloudd index 836bc55..9246058 100755 --- a/server/bin/deltacloudd +++ b/server/bin/deltacloudd @@ -215,12 +215,10 @@ unless have_thin

[PATCH 2/8] * Gemfile: fix version of webmock

2013-03-06 Thread lutter
From: David Lutterkort VCR wants webmock < 1.10 --- server/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Gemfile b/server/Gemfile index 5440691..5f3c98d 100644 --- a/server/Gemfile +++ b/server/Gemfile @@ -13,7 +13,7 @@ group :development do gem "rack-test

[PATCH 1/8] CIMI unit tests: do not set RACK_ENV to development

2013-03-06 Thread lutter
From: David Lutterkort --- server/tests/cimi/db/db_helper.rb | 1 - server/tests/cimi/db/entity_test.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/server/tests/cimi/db/db_helper.rb b/server/tests/cimi/db/db_helper.rb index 84498ec..65cca7b 100644 --- a/server/tests/cimi/db/db_helper

RFC: Separate CIMI (de)serialization from server functionality

2013-02-28 Thread lutter
This patch shows how we can split the current CIMI::Model classes into two different class hierarchies, CIMI::Model and CIMI::Service. After the split, the former will strictly be restricted to (de)serialization of CIMI resources whereas the latter will be dedicated to interaction with drivers and

[PATCH] CIMI: split models into model and service objects

2013-02-28 Thread lutter
From: David Lutterkort The current CIMI::Model classes address two concerns: * serialization/deserialization of CIMI objects * interaction with the current driver and the DB This patch splits these two concerns into two separate class hierarchies: CIMI::Model for (de)serialization and CIMI:

[PATCH 3/3] * server/.gitignore: ignore .bundle/ dir

2013-02-28 Thread lutter
From: David Lutterkort --- server/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/server/.gitignore b/server/.gitignore index ead216b..69c8e89 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -4,3 +4,4 @@ log/*.log tmp/* pkg/* *.lock +.bundle/ -- 1.8.1.2

[PATCH 2/3] * tests/test_helper.rb: quietly ignore missing 'turn'

2013-02-28 Thread lutter
From: David Lutterkort --- server/tests/test_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/tests/test_helper.rb b/server/tests/test_helper.rb index 4d5b1ef..61ee26d 100644 --- a/server/tests/test_helper.rb +++ b/server/tests/test_helper.rb @@ -26,7 +26,7 @@

[PATCH 1/3] CIMI (cimi_helper): remove unused code

2013-02-28 Thread lutter
From: David Lutterkort --- server/lib/cimi/helpers/cimi_helper.rb | 24 1 file changed, 24 deletions(-) diff --git a/server/lib/cimi/helpers/cimi_helper.rb b/server/lib/cimi/helpers/cimi_helper.rb index 5e74c2c..e23d819 100644 --- a/server/lib/cimi/helpers/cimi_helper.

Minor cleanup patches

2013-02-28 Thread lutter
These patches address a few small annoyances David

[PATCH] CIMI schema: make it possible to build an array of references

2013-02-26 Thread lutter
From: David Lutterkort It's now possible to say array :things, :ref => CIMI::Model::Target to have an array things where each entry is a TargetRef Fixes https://issues.apache.org/jira/browse/DTACLOUD-499 --- server/lib/cimi/models/base.rb | 19 + server/lib/cimi/mode

[PATCH 9/9] CIMI tests (rmd4_test): simplify the code a little

2013-02-22 Thread lutter
From: David Lutterkort --- tests/cimi/rmd4_test.rb | 68 ++--- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/tests/cimi/rmd4_test.rb b/tests/cimi/rmd4_test.rb index 1d721fc..d08a24d 100644 --- a/tests/cimi/rmd4_test.rb +++ b/tests/cim

[PATCH 8/9] CIMI (MachineCreate): pass initialState to driver

2013-02-22 Thread lutter
From: David Lutterkort --- server/lib/cimi/models/machine_create.rb | 2 ++ server/lib/cimi/models/machine_template.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/server/lib/cimi/models/machine_create.rb b/server/lib/cimi/models/machine_create.rb index c0b107c..0f04c01 100644 --- a/

[PATCH 6/9] CIMI models (VolumeConfig): add missing type attribute

2013-02-22 Thread lutter
From: David Lutterkort --- server/lib/cimi/models/volume_configuration.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/server/lib/cimi/models/volume_configuration.rb b/server/lib/cimi/models/volume_configuration.rb index 7f67051..bf94a3a 100644 --- a/server/lib/cimi/models/volume_configu

[PATCH 7/9] CIMI tests: href on MachineConfig is now a proper attribute

2013-02-22 Thread lutter
From: David Lutterkort Fixes a test failure --- tests/cimi/part3_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cimi/part3_test.rb b/tests/cimi/part3_test.rb index 50e7aae..10243ec 100644 --- a/tests/cimi/part3_test.rb +++ b/tests/cimi/part3_test.rb @@ -67,

[PATCH 3/9] CIMI: Use class.superclass instead of opts[:class]

2013-02-22 Thread lutter
From: Michal Fojtik Under latest MRI 1.9.3 the 'opts[:class]' is not visible to 'find' method and it is reported as 'method missing' With 'class.superclass' we get access to the original class we used to create Ref. Signed-off-by: Michal fojtik TrackedAt: http://tracker.deltacloud.org/patch/a

[PATCH 5/9] CIMI Model: do not trip over Fixnums during validation

2013-02-22 Thread lutter
From: David Lutterkort There's no Fixnum#empty?; convert everything to a String before checking for emptiness. --- server/lib/cimi/models/schema.rb | 2 +- server/tests/cimi/model/resource_spec.rb | 40 2 files changed, 41 insertions(+), 1 deletion(-) c

[PATCH 4/9] CIMI models: move validate! to CIMI::Model::Resource

2013-02-22 Thread lutter
From: David Lutterkort It also needs to be available for collections, which do not derive from Base --- server/lib/cimi/models/base.rb | 7 --- server/lib/cimi/models/resource.rb | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/lib/cimi/models/base.rb b/

Fix test failures

2013-02-22 Thread lutter
The *Create patches seem to have caused quite a bit of test failures. With these patches, both the CIMI unit tests and the blackbox tests pass again. This series also incorporates Michal's earlier patches (patch set 337) David

[PATCH 2/9] CIMI: Added ref_id helper to Base class

2013-02-22 Thread lutter
From: Michal Fojtik The ref_id(url) will extract the last segment of the URL and return it as an 'id'. FIXME: We should use ctx to return the ID of resource properly. Signed-off-by: Michal fojtik TrackedAt: http://tracker.deltacloud.org/patch/90eb17744273b3e64b01808f7692fe57c4cff097 --- serv

[PATCH 1/9] CIMI: Added VolumeCreate model

2013-02-22 Thread lutter
From: Michal Fojtik Signed-off-by: Michal fojtik TrackedAt: http://tracker.deltacloud.org/patch/15544d24bd245a6d5ecee21e0efb3aaa2f3856f2 --- server/lib/cimi/collections/volumes.rb | 3 +- server/lib/cimi/models.rb | 3 +- server/lib/cimi/models/volume.rb

[PATCH 3/4] Encapsulate the test for whether we need a DB in Deltacloud::need_database?

2013-02-19 Thread lutter
From: David Lutterkort --- server/lib/deltacloud_rack.rb | 4 server/lib/initialize.rb | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/lib/deltacloud_rack.rb b/server/lib/deltacloud_rack.rb index 32ff4e8..dbf51fc 100644 --- a/server/lib/deltacloud_rack.

[PATCH 4/4] * tests/test_helper.rb: run all initializers under the test environment

2013-02-19 Thread lutter
From: David Lutterkort This makes it possible to run individual tests again --- server/tests/test_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/tests/test_helper.rb b/server/tests/test_helper.rb index ff16de4..8d8073f 100644 --- a/server/tests/test_he

Make running individual tests possible again

2013-02-19 Thread lutter
The various changes concerning initializers broke running individual tests (e.g., with 'ruby ./tests/cimi/model/machine_spec.rb' These patches shuffle things around so that that works again. David

[PATCH 2/4] * lib/cimi/helpers/database_helper.rb (test_environment?): remove, unused

2013-02-19 Thread lutter
From: David Lutterkort --- server/lib/cimi/helpers/database_helper.rb | 4 1 file changed, 4 deletions(-) diff --git a/server/lib/cimi/helpers/database_helper.rb b/server/lib/cimi/helpers/database_helper.rb index 05fdd81..7e5f99a 100644 --- a/server/lib/cimi/helpers/database_helper.rb +++

[PATCH 1/4] Make configured frontends available as method on Deltacloud

2013-02-19 Thread lutter
From: David Lutterkort --- server/config.ru | 2 +- server/lib/deltacloud_rack.rb | 7 ++- server/lib/initializers/frontend_initialize.rb | 7 --- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/server/config.ru b/server/confi

A couple fixes related to initializers

2013-02-18 Thread lutter
There was a typo in the mock initializer, and the Rakefile needed updating

[PATCH 1/2] * lib/initializers/mock_initialize.rb: fix typo

2013-02-18 Thread lutter
From: David Lutterkort We did not create MOCK_STORAGE_DIR when it was missing --- server/lib/initializers/mock_initialize.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/lib/initializers/mock_initialize.rb b/server/lib/initializers/mock_initialize.rb index c8c

[PATCH 2/2] * Rakefile (mock:fixtures): fix tasks to work with new layout/initializers

2013-02-18 Thread lutter
From: David Lutterkort --- server/Rakefile | 46 +- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/server/Rakefile b/server/Rakefile index 41bd2c1..48fd9f6 100644 --- a/server/Rakefile +++ b/server/Rakefile @@ -46,40 +46,36 @@ Gem::Pac

[PATCH] Entity.ent_properties: make sure we always store a Hash

2013-02-08 Thread lutter
From: David Lutterkort Previously, if you assigned nil to properties, ent_properties would end up being "null" which is not valid JSON. --- server/lib/db/entity.rb | 5 + server/tests/cimi/db/entity_test.rb | 29 + 2 files changed, 34 insertions(+) c

[PATCH 3/3] CIMI: use MachineCreate object

2013-02-07 Thread lutter
From: David Lutterkort Move the logic from Machine.create_from_json and Machine.create_from_xml into MachineCreate --- server/lib/cimi/collections/machines.rb | 7 +--- server/lib/cimi/models/machine.rb| 69 server/lib/cimi/models/machine_create.rb | 29

[PATCH 2/3] CIMI models: add a MachineCreate model

2013-02-07 Thread lutter
From: David Lutterkort --- server/lib/cimi/models.rb | 1 + server/lib/cimi/models/machine_create.rb | 18 +++ server/tests/cimi/model/machine_create_spec.rb | 44 ++ 3 files changed, 63 insertions(+) create mode 100644 server/lib/cimi

[PATCH 1/3] CIMI models: add a 'ref' to the DSL for embedded resources

2013-02-07 Thread lutter
From: David Lutterkort This makes it possible to have a full MachineConfiguration object referenced from a Machinetemplate --- server/lib/cimi/models.rb | 4 +- server/lib/cimi/models/base.rb | 5 +++ server/lib/cimi/models/machine_template.rb

Another take on machine creation

2013-02-07 Thread lutter
These patches represent another take on machine creation from what Michal posted earlier - I've had them lying around for a while, and should have sent them earlier. There are a myriad ways in which an object can be created, especially for machines; I introduced a new 'ref' keyword to the model D

Refactor how DB is used in CIMI

2013-02-06 Thread lutter
The commit message for 2/2 explains most of what this is about. Be warned: you should remove your SQLite DB before using these patches (rm /var/tmp/deltacloud-${USER}-mock/db.sqlite) For now, there is no DB migration (which would mostly consist of rewriting what's in entities.be_kind) I am all f

[PATCH 1/2] CIMI: remove prefilled properties from machine

2013-02-06 Thread lutter
From: David Lutterkort The CIMI spec does not permit providers setting properties on their own. They are strictly for use by the client. --- server/lib/cimi/models/machine.rb | 14 -- 1 file changed, 14 deletions(-) diff --git a/server/lib/cimi/models/machine.rb b/server/lib/cimi/m

[PATCH 2/2] Refactor how CIMI models are stored in the database

2013-02-06 Thread lutter
From: David Lutterkort The 'entities' table now associates entries with CIMI::Model objects rather than backend objects, and treats the DB as a proper look-aside cache. This has the advantage that converting from backend objects is decoupled from looking up the common attributes we store in the

[PATCH 2/3] CIMI unit tests: introduce helper read_data_file

2013-02-05 Thread lutter
From: David Lutterkort --- server/tests/cimi/model/collection_spec.rb| 4 ++-- server/tests/cimi/model/credential_spec.rb| 4 ++-- server/tests/cimi/model/machine_configuration_spec.rb | 4 ++-- server/tests/cimi/model/machine_image_spec.rb | 4 ++-- server/tests/

[PATCH 3/3] CIMI: move deep cloning to CIMI::Model::Schema#deep_clone

2013-02-05 Thread lutter
From: David Lutterkort --- server/lib/cimi/models/resource.rb | 2 +- server/lib/cimi/models/schema.rb | 7 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/lib/cimi/models/resource.rb b/server/lib/cimi/models/resource.rb index 0586538..3271c5e 100644 --- a/server/

A few minor changes

2013-02-05 Thread lutter
These are some very minor cleanup changes. Recorded as http://tracker.deltacloud.org/set/298

[PATCH 1/3] * server/Rakefile: rename task test:cimi:models to test:cimi

2013-02-05 Thread lutter
From: David Lutterkort --- server/Rakefile | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/server/Rakefile b/server/Rakefile index b8b3ea1..5494148 100644 --- a/server/Rakefile +++ b/server/Rakefile @@ -146,8 +146,8 @@ task :test do Rake::Task["moc

Manage some files from our public server

2013-01-23 Thread lutter
None of the files from our public servers are version controlled right now; this patch checks them in and adds a crontab entry for periodically refreshing dev.deltacloud.org. Once this patch is committed, I'll change the server so that the control scripts are simply links to whatever is in git. W

[PATCH] * support: new directory to keep supporting files

2013-01-23 Thread lutter
From: David Lutterkort For now, these are just the most important files from cavia, our public site. --- support/README | 9 ++ support/crontab | 2 ++ support/dev.sh | 17 +++ support/prod.sh | 13 support/ssl.conf | 92 ++

[PATCH 2/2] CIMI tests: make cleanup of machines work

2012-12-11 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb | 42 -- 1 files changed, 20 insertions(+), 22 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index 025a705..45ff6a3 100644 --- a/tests/cimi/test_helper.rb +++ b/tests

[PATCH 1/2] CIMI tests: some fixes for part4

2012-12-11 Thread lutter
From: David Lutterkort * restore getting the volume after creating it, since not all servers return a body from the create request (see fe30257e) * add XML namespace to inline XML * accept 201 and 202 as response from create request --- tests/cimi/part4_test.rb | 27 +++--

[PATCH 09/13] fixup! CIMI tests: add content_type helper

2012-12-05 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index 6d2b79a..b19dd9e 100644 --- a/tests/cimi/test_helper.rb +++ b/tests/cimi/test_helper.rb @@ -355,7 +355,7 @@ m

[PATCH 10/13] CIMI tests: streamline part2

2012-12-05 Thread lutter
From: David Lutterkort Some servers do not return a body for create requests (which is legal) --- tests/cimi/part2_test.rb | 31 +-- 1 files changed, 13 insertions(+), 18 deletions(-) diff --git a/tests/cimi/part2_test.rb b/tests/cimi/part2_test.rb index a70c6ed..6

[PATCH 13/13] * tests/cimi/part3_test.rb: streamline part3

2012-12-05 Thread lutter
From: David Lutterkort Some servers do not return a body for create requests (which is legal) --- tests/cimi/part3_test.rb | 67 -- 1 files changed, 23 insertions(+), 44 deletions(-) diff --git a/tests/cimi/part3_test.rb b/tests/cimi/part3_test.rb i

[PATCH 12/13] CIMI tests: fiddle with log format; dump RestClient traffic in debug level

2012-12-05 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index 9df8000..3605228 100644 --- a/tests/cimi/test_helper.rb +++ b/tests/cimi/test_helper.rb @@ -203,6 +203,8 @@ m

[PATCH 11/13] * tests/cimi/test_helper.rb (retrieve): accomodate responses w/o body

2012-12-05 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index b19dd9e..9df8000 100644 --- a/tests/cimi/test_helper.rb +++ b/tests/cimi/test_helper.rb @@ -163,7 +

[PATCH 08/13] * tests/cimi/cep_test.rb: simplify/correct test for Accept: */*

2012-12-05 Thread lutter
From: David Lutterkort --- tests/cimi/cep_test.rb |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cimi/cep_test.rb b/tests/cimi/cep_test.rb index fcac30d..24e19bf 100644 --- a/tests/cimi/cep_test.rb +++ b/tests/cimi/cep_test.rb @@ -66,7 +66,8 @@ class CloundE

[PATCH 07/13] CIMI tests: add content_type helper to RestClient::Response

2012-12-05 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb |4 ++-- tests/helpers/common.rb |7 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index bb75f51..6d2b79a 100644 --- a/tests/cimi/test_helper.rb +++ b/tes

[PATCH 06/13] CIMI tests: check creations against what the spec allows

2012-12-05 Thread lutter
From: David Lutterkort The spec allows returning status 201 or 202; Location header must be set --- tests/cimi/part2_test.rb |5 +++-- tests/cimi/part3_test.rb |5 +++-- tests/cimi/part4_test.rb |5 +++-- tests/helpers/common.rb |1 + 4 files changed, 10 insertions(+), 6 deletio

[PATCH 05/13] * tests/cimi/cep_test.rb: remove duplicate tests and assertions not required by CIMI

2012-12-05 Thread lutter
From: David Lutterkort --- tests/cimi/cep_test.rb | 26 ++ 1 files changed, 2 insertions(+), 24 deletions(-) diff --git a/tests/cimi/cep_test.rb b/tests/cimi/cep_test.rb index cc488a3..fcac30d 100644 --- a/tests/cimi/cep_test.rb +++ b/tests/cimi/cep_test.rb @@ -45,12 +

[PATCH 04/13] * tests/cimi/test_helper.rb (model_class): assert that resourceURI is set

2012-12-05 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index 0d318bf..bb75f51 100644 --- a/tests/cimi/test_helper.rb +++ b/tests/cimi/test_helper.rb @@ -154,6 +154,7 @@ mo

[PATCH 02/13] * tests/cimi/spec_helper.rb: require json/pure so tests can run individually

2012-12-05 Thread lutter
From: David Lutterkort --- server/tests/cimi/spec_helper.rb |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/server/tests/cimi/spec_helper.rb b/server/tests/cimi/spec_helper.rb index 6ec7b0d..8e86701 100644 --- a/server/tests/cimi/spec_helper.rb +++ b/server/tests/cimi/sp

[PATCH 03/13] CIMI: use a helper to produce correct headers for create responses

2012-12-05 Thread lutter
From: David Lutterkort --- server/lib/cimi/collections/credentials.rb |2 +- server/lib/cimi/collections/machine_templates.rb |3 +-- server/lib/cimi/collections/machines.rb |5 ++--- server/lib/cimi/collections/volumes.rb |3 +-- server/lib/cimi/helpers/

More CIMI fixes

2012-12-05 Thread lutter
Some more fixes to CIMI tests; recorded as http://tracker.deltacloud.orgset/185 This includes the patches I previously sent as 'Handle missing subcollections' (tracker patchset 180) David

[PATCH 01/13] CIMI: tolerate missing subcollections when parsing

2012-12-05 Thread lutter
From: David Lutterkort It is legal to omit subcollections, e.g. in Machine; make sure we process these correctly. --- server/lib/cimi/models/schema.rb|8 ++-- server/tests/cimi/data/machine-minimal.json |7 +++ server/tests/cimi/data/machine-minimal.xml |5 +

[PATCH 2/2] * tests/cimi/spec_helper.rb: require json/pure so tests can run individually

2012-12-04 Thread lutter
From: David Lutterkort --- server/tests/cimi/spec_helper.rb |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/server/tests/cimi/spec_helper.rb b/server/tests/cimi/spec_helper.rb index 6ec7b0d..8e86701 100644 --- a/server/tests/cimi/spec_helper.rb +++ b/server/tests/cimi/sp

Handle missing subcollections

2012-12-04 Thread lutter
Patch 1/2 makes sure we can deserialize bare-bones resources like a Machine with only the mandatory attributes in it. Uploaded as http://tracker.deltacloud.orgset/180 David

[PATCH 1/2] CIMI: tolerate missing subcollections when parsing

2012-12-04 Thread lutter
From: David Lutterkort It is legal to omit subcollections, e.g. in Machine; make sure we process these correctly. --- server/lib/cimi/models/schema.rb|8 ++-- server/tests/cimi/data/machine-minimal.json |7 +++ server/tests/cimi/data/machine-minimal.xml |5 +

[PATCH 5/6] CIMI tests: allow setting the Content-Type header for requests

2012-12-04 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index fccfcbc..e967e55 100644 --- a/tests/cimi/test_helper.rb +++ b/tests/cimi/test_helper.rb @@ -181,12 +181,15

[PATCH 6/6] CIMI tests: use post helper instead of RestClient.post

2012-12-04 Thread lutter
From: David Lutterkort --- tests/cimi/part2_test.rb |7 +++ tests/cimi/part3_test.rb |8 tests/cimi/part4_test.rb | 20 ++-- tests/cimi/part5_test.rb |4 ++-- tests/cimi/test_helper.rb |4 ++-- 5 files changed, 21 insertions(+), 22 deletions(-)

[PATCH 4/6] CIMI tests: add helper for post

2012-12-04 Thread lutter
From: David Lutterkort We need to make sure URL's are properly expanded when providers use relative URL's. Therefore, using Restclient.post directly won't work. --- tests/cimi/test_helper.rb | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/tests/cim

[PATCH 2/6] CIMI: base_uri must end in a slash

2012-12-04 Thread lutter
From: David Lutterkort --- server/lib/cimi/models/cloud_entry_point.rb |2 +- tests/cimi/test_helper.rb |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/lib/cimi/models/cloud_entry_point.rb b/server/lib/cimi/models/cloud_entry_point.rb ind

[PATCH 3/6] CIMI tests: do not send any auth header if no user is set

2012-12-04 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index 009bac6..0e102c4 100644 --- a/tests/cimi/test_helper.rb +++ b/tests/cimi/test_helper.rb @@ -50,6 +5

[PATCH 1/6] CIMI: make CIMI::Model::VolumeImage.find behave like Machine.find

2012-12-04 Thread lutter
From: David Lutterkort --- server/lib/cimi/models/volume.rb | 15 +-- 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb index 7951a99..6a6d42f 100644 --- a/server/lib/cimi/models/volume.rb +++ b/server

A few more CIMI fixes

2012-12-04 Thread lutter
Here are a few more fixes for CIMI that we uncovered today in testing. There's still quite a bit of trouble with running against other providers. One of the sources of headaches is when a provider uses relative URI's everywhere - I added a post helper to make sure we properly translate from relat

[PATCH 2/3] CIMI tests (cep_test): do not accss forwarding_group_templates collection

2012-12-02 Thread lutter
From: David Lutterkort This sends the server into an infnite loop --- tests/cimi/cep_test.rb |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tests/cimi/cep_test.rb b/tests/cimi/cep_test.rb index f764ea2..3c8149d 100644 --- a/tests/cimi/cep_test.rb +++ b/tests/cimi/cep

[PATCH 3/3] Server: make sure we initialize the DB dir and the mock driver's data properly

2012-12-02 Thread lutter
From: David Lutterkort Server startup failed if /var/tmp/deltacloud-mock-$USER failed because the DB initialization code did not create that directory. Creating that directory fooled the logic in the mock driver that determined if the stock data needed to be copied there. --- server/lib/db.rb

A few CIMI fixes

2012-12-02 Thread lutter
These patches address a few things I ran across running the CIMI tests. Patch 2/3 makes cep_test avoid accessing the forwarding_group_templates collection, since that makes the server eat up all available memory (very unpleasant) - I am not sure what the actual issue is, but it seems to happen bef

[PATCH 1/3] CIMI: make CIMI::Model::VolumeImage.find behavie like Machine.find

2012-12-02 Thread lutter
From: David Lutterkort --- server/lib/cimi/models/volume_image.rb | 15 +-- 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/server/lib/cimi/models/volume_image.rb b/server/lib/cimi/models/volume_image.rb index 5052ff5..811d9c9 100644 --- a/server/lib/cimi/models/vol

[PATCH 8/8] CIMI tests: make sure XML responses carry the correct xmlns

2012-11-08 Thread lutter
From: David Lutterkort --- tests/cimi/test_helper.rb |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index 824a5e5..c6d9c0c 100644 --- a/tests/cimi/test_helper.rb +++ b/tests/cimi/test_helper.rb @@ -23,6 +23,9

[PATCH 6/8] CIMI tests: infer the correct model class from the response

2012-11-08 Thread lutter
From: David Lutterkort CIMI responses carry enough information for us to figure out what model class should be used to parse the response. That makes it unnecessary to list the expected model class explicitly --- tests/cimi/cep_test.rb|2 +- tests/cimi/machine_collection_test

  1   2   3   >