summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorAdam Jacob <adam@opscode.com>2009-10-19 22:54:06 -0700
committerAdam Jacob <adam@opscode.com>2009-10-19 22:54:06 -0700
commit2f85186fcc8979c089e44104eb463625ba362d27 (patch)
tree853c4e88663c01ce9e593af1915d36501fdebaec /features
parent19db05a58855537bef42f660907a5e788b7855a3 (diff)
downloadchef-2f85186fcc8979c089e44104eb463625ba362d27.tar.gz
Fixes for 0.7.12->0.8 merge, tests pass
Diffstat (limited to 'features')
-rw-r--r--features/api/clients/list_clients_api.feature2
-rw-r--r--features/api/cookbooks/list_cookbooks_api.feature4
-rw-r--r--features/api/cookbooks/show_cookbook_api.feature4
-rw-r--r--features/api/cookbooks/show_cookbook_attributes_api.feature5
-rw-r--r--features/api/nodes/create_node_api.feature6
-rw-r--r--features/data/roles/role_test.json2
-rw-r--r--features/steps/run_client_steps.rb14
-rw-r--r--features/support/env.rb23
8 files changed, 25 insertions, 35 deletions
diff --git a/features/api/clients/list_clients_api.feature b/features/api/clients/list_clients_api.feature
index 65db88991e..d339428bbf 100644
--- a/features/api/clients/list_clients_api.feature
+++ b/features/api/clients/list_clients_api.feature
@@ -8,7 +8,7 @@ Feature: List clients via the REST API
Given a 'registration' named 'bobo' exists
And there are no clients
When I 'GET' the path '/clients'
- Then the inflated response should be '2' items long
+ Then the inflated response should be '3' items long
Scenario: List clients when one has been created
Given a 'registration' named 'bobo' exists
diff --git a/features/api/cookbooks/list_cookbooks_api.feature b/features/api/cookbooks/list_cookbooks_api.feature
index 10fb455b9c..60a5a3cf4d 100644
--- a/features/api/cookbooks/list_cookbooks_api.feature
+++ b/features/api/cookbooks/list_cookbooks_api.feature
@@ -17,8 +17,4 @@ Feature: List cookbooks via the REST API
When I 'GET' the path '/cookbooks' using a wrong private key
Then I should get a '401 "Unauthorized"' exception
- Scenario: List cookbooks when I am not an admin
- Given a 'registration' named 'not_admin' exists
- When I 'GET' the path '/cookbooks'
- Then I should get a '401 "Unauthorized"' exception
diff --git a/features/api/cookbooks/show_cookbook_api.feature b/features/api/cookbooks/show_cookbook_api.feature
index 770247768b..ff83d1ea7f 100644
--- a/features/api/cookbooks/show_cookbook_api.feature
+++ b/features/api/cookbooks/show_cookbook_api.feature
@@ -26,8 +26,4 @@ Feature: Show a cookbook via the REST API
When I 'GET' the path '/cookbooks/show_cookbook' using a wrong private key
Then I should get a '401 "Unauthorized"' exception
- Scenario: Show a cookbook with as a non-administrator
- Given a 'registration' named 'not_admin' exists
- When I 'GET' the path '/cookbooks/show_cookbook'
- Then I should get a '401 "Unauthorized"' exception
diff --git a/features/api/cookbooks/show_cookbook_attributes_api.feature b/features/api/cookbooks/show_cookbook_attributes_api.feature
index 84226d939a..599321b824 100644
--- a/features/api/cookbooks/show_cookbook_attributes_api.feature
+++ b/features/api/cookbooks/show_cookbook_attributes_api.feature
@@ -19,8 +19,3 @@ Feature: Show a cookbooks attribute files via the REST API
When I 'GET' the path '/cookbooks/show_cookbook/attributes' using a wrong private key
Then I should get a '401 "Unauthorized"' exception
- Scenario: Show a cookbooks attribute files as a non-admin
- Given a 'registration' named 'not_admin' exists
- When I 'GET' the path '/cookbooks/show_cookbook/attributes'
- Then I should get a '401 "Unauthorized"' exception
-
diff --git a/features/api/nodes/create_node_api.feature b/features/api/nodes/create_node_api.feature
index 937dceeee2..1b8cdf5e2f 100644
--- a/features/api/nodes/create_node_api.feature
+++ b/features/api/nodes/create_node_api.feature
@@ -23,9 +23,3 @@ Feature: Create a node via the REST API
When I 'POST' the 'node' to the path '/nodes' using a wrong private key
Then I should get a '401 "Unauthorized"' exception
- Scenario: Create a new node as when I am not an admin
- Given a 'registration' named 'not_admin' exists
- And a 'node' named 'webserver'
- When I 'POST' the 'node' to the path '/nodes'
- Then I should get a '401 "Unauthorized"' exception
-
diff --git a/features/data/roles/role_test.json b/features/data/roles/role_test.json
index 960013ef2d..45f8ae0792 100644
--- a/features/data/roles/role_test.json
+++ b/features/data/roles/role_test.json
@@ -14,4 +14,4 @@
"ossining": "whatever",
"snakes": "on a plane"
}
-} \ No newline at end of file
+}
diff --git a/features/steps/run_client_steps.rb b/features/steps/run_client_steps.rb
index b0a9a40c6b..207ecba5e5 100644
--- a/features/steps/run_client_steps.rb
+++ b/features/steps/run_client_steps.rb
@@ -56,7 +56,7 @@ When /^I run the chef\-client for '(.+)' seconds$/ do |run_for|
end
When /^I run the chef\-client at log level '(.+)'$/ do |log_level|
- @log_level = log_level
+ @log_level = log_level.to_sym
When "I run the chef-client"
end
@@ -76,11 +76,17 @@ log_location File.join(tmpdir, "silly-monkey.log")
file_cache_path File.join(tmpdir, "cache")
ssl_verify_mode :verify_none
registration_url "http://127.0.0.1:4000"
-openid_url "http://127.0.0.1:4001"
+openid_url "http://127.0.0.1:4000"
template_url "http://127.0.0.1:4000"
remotefile_url "http://127.0.0.1:4000"
search_url "http://127.0.0.1:4000"
-couchdb_database 'chef'
+role_url "http://127.0.0.1:4000"
+client_url "http://127.0.0.1:4000"
+chef_server_url "http://127.0.0.1:4000"
+validation_client_name "validator"
+systmpdir = File.expand_path(File.join(Dir.tmpdir, "chef_integration"))
+validation_key File.join(systmpdir, "validation.pem")
+client_key File.join(systmpdir, "client.pem")
CONFIG
@config_file = File.expand_path(File.join(File.dirname(__FILE__), '..', 'data', 'config', 'client-with-logging.rb'))
@@ -91,7 +97,7 @@ CONFIG
self.cleanup_files << @config_file
- @status = Chef::Mixin::Command.popen4("#{File.join(File.dirname(__FILE__), "..", "..", "chef", "bin", "chef-client")} -l #{@log_level} -c #{@config_file} #{@chef_args}") do |p, i, o, e|
+ @status = Chef::Mixin::Command.popen4("#{File.join(File.dirname(__FILE__), "..", "..", "chef", "bin", "chef-client")} -c #{@config_file} #{@chef_args}") do |p, i, o, e|
@stdout = o.gets(nil)
@stderr = e.gets(nil)
end
diff --git a/features/support/env.rb b/features/support/env.rb
index 3821004f5f..03777cab5c 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -1,5 +1,3 @@
-#
-# Author:: Adam Jacob (<adam@opscode.com>)
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
#
@@ -88,6 +86,7 @@ def create_databases
Chef::Certificate.gen_validation_key
Chef::Certificate.gen_validation_key(Chef::Config[:web_ui_client_name], Chef::Config[:web_ui_key])
system("cp #{File.join(Dir.tmpdir, "chef_integration", "validation.pem")} #{Dir.tmpdir}")
+ system("cp #{File.join(Dir.tmpdir, "chef_integration", "webui.pem")} #{Dir.tmpdir}")
end
def prepare_replicas
@@ -101,8 +100,19 @@ def cleanup
if File.exists?(Chef::Config[:validation_key])
File.unlink(Chef::Config[:validation_key])
end
+ if File.exists?(Chef::Config[:web_ui_key])
+ File.unlink(Chef::Config[:web_ui_key])
+ end
end
+Merb.start_environment(
+ :merb_root => File.join(File.dirname(__FILE__), "..", "..", "chef-server"),
+ :testing => true,
+ :adapter => 'runner',
+ :environment => ENV['MERB_ENV'] || 'test',
+ :session_store => 'memory'
+)
+
###
# Pre-testing setup
###
@@ -113,14 +123,6 @@ delete_databases
create_databases
prepare_replicas
-Merb.start_environment(
- :merb_root => File.join(File.dirname(__FILE__), "..", "..", "chef-server"),
- :testing => true,
- :adapter => 'runner',
- :environment => ENV['MERB_ENV'] || 'test',
- :session_store => 'memory'
-)
-
Spec::Runner.configure do |config|
config.include(Merb::Test::ViewHelper)
config.include(Merb::Test::RouteHelper)
@@ -171,6 +173,7 @@ World(ChefWorld)
Before do
system("mkdir -p #{tmpdir}")
system("cp -r #{File.join(Dir.tmpdir, "validation.pem")} #{File.join(tmpdir, "validation.pem")}")
+ system("cp -r #{File.join(Dir.tmpdir, "webui.pem")} #{File.join(tmpdir, "webui.pem")}")
Chef::CouchDB.new(Chef::Config[:couchdb_url], "chef_integration").create_db
c = Chef::REST.new(Chef::Config[:couchdb_url], nil, nil)
c.post_rest("_replicate", {