summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-06-30 10:42:22 -0700
committerJohn Keiser <jkeiser@opscode.com>2014-07-07 10:04:59 -0700
commitad002dda71f14ee0e6c9f45d6c97e42972212859 (patch)
treec44e943f44458e556b17852fe279b4dcb6e8dc94
parentc5956378e9035af7f05e1be1c7741b50de7eb84c (diff)
downloadchef-ad002dda71f14ee0e6c9f45d6c97e42972212859.tar.gz
Allow Pedant to run if port 8889 is blocked
-rw-r--r--spec/support/pedant/pedant_config.rb3
-rw-r--r--spec/support/pedant/run_pedant.rb3
2 files changed, 4 insertions, 2 deletions
diff --git a/spec/support/pedant/pedant_config.rb b/spec/support/pedant/pedant_config.rb
index 7c9ddd73f1..6818d29d74 100644
--- a/spec/support/pedant/pedant_config.rb
+++ b/spec/support/pedant/pedant_config.rb
@@ -21,7 +21,8 @@
################################################################################
# You MUST specify the address of the server the API requests will be
# sent to. Only specify protocol, hostname, and port.
-chef_server 'http://127.0.0.1:8889'
+# NOTE this is assigned in run_pedant.rb, because it's possible 8889 will not be the port chosen.
+#chef_server 'http://127.0.0.1:8889'
# If you are doing development testing, you can specify the address of
# the Solr server. The presence of this parameter will enable tests
diff --git a/spec/support/pedant/run_pedant.rb b/spec/support/pedant/run_pedant.rb
index 7764266afe..026ae176a6 100644
--- a/spec/support/pedant/run_pedant.rb
+++ b/spec/support/pedant/run_pedant.rb
@@ -26,7 +26,7 @@ def start_server(chef_repo_path)
chef_fs = Chef::ChefFS::Config.new.local_fs
data_store = Chef::ChefFS::ChefFSDataStore.new(chef_fs)
data_store = ChefZero::DataStore::V1ToV2Adapter.new(data_store, 'chef', :org_defaults => ChefZero::DataStore::V1ToV2Adapter::ORG_DEFAULTS)
- server = ChefZero::Server.new(:port => 8889, :data_store => data_store)#, :log_level => :debug)
+ server = ChefZero::Server.new(:port => 8889.upto(9999), :data_store => data_store)#, :log_level => :debug)
server.start_background
server
end
@@ -46,6 +46,7 @@ begin
Pedant.config.suite = 'api'
Pedant.config[:config_file] = 'spec/support/pedant/pedant_config.rb'
+ Pedant.config.chef_server = server.url
Pedant.setup([
'--skip-knife',
'--skip-validation',