0
我想寫一個ServerSpec測試運行部署的實例。以下是相關測試:廚師ServerSpec主機資源不工作
require 'spec_helper'
describe service('nginx') do
it { should be_enabled }
it { should be_running }
end
describe port(80) do
it { should be_listening }
end
describe port(8085) do
it { should be_listening }
end
describe host('localhost') do
it { should be_reachable.with(:port => 8085, :proto => 'tcp') }
end
當我嘗試運行這個測試我第一次發現,未安裝NCAT(Centos的7最低)。我安裝了包,現在當我嘗試運行測試,我得到如下回應:
Failures:
1) Host "localhost" should be reachable
Failure/Error: it { should be_reachable.with(:port => 8085, :proto => 'tcp') }
expected Host "localhost" to be reachable
/bin/sh -c nc\ -vvvvzt\ localhost\ 8085\ -w\ 5
nc: invalid option -- 'z'
Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING.
# /tmp/busser/suites/serverspec/localhost/nginx_spec.rb:17:in `block (2 levels) in <top (required)>'
Finished in 0.08179 seconds (files took 0.2021 seconds to load)
5 examples, 1 failure
這只是ServerSpec一個錯誤?有沒有已知的解決方法?
我覺得這樣的事情需要完成。感謝您瞭解當前情況的進一步背景。 – localhostv6 2014-10-07 20:48:45