summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorAdam Jacob <adam@opscode.com>2009-09-12 19:25:04 -0700
committerAdam Jacob <adam@opscode.com>2009-09-12 19:25:04 -0700
commit33f3664259c1cc27006c50e373cad06b810915d1 (patch)
tree0496b6b6978d55e56de7c85c041bde1853a06d0f /features
parenta54a032816261c16dc716de8f77a9d1fb3ce04a9 (diff)
downloadchef-33f3664259c1cc27006c50e373cad06b810915d1.tar.gz
Client registration working, test suite fixes.
Diffstat (limited to 'features')
-rw-r--r--features/support/env.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/features/support/env.rb b/features/support/env.rb
index 8690680783..2a9d373bfb 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -27,7 +27,9 @@ require 'chef/config'
require 'chef/client'
require 'chef/data_bag'
require 'chef/data_bag_item'
+require 'chef/api_client'
require 'chef/solr'
+require 'chef/certificate'
require 'tmpdir'
require 'merb-core'
require 'merb_cucumber/world/webrat'
@@ -74,17 +76,15 @@ def create_databases
Chef::Log.info("Creating bootstrap databases")
cdb = Chef::CouchDB.new(Chef::Config[:couchdb_url], "chef_integration")
cdb.create_db
+ cdb.create_id_map
Chef::Node.create_design_document
Chef::Role.create_design_document
Chef::DataBag.create_design_document
+ Chef::ApiClient.create_design_document
Chef::Role.sync_from_disk_to_couchdb
-end
-
-def create_validation
-# TODO: Create the validation certificate here
-# File.open("#{Dir.tmpdir}/validation.pem", "w") do |f|
-# f.print response["private_key"]
-# end
+ Chef::Certificate.generate_signing_ca
+ Chef::Certificate.gen_validation_key
+ system("cp #{File.join(Dir.tmpdir, "chef_integration", "validation.pem")} #{Dir.tmpdir}")
end
def prepare_replicas
@@ -95,7 +95,9 @@ def prepare_replicas
end
def cleanup
- File.unlink(File.join(Dir.tmpdir, "validation.pem"))
+ if File.exists?(Chef::Config[:validation_key])
+ File.unlink(Chef::Config[:validation_key])
+ end
end
###
@@ -106,7 +108,6 @@ setup_nanite
cleanup
delete_databases
create_databases
-create_validation
prepare_replicas
Merb.start_environment(