spec/solaris/commands_spec.rb in serverspec-0.2.21 vs spec/solaris/commands_spec.rb in serverspec-0.2.22
- old
+ new
@@ -8,15 +8,30 @@
describe 'check_file', :os => :solaris do
subject { commands.check_file('/etc/passwd') }
it { should eq 'test -f /etc/passwd' }
end
-describe 'check_mounted', :os => :debian do
+describe 'check_mounted', :os => :solaris do
subject { commands.check_mounted('/') }
it { should eq "mount | grep -w 'on /'" }
end
-describe 'check_resolvable', :os => :debian do
+describe 'check_reachable', :os => :solaris do
+ context "connect with name from /etc/services to localhost" do
+ subject { commands.check_reachable('localhost', 'ssh', 'tcp', 1) }
+ it { should eq "nc -vvvvzt localhost ssh -w 1" }
+ end
+ context "connect with ip and port 11111 and timeout of 5" do
+ subject { commands.check_reachable('127.0.0.1', '11111', 'udp', 5) }
+ it { should eq "nc -vvvvzu 127.0.0.1 11111 -w 5" }
+ end
+ context "do a ping" do
+ subject { commands.check_reachable('127.0.0.1', nil, 'icmp', 1) }
+ it { should eq "ping -n 127.0.0.1 -w 1 -c 2" }
+ end
+end
+
+describe 'check_resolvable', :os => :solaris do
context "resolve localhost by hosts" do
subject { commands.check_resolvable('localhost', 'hosts') }
it { should eq "grep -w localhost /etc/hosts" }
end
context "resolve localhost by dns" do