spec/solaris/commands_spec.rb in serverspec-0.6.16 vs spec/solaris/commands_spec.rb in serverspec-0.6.17

- old
+ new

@@ -16,19 +16,17 @@ it_behaves_like 'support command check_installed_by_pecl', 'mongo' it_behaves_like 'support command check_installed_by_pecl with_version', 'mongo', '1.4.1' it_behaves_like 'support command check_mounted', '/' - it_behaves_like 'support command check_routing_table', '192.168.100.1/24' - it_behaves_like 'support command check_resolvable' - it_behaves_like 'support command check_user', 'root' it_behaves_like 'support command check_user', 'wheel' it_behaves_like 'support command check_file_md5checksum', '/etc/passewd', '96c8c50f81a29965f7af6de371ab4250' it_behaves_like 'support command check_running_under_supervisor', 'httpd' + it_behaves_like 'support command check_monitored_by_monit', 'unicorn' it_behaves_like 'support command check_process', 'httpd' it_behaves_like 'support command check_file_contain', '/etc/passwd', 'root' it_behaves_like 'support command check_mode', '/etc/sudoers', 440 @@ -82,32 +80,15 @@ subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/', '/^end/') } it { should eq "sed -n /\\^group\\ :test\\ do/,/\\^end/p Gemfile | grep -q -- rspec /dev/stdin" } end end -describe 'check_listening' do - subject { commands.check_listening(80) } - it { should eq "netstat -an 2> /dev/null | egrep 'LISTEN|Idle' | grep -- .80\\ " } -end - describe 'check_running' do subject { commands.check_running('httpd') } it { should eq "svcs -l httpd status 2> /dev/null |grep -wx '^state.*online$'" } end -describe 'check_cron_entry' do - context 'specify root user' do - subject { commands.check_cron_entry('root', '* * * * * /usr/local/bin/batch.sh') } - it { should eq 'crontab -l root | grep -- \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ /usr/local/bin/batch.sh' } - end - - context 'no specified user' do - subject { commands.check_cron_entry(nil, '* * * * * /usr/local/bin/batch.sh') } - it { should eq 'crontab -l | grep -- \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ /usr/local/bin/batch.sh' } - end -end - describe 'check_belonging_group' do subject { commands.check_belonging_group('root', 'wheel') } it { should eq "id -Gn root | grep -- wheel" } end @@ -170,22 +151,7 @@ end context 'execute access' do subject {commands.check_access_by_user '/tmp/somethingx', 'dummyuser3', 'x'} it { should eq 'su dummyuser3 -c "test -x /tmp/somethingx"' } - end -end - -describe 'check_reachable' do - context "connect with name from /etc/services to localhost" do - subject { commands.check_reachable('localhost', 'ssh', 'tcp', 1) } - it { should eq "nc -vvvvzt -w 1 localhost ssh" } - 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 -w 5 127.0.0.1 11111" } - 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 1" } end end