serverspec 1.16.0 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/Rakefile +20 -25
- data/lib/serverspec.rb +0 -3
- data/lib/serverspec/helper/os.rb +0 -3
- data/lib/serverspec/helper/type.rb +3 -3
- data/lib/serverspec/matchers.rb +1 -7
- data/lib/serverspec/matchers/have_rule.rb +1 -1
- data/lib/serverspec/setup.rb +12 -11
- data/lib/serverspec/type/file.rb +0 -15
- data/lib/serverspec/type/iis_app_pool.rb +0 -28
- data/lib/serverspec/type/iis_website.rb +0 -12
- data/lib/serverspec/type/interface.rb +0 -3
- data/lib/serverspec/type/user.rb +0 -4
- data/lib/serverspec/version.rb +1 -1
- data/serverspec.gemspec +4 -3
- data/wercker.yml +9 -9
- metadata +36 -471
- data/lib/serverspec/matchers/belong_to_primary_group.rb +0 -5
- data/lib/serverspec/matchers/have_site_application.rb +0 -18
- data/lib/serverspec/matchers/have_site_bindings.rb +0 -22
- data/lib/serverspec/matchers/have_virtual_dir.rb +0 -14
- data/lib/serverspec/type/ip6tables.rb +0 -13
- data/lib/serverspec/type/ppa.rb +0 -13
- data/lib/serverspec/type/windows_scheduled_task.rb +0 -9
- data/spec/aix/command_spec.rb +0 -65
- data/spec/aix/cron_spec.rb +0 -21
- data/spec/aix/default_gateway_spec.rb +0 -16
- data/spec/aix/file_spec.rb +0 -404
- data/spec/aix/group_spec.rb +0 -21
- data/spec/aix/host_spec.rb +0 -58
- data/spec/aix/package_spec.rb +0 -100
- data/spec/aix/php_config_spec.rb +0 -36
- data/spec/aix/port_spec.rb +0 -30
- data/spec/aix/process_spec.rb +0 -29
- data/spec/aix/routing_table_spec.rb +0 -120
- data/spec/aix/service_spec.rb +0 -93
- data/spec/aix/user_spec.rb +0 -57
- data/spec/arch/file_spec.rb +0 -413
- data/spec/arch/package_spec.rb +0 -100
- data/spec/arch/service_spec.rb +0 -84
- data/spec/backend/cmd/configuration_spec.rb +0 -9
- data/spec/backend/exec/configuration_spec.rb +0 -61
- data/spec/backend/powershell/script_helper_spec.rb +0 -105
- data/spec/backend/ssh/configuration_spec.rb +0 -184
- data/spec/backend/winrm/configuration_spec.rb +0 -9
- data/spec/darwin/command_spec.rb +0 -65
- data/spec/darwin/cron_spec.rb +0 -21
- data/spec/darwin/default_gateway_spec.rb +0 -16
- data/spec/darwin/file_spec.rb +0 -413
- data/spec/darwin/group_spec.rb +0 -21
- data/spec/darwin/host_spec.rb +0 -58
- data/spec/darwin/mail_alias_spec.rb +0 -12
- data/spec/darwin/package_spec.rb +0 -82
- data/spec/darwin/php_config_spec.rb +0 -36
- data/spec/darwin/port_spec.rb +0 -30
- data/spec/darwin/process_spec.rb +0 -29
- data/spec/darwin/routing_table_spec.rb +0 -120
- data/spec/darwin/service_spec.rb +0 -91
- data/spec/darwin/user_spec.rb +0 -57
- data/spec/debian/cgroup_spec.rb +0 -14
- data/spec/debian/command_spec.rb +0 -65
- data/spec/debian/cron_spec.rb +0 -21
- data/spec/debian/default_gateway_spec.rb +0 -16
- data/spec/debian/file_spec.rb +0 -413
- data/spec/debian/group_spec.rb +0 -22
- data/spec/debian/host_spec.rb +0 -58
- data/spec/debian/interface_spec.rb +0 -24
- data/spec/debian/ip6tables_spec.rb +0 -21
- data/spec/debian/iptables_spec.rb +0 -21
- data/spec/debian/kernel_module_spec.rb +0 -12
- data/spec/debian/linux_kernel_parameter_spec.rb +0 -36
- data/spec/debian/lxc_spec.rb +0 -22
- data/spec/debian/mail_alias_spec.rb +0 -12
- data/spec/debian/package_spec.rb +0 -130
- data/spec/debian/php_config_spec.rb +0 -36
- data/spec/debian/port_spec.rb +0 -40
- data/spec/debian/process_spec.rb +0 -29
- data/spec/debian/routing_table_spec.rb +0 -120
- data/spec/debian/selinux_spec.rb +0 -18
- data/spec/debian/service_spec.rb +0 -93
- data/spec/debian/user_spec.rb +0 -57
- data/spec/debian/zfs_spec.rb +0 -18
- data/spec/fedora/cgroup_spec.rb +0 -14
- data/spec/fedora/command_spec.rb +0 -67
- data/spec/fedora/cron_spec.rb +0 -21
- data/spec/fedora/default_gateway_spec.rb +0 -16
- data/spec/fedora/file_spec.rb +0 -413
- data/spec/fedora/group_spec.rb +0 -21
- data/spec/fedora/host_spec.rb +0 -58
- data/spec/fedora/interface_spec.rb +0 -24
- data/spec/fedora/ip6tables_spec.rb +0 -21
- data/spec/fedora/iptables_spec.rb +0 -21
- data/spec/fedora/kernel_module_spec.rb +0 -12
- data/spec/fedora/linux_kernel_parameter_spec.rb +0 -36
- data/spec/fedora/lxc_spec.rb +0 -22
- data/spec/fedora/mail_alias_spec.rb +0 -12
- data/spec/fedora/package_spec.rb +0 -118
- data/spec/fedora/php_config_spec.rb +0 -36
- data/spec/fedora/port_spec.rb +0 -30
- data/spec/fedora/process_spec.rb +0 -41
- data/spec/fedora/routing_table_spec.rb +0 -120
- data/spec/fedora/selinux_spec.rb +0 -18
- data/spec/fedora/user_spec.rb +0 -57
- data/spec/fedora/yumrepo_spec.rb +0 -25
- data/spec/fedora/zfs_spec.rb +0 -18
- data/spec/freebsd/command_spec.rb +0 -65
- data/spec/freebsd/cron_spec.rb +0 -21
- data/spec/freebsd/default_gateway_spec.rb +0 -16
- data/spec/freebsd/file_spec.rb +0 -385
- data/spec/freebsd/group_spec.rb +0 -21
- data/spec/freebsd/host_spec.rb +0 -58
- data/spec/freebsd/package_spec.rb +0 -96
- data/spec/freebsd/php_config_spec.rb +0 -36
- data/spec/freebsd/port_spec.rb +0 -30
- data/spec/freebsd/process_spec.rb +0 -29
- data/spec/freebsd/routing_table_spec.rb +0 -120
- data/spec/freebsd/service_spec.rb +0 -93
- data/spec/freebsd/user_spec.rb +0 -57
- data/spec/freebsd10/package_spec.rb +0 -13
- data/spec/gentoo/cgroup_spec.rb +0 -14
- data/spec/gentoo/command_spec.rb +0 -65
- data/spec/gentoo/cron_spec.rb +0 -21
- data/spec/gentoo/default_gateway_spec.rb +0 -16
- data/spec/gentoo/file_spec.rb +0 -413
- data/spec/gentoo/group_spec.rb +0 -21
- data/spec/gentoo/host_spec.rb +0 -58
- data/spec/gentoo/interface_spec.rb +0 -24
- data/spec/gentoo/ip6tables_spec.rb +0 -21
- data/spec/gentoo/iptables_spec.rb +0 -21
- data/spec/gentoo/kernel_module_spec.rb +0 -12
- data/spec/gentoo/linux_kernel_parameter_spec.rb +0 -36
- data/spec/gentoo/lxc_spec.rb +0 -22
- data/spec/gentoo/mail_alias_spec.rb +0 -12
- data/spec/gentoo/package_spec.rb +0 -91
- data/spec/gentoo/php_config_spec.rb +0 -36
- data/spec/gentoo/port_spec.rb +0 -30
- data/spec/gentoo/process_spec.rb +0 -29
- data/spec/gentoo/routing_table_spec.rb +0 -120
- data/spec/gentoo/selinux_spec.rb +0 -18
- data/spec/gentoo/service_spec.rb +0 -93
- data/spec/gentoo/user_spec.rb +0 -57
- data/spec/gentoo/zfs_spec.rb +0 -18
- data/spec/nixos/file_spec.rb +0 -421
- data/spec/nixos/package_spec.rb +0 -109
- data/spec/nixos/service_spec.rb +0 -40
- data/spec/plamo/cgroup_spec.rb +0 -14
- data/spec/plamo/command_spec.rb +0 -65
- data/spec/plamo/cron_spec.rb +0 -21
- data/spec/plamo/default_gateway_spec.rb +0 -16
- data/spec/plamo/file_spec.rb +0 -413
- data/spec/plamo/group_spec.rb +0 -22
- data/spec/plamo/host_spec.rb +0 -58
- data/spec/plamo/interface_spec.rb +0 -24
- data/spec/plamo/ip6tables_spec.rb +0 -21
- data/spec/plamo/iptables_spec.rb +0 -21
- data/spec/plamo/kernel_module_spec.rb +0 -12
- data/spec/plamo/linux_kernel_parameter_spec.rb +0 -36
- data/spec/plamo/lxc_spec.rb +0 -22
- data/spec/plamo/mail_alias_spec.rb +0 -12
- data/spec/plamo/package_spec.rb +0 -100
- data/spec/plamo/php_config_spec.rb +0 -36
- data/spec/plamo/port_spec.rb +0 -30
- data/spec/plamo/routing_table_spec.rb +0 -120
- data/spec/plamo/selinux_spec.rb +0 -18
- data/spec/plamo/service_spec.rb +0 -84
- data/spec/plamo/user_spec.rb +0 -57
- data/spec/plamo/zfs_spec.rb +0 -18
- data/spec/redhat/cgroup_spec.rb +0 -14
- data/spec/redhat/command_spec.rb +0 -67
- data/spec/redhat/cron_spec.rb +0 -21
- data/spec/redhat/default_gateway_spec.rb +0 -16
- data/spec/redhat/file_spec.rb +0 -418
- data/spec/redhat/group_spec.rb +0 -21
- data/spec/redhat/host_spec.rb +0 -64
- data/spec/redhat/interface_spec.rb +0 -24
- data/spec/redhat/ip6tables_spec.rb +0 -21
- data/spec/redhat/iptables_spec.rb +0 -21
- data/spec/redhat/kernel_module_spec.rb +0 -12
- data/spec/redhat/linux_kernel_parameter_spec.rb +0 -36
- data/spec/redhat/lxc_spec.rb +0 -22
- data/spec/redhat/mail_alias_spec.rb +0 -12
- data/spec/redhat/package_spec.rb +0 -118
- data/spec/redhat/php_config_spec.rb +0 -36
- data/spec/redhat/port_spec.rb +0 -30
- data/spec/redhat/process_spec.rb +0 -41
- data/spec/redhat/routing_table_spec.rb +0 -120
- data/spec/redhat/selinux_spec.rb +0 -18
- data/spec/redhat/service_spec.rb +0 -93
- data/spec/redhat/user_spec.rb +0 -57
- data/spec/redhat/yumrepo_spec.rb +0 -25
- data/spec/redhat/zfs_spec.rb +0 -18
- data/spec/redhat7/service_spec.rb +0 -21
- data/spec/smartos/mail_alias_spec.rb +0 -12
- data/spec/smartos/process_spec.rb +0 -29
- data/spec/solaris/command_spec.rb +0 -65
- data/spec/solaris/cron_spec.rb +0 -21
- data/spec/solaris/default_gateway_spec.rb +0 -16
- data/spec/solaris/file_spec.rb +0 -413
- data/spec/solaris/group_spec.rb +0 -21
- data/spec/solaris/host_spec.rb +0 -58
- data/spec/solaris/ipfilter_spec.rb +0 -8
- data/spec/solaris/ipnat_spec.rb +0 -8
- data/spec/solaris/mail_alias_spec.rb +0 -12
- data/spec/solaris/package_spec.rb +0 -100
- data/spec/solaris/php_config_spec.rb +0 -36
- data/spec/solaris/port_spec.rb +0 -30
- data/spec/solaris/process_spec.rb +0 -29
- data/spec/solaris/routing_table_spec.rb +0 -120
- data/spec/solaris/service_spec.rb +0 -93
- data/spec/solaris/svcprop_spec.rb +0 -13
- data/spec/solaris/user_spec.rb +0 -57
- data/spec/solaris/zfs_spec.rb +0 -18
- data/spec/solaris10/file_spec.rb +0 -395
- data/spec/solaris10/group_spec.rb +0 -21
- data/spec/solaris10/mail_alias_spec.rb +0 -12
- data/spec/solaris10/package_spec.rb +0 -85
- data/spec/solaris10/php_config_spec.rb +0 -36
- data/spec/solaris10/user_spec.rb +0 -57
- data/spec/solaris11/command_spec.rb +0 -65
- data/spec/solaris11/cron_spec.rb +0 -21
- data/spec/solaris11/default_gateway_spec.rb +0 -16
- data/spec/solaris11/file_spec.rb +0 -413
- data/spec/solaris11/group_spec.rb +0 -21
- data/spec/solaris11/host_spec.rb +0 -58
- data/spec/solaris11/ipfilter_spec.rb +0 -8
- data/spec/solaris11/ipnat_spec.rb +0 -8
- data/spec/solaris11/mail_alias_spec.rb +0 -12
- data/spec/solaris11/package_spec.rb +0 -100
- data/spec/solaris11/php_config_spec.rb +0 -36
- data/spec/solaris11/port_spec.rb +0 -12
- data/spec/solaris11/routing_table_spec.rb +0 -120
- data/spec/solaris11/service_spec.rb +0 -93
- data/spec/solaris11/svcprop_spec.rb +0 -13
- data/spec/solaris11/user_spec.rb +0 -57
- data/spec/solaris11/zfs_spec.rb +0 -18
- data/spec/support/powershell_command_runner.rb +0 -52
- data/spec/ubuntu/ppa_spec.rb +0 -25
- data/spec/windows/command_spec.rb +0 -67
- data/spec/windows/file_spec.rb +0 -161
- data/spec/windows/group_spec.rb +0 -28
- data/spec/windows/port_spec.rb +0 -31
- data/spec/windows/service_spec.rb +0 -31
- data/spec/windows/user_spec.rb +0 -44
- data/spec/windows/windows_hot_fix_spec.rb +0 -25
- data/spec/windows/windows_registry_key_spec.rb +0 -66
data/spec/darwin/group_spec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
describe group('root') do
|
6
|
-
it { should exist }
|
7
|
-
its(:command) { should eq "getent group root" }
|
8
|
-
end
|
9
|
-
|
10
|
-
describe group('invalid-group') do
|
11
|
-
it { should_not exist }
|
12
|
-
end
|
13
|
-
|
14
|
-
describe group('root') do
|
15
|
-
it { should have_gid 0 }
|
16
|
-
its(:command) { should eq "getent group | grep -w -- \\^root | cut -f 3 -d ':' | grep -w -- 0" }
|
17
|
-
end
|
18
|
-
|
19
|
-
describe group('root') do
|
20
|
-
it { should_not have_gid 'invalid-gid' }
|
21
|
-
end
|
data/spec/darwin/host_spec.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
describe host('127.0.0.1') do
|
6
|
-
it { should be_resolvable }
|
7
|
-
its(:command) { should eq "getent hosts 127.0.0.1" }
|
8
|
-
end
|
9
|
-
|
10
|
-
describe host('invalid-name') do
|
11
|
-
it { should_not be_resolvable }
|
12
|
-
end
|
13
|
-
|
14
|
-
describe host('127.0.0.1') do
|
15
|
-
it { should be_resolvable.by('hosts') }
|
16
|
-
its(:command) { should eq "grep -w -- 127.0.0.1 /etc/hosts" }
|
17
|
-
end
|
18
|
-
|
19
|
-
describe host('invalid-name') do
|
20
|
-
it { should_not be_resolvable.by('hosts') }
|
21
|
-
end
|
22
|
-
|
23
|
-
describe host('127.0.0.1') do
|
24
|
-
it { should be_resolvable.by('dns') }
|
25
|
-
its(:command) { should eq "nslookup -timeout=1 127.0.0.1" }
|
26
|
-
end
|
27
|
-
|
28
|
-
describe host('invalid-name') do
|
29
|
-
it { should_not be_resolvable.by('dns') }
|
30
|
-
end
|
31
|
-
|
32
|
-
describe host('127.0.0.1') do
|
33
|
-
it { should be_reachable }
|
34
|
-
its(:command) { should eq "ping -w 5 -c 2 -n 127.0.0.1" }
|
35
|
-
end
|
36
|
-
|
37
|
-
describe host('invalid-host') do
|
38
|
-
it { should_not be_reachable }
|
39
|
-
end
|
40
|
-
|
41
|
-
describe host('127.0.0.1') do
|
42
|
-
it { should be_reachable.with(:proto => "icmp", :timeout=> 1) }
|
43
|
-
its(:command) { should eq "ping -w 1 -c 2 -n 127.0.0.1" }
|
44
|
-
end
|
45
|
-
|
46
|
-
describe host('127.0.0.1') do
|
47
|
-
it { should be_reachable.with(:proto => "tcp", :port => 22, :timeout=> 1) }
|
48
|
-
its(:command) { should eq "nc -vvvvzt 127.0.0.1 22 -w 1" }
|
49
|
-
end
|
50
|
-
|
51
|
-
describe host('127.0.0.1') do
|
52
|
-
it { should be_reachable.with(:proto => "udp", :port => 53, :timeout=> 1) }
|
53
|
-
its(:command) { should eq "nc -vvvvzu 127.0.0.1 53 -w 1" }
|
54
|
-
end
|
55
|
-
|
56
|
-
describe host('invalid-host') do
|
57
|
-
it { should_not be_reachable.with(:proto => "udp", :port => 53, :timeout=> 1) }
|
58
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
describe mail_alias('daemon') do
|
6
|
-
it { should be_aliased_to "root" }
|
7
|
-
its(:command) { should eq "getent aliases daemon | grep -- \\[\\[:space:\\]\\]root$" }
|
8
|
-
end
|
9
|
-
|
10
|
-
describe mail_alias('invalid-recipient') do
|
11
|
-
it { should_not be_aliased_to "foo" }
|
12
|
-
end
|
data/spec/darwin/package_spec.rb
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
describe package('jekyll') do
|
6
|
-
it { should be_installed.by('gem') }
|
7
|
-
its(:command) { should eq "gem list --local | grep -w -- \\^jekyll" }
|
8
|
-
end
|
9
|
-
|
10
|
-
describe package('invalid-gem') do
|
11
|
-
it { should_not be_installed.by('gem') }
|
12
|
-
end
|
13
|
-
|
14
|
-
describe package('jekyll') do
|
15
|
-
it { should be_installed.by('gem').with_version('1.1.1') }
|
16
|
-
its(:command) { should eq "gem list --local | grep -w -- \\^jekyll | grep -w -- 1.1.1" }
|
17
|
-
end
|
18
|
-
|
19
|
-
describe package('jekyll') do
|
20
|
-
it { should_not be_installed.by('gem').with_version('invalid-version') }
|
21
|
-
end
|
22
|
-
|
23
|
-
describe package('bower') do
|
24
|
-
it { should be_installed.by('npm') }
|
25
|
-
its(:command) { should eq "npm ls bower -g" }
|
26
|
-
end
|
27
|
-
|
28
|
-
describe package('invalid-npm-package') do
|
29
|
-
it { should_not be_installed.by('npm') }
|
30
|
-
end
|
31
|
-
|
32
|
-
describe package('bower') do
|
33
|
-
it { should be_installed.by('npm').with_version('0.9.2') }
|
34
|
-
its(:command) { should eq "npm ls bower -g | grep -w -- 0.9.2" }
|
35
|
-
end
|
36
|
-
|
37
|
-
describe package('bower') do
|
38
|
-
it { should_not be_installed.by('npm').with_version('invalid-version') }
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
describe package('mongo') do
|
43
|
-
it { should be_installed.by('pecl') }
|
44
|
-
its(:command) { should eq "pecl list | grep -w -- \\^mongo" }
|
45
|
-
end
|
46
|
-
|
47
|
-
describe package('invalid-pecl') do
|
48
|
-
it { should_not be_installed.by('pecl') }
|
49
|
-
end
|
50
|
-
|
51
|
-
describe package('mongo') do
|
52
|
-
it { should be_installed.by('pecl').with_version('1.4.1') }
|
53
|
-
its(:command) { should eq "pecl list | grep -w -- \\^mongo | grep -w -- 1.4.1" }
|
54
|
-
end
|
55
|
-
|
56
|
-
describe package('mongo') do
|
57
|
-
it { should_not be_installed.by('pecl').with_version('invalid-version') }
|
58
|
-
end
|
59
|
-
|
60
|
-
describe package('XML_Util') do
|
61
|
-
it { should be_installed.by('pear').with_version('1.2.1') }
|
62
|
-
its(:command) { should eq "pear list | grep -w -- \\^XML_Util | grep -w -- 1.2.1" }
|
63
|
-
end
|
64
|
-
|
65
|
-
describe package('supervisor') do
|
66
|
-
it { should be_installed.by('pip').with_version('3.0') }
|
67
|
-
its(:command) { should eq "pip list | grep -w -- \\^supervisor | grep -w -- 3.0" }
|
68
|
-
end
|
69
|
-
|
70
|
-
describe package('invalid-pip') do
|
71
|
-
it { should_not be_installed.by('pip').with_version('invalid-version') }
|
72
|
-
end
|
73
|
-
|
74
|
-
describe package('App::Ack') do
|
75
|
-
it { should be_installed.by('cpan') }
|
76
|
-
its(:command) { should eq "cpan -l | grep -w -- \\^App::Ack" }
|
77
|
-
end
|
78
|
-
|
79
|
-
describe package('App::Ack') do
|
80
|
-
it { should be_installed.by('cpan').with_version('2.04') }
|
81
|
-
its(:command) { should eq "cpan -l | grep -w -- \\^App::Ack | grep -w -- 2.04" }
|
82
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
describe php_config('default_mimetype') do
|
6
|
-
let(:stdout) { 'text/html' }
|
7
|
-
its(:value) { should eq 'text/html' }
|
8
|
-
its(:command) { should eq "php -r 'echo get_cfg_var( \"default_mimetype\" );'" }
|
9
|
-
end
|
10
|
-
|
11
|
-
describe php_config('default_mimetype') do
|
12
|
-
let(:stdout) { 'text/html' }
|
13
|
-
its(:value) { should_not eq 'text/plain' }
|
14
|
-
end
|
15
|
-
|
16
|
-
describe php_config('session.cache_expire') do
|
17
|
-
let(:stdout) { '180' }
|
18
|
-
its(:value) { should eq 180 }
|
19
|
-
its(:command) { should eq "php -r 'echo get_cfg_var( \"session.cache_expire\" );'" }
|
20
|
-
end
|
21
|
-
|
22
|
-
describe php_config('session.cache_expire') do
|
23
|
-
let(:stdout) { '180' }
|
24
|
-
its(:value) { should_not eq 360 }
|
25
|
-
end
|
26
|
-
|
27
|
-
describe php_config('mbstring.http_output_conv_mimetypes') do
|
28
|
-
let(:stdout) { 'application' }
|
29
|
-
its(:value) { should match /application/ }
|
30
|
-
its(:command) { should eq "php -r 'echo get_cfg_var( \"mbstring.http_output_conv_mimetypes\" );'" }
|
31
|
-
end
|
32
|
-
|
33
|
-
describe php_config('mbstring.http_output_conv_mimetypes') do
|
34
|
-
let(:stdout) { 'application' }
|
35
|
-
its(:value) { should_not match /html/ }
|
36
|
-
end
|
data/spec/darwin/port_spec.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
describe port(80) do
|
6
|
-
it { should be_listening }
|
7
|
-
its(:command) { should eq 'lsof -nP -iTCP -sTCP:LISTEN | grep -- :80\\ ' }
|
8
|
-
end
|
9
|
-
|
10
|
-
describe port('invalid') do
|
11
|
-
it { should_not be_listening }
|
12
|
-
end
|
13
|
-
|
14
|
-
describe port(80) do
|
15
|
-
it { should be_listening.with("tcp") }
|
16
|
-
its(:command) { should eq 'netstat -tunl | grep -- \\^tcp\\ .\\*:80\\ ' }
|
17
|
-
end
|
18
|
-
|
19
|
-
describe port(123) do
|
20
|
-
it { should be_listening.with("udp") }
|
21
|
-
its(:command) { should eq 'netstat -tunl | grep -- \\^udp\\ .\\*:123\\ ' }
|
22
|
-
end
|
23
|
-
|
24
|
-
describe port(80) do
|
25
|
-
it {
|
26
|
-
expect {
|
27
|
-
should be_listening.with('not implemented')
|
28
|
-
}.to raise_error(ArgumentError, %r/\A`be_listening` matcher doesn\'t support/)
|
29
|
-
}
|
30
|
-
end
|
data/spec/darwin/process_spec.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
describe process("memcached") do
|
6
|
-
let(:stdout) { " 1407\n" }
|
7
|
-
its(:pid) { should eq 1407 }
|
8
|
-
its(:command) { should eq "ps -C memcached -o pid= | head -1" }
|
9
|
-
end
|
10
|
-
|
11
|
-
describe process("memcached") do
|
12
|
-
let(:stdout) { "/usr/bin/memcached -m 14386 -p 11211 -u nobody -l 10.11.1.53 -c 30000\n" }
|
13
|
-
its(:args) { should match /-c 30000\b/ }
|
14
|
-
its(:command) { should eq "ps -C memcached -o args= | head -1" }
|
15
|
-
end
|
16
|
-
|
17
|
-
describe process("memcached") do
|
18
|
-
context "when running" do
|
19
|
-
let(:stdout) { " 1407\n" }
|
20
|
-
it { should be_running }
|
21
|
-
its(:command) { should eq "ps -C memcached -o pid= | head -1" }
|
22
|
-
end
|
23
|
-
|
24
|
-
context "when not running" do
|
25
|
-
let(:stdout) { " 1407\n" }
|
26
|
-
it { should be_running }
|
27
|
-
its(:command) { should eq "ps -C memcached -o pid= | head -1" }
|
28
|
-
end
|
29
|
-
end
|
@@ -1,120 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
describe routing_table do
|
6
|
-
let(:stdout) { "192.168.100.0/24 dev eth1 proto kernel scope link src 192.168.100.10 \r\ndefault via 192.168.100.1 dev eth0 \r\n" }
|
7
|
-
it { should have_entry( :destination => '192.168.100.0/24' ) }
|
8
|
-
its(:command) { should eq "ip route | grep -E '^192.168.100.0/24 |^default '" }
|
9
|
-
end
|
10
|
-
|
11
|
-
describe routing_table do
|
12
|
-
let(:stdout) { "192.168.100.0/24 dev eth1 proto kernel scope link src 192.168.100.10 \r\ndefault via 192.168.100.1 dev eth0 \r\n" }
|
13
|
-
it { should_not have_entry( :destination => '192.168.100.100/24' ) }
|
14
|
-
its(:command) { should eq "ip route | grep -E '^192.168.100.100/24 |^default '" }
|
15
|
-
end
|
16
|
-
|
17
|
-
describe routing_table do
|
18
|
-
let(:stdout) { "192.168.100.0/24 dev eth1 proto kernel scope link src 192.168.100.10 \r\ndefault via 192.168.100.1 dev eth0 \r\n" }
|
19
|
-
it do
|
20
|
-
should have_entry(
|
21
|
-
:destination => '192.168.100.0/24',
|
22
|
-
:gateway => '192.168.100.1'
|
23
|
-
)
|
24
|
-
end
|
25
|
-
|
26
|
-
it do
|
27
|
-
should have_entry(
|
28
|
-
:destination => '192.168.100.0/24',
|
29
|
-
:gateway => '192.168.100.1',
|
30
|
-
:interface => 'eth1'
|
31
|
-
)
|
32
|
-
end
|
33
|
-
|
34
|
-
it do
|
35
|
-
should_not have_entry(
|
36
|
-
:gateway => '192.168.100.1',
|
37
|
-
:interface => 'eth1'
|
38
|
-
)
|
39
|
-
end
|
40
|
-
|
41
|
-
it do
|
42
|
-
should_not have_entry(
|
43
|
-
:destination => '192.168.100.0/32',
|
44
|
-
:gateway => '192.168.100.1',
|
45
|
-
:interface => 'eth1'
|
46
|
-
)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe routing_table do
|
51
|
-
let(:stdout) { "192.168.200.0/24 via 192.168.200.1 dev eth0 \r\ndefault via 192.168.100.1 dev eth0 \r\n" }
|
52
|
-
it { should have_entry( :destination => '192.168.200.0/24' ) }
|
53
|
-
it { should_not have_entry( :destination => '192.168.200.200/24' ) }
|
54
|
-
|
55
|
-
it do
|
56
|
-
should have_entry(
|
57
|
-
:destination => '192.168.200.0/24',
|
58
|
-
:gateway => '192.168.200.1'
|
59
|
-
)
|
60
|
-
end
|
61
|
-
|
62
|
-
it do
|
63
|
-
should have_entry(
|
64
|
-
:destination => '192.168.200.0/24',
|
65
|
-
:gateway => '192.168.200.1',
|
66
|
-
:interface => 'eth0'
|
67
|
-
)
|
68
|
-
end
|
69
|
-
|
70
|
-
it do
|
71
|
-
should_not have_entry(
|
72
|
-
:gateway => '192.168.200.1',
|
73
|
-
:interface => 'eth0'
|
74
|
-
)
|
75
|
-
end
|
76
|
-
|
77
|
-
it do
|
78
|
-
should_not have_entry(
|
79
|
-
:destination => '192.168.200.0/32',
|
80
|
-
:gateway => '192.168.200.1',
|
81
|
-
:interface => 'eth0'
|
82
|
-
)
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
describe routing_table do
|
87
|
-
let(:stdout) { "default via 10.0.2.2 dev eth0 \r\n" }
|
88
|
-
it { should have_entry( :destination => 'default' ) }
|
89
|
-
it { should_not have_entry( :destination => 'defaulth' ) }
|
90
|
-
|
91
|
-
it do
|
92
|
-
should have_entry(
|
93
|
-
:destination => 'default',
|
94
|
-
:gateway => '10.0.2.2'
|
95
|
-
)
|
96
|
-
end
|
97
|
-
|
98
|
-
it do
|
99
|
-
should have_entry(
|
100
|
-
:destination => 'default',
|
101
|
-
:gateway => '10.0.2.2',
|
102
|
-
:interface => 'eth0'
|
103
|
-
)
|
104
|
-
end
|
105
|
-
|
106
|
-
it do
|
107
|
-
should_not have_entry(
|
108
|
-
:gateway => '10.0.2.2',
|
109
|
-
:interface => 'eth0'
|
110
|
-
)
|
111
|
-
end
|
112
|
-
|
113
|
-
it do
|
114
|
-
should_not have_entry(
|
115
|
-
:destination => 'default',
|
116
|
-
:gateway => '10.0.2.1',
|
117
|
-
:interface => 'eth0'
|
118
|
-
)
|
119
|
-
end
|
120
|
-
end
|
data/spec/darwin/service_spec.rb
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include SpecInfra::Helper::Darwin
|
4
|
-
|
5
|
-
#describe service('sshd') do
|
6
|
-
# it { should be_enabled }
|
7
|
-
#end
|
8
|
-
|
9
|
-
#describe service('invalid-service') do
|
10
|
-
# it { should_not be_enabled }
|
11
|
-
#end
|
12
|
-
|
13
|
-
#describe service('sshd') do
|
14
|
-
# it { should be_enabled.with_level(3) }
|
15
|
-
#end
|
16
|
-
|
17
|
-
#describe service('invalid-service') do
|
18
|
-
# it { should_not be_enabled.with_level(3) }
|
19
|
-
#end
|
20
|
-
|
21
|
-
describe service('sshd') do
|
22
|
-
it { should be_running }
|
23
|
-
its(:command) { should eq "launchctl list | grep sshd | grep -E '^[0-9]+'" }
|
24
|
-
end
|
25
|
-
|
26
|
-
describe service('invalid-daemon') do
|
27
|
-
it { should_not be_running }
|
28
|
-
end
|
29
|
-
|
30
|
-
describe service('sshd') do
|
31
|
-
let(:stdout) { "sshd is stopped\r\n" }
|
32
|
-
it { should be_running }
|
33
|
-
end
|
34
|
-
|
35
|
-
describe service('sshd') do
|
36
|
-
it { should be_running.under('supervisor') }
|
37
|
-
its(:command) { should eq "supervisorctl status sshd | grep RUNNING" }
|
38
|
-
end
|
39
|
-
|
40
|
-
describe service('invalid-daemon') do
|
41
|
-
it { should_not be_running.under('supervisor') }
|
42
|
-
end
|
43
|
-
|
44
|
-
describe service('sshd') do
|
45
|
-
it { should be_running.under('upstart') }
|
46
|
-
its(:command) { should eq "initctl status sshd | grep running" }
|
47
|
-
end
|
48
|
-
|
49
|
-
describe service('invalid-daemon') do
|
50
|
-
it { should_not be_running.under('upstart') }
|
51
|
-
end
|
52
|
-
|
53
|
-
describe service('sshd') do
|
54
|
-
it {
|
55
|
-
expect {
|
56
|
-
should be_running.under('not implemented')
|
57
|
-
}.to raise_error(ArgumentError, %r/\A`be_running` matcher doesn\'t support/)
|
58
|
-
}
|
59
|
-
end
|
60
|
-
|
61
|
-
describe service('sshd') do
|
62
|
-
let(:stdout) { "Process 'sshd'\r\n status running\r\n monitoring status monitored" }
|
63
|
-
it { should be_monitored_by('monit') }
|
64
|
-
its(:command) { should eq "monit status" }
|
65
|
-
end
|
66
|
-
|
67
|
-
describe service('sshd') do
|
68
|
-
let(:stdout) { "Process 'sshd'\r\n status not monitored\r\n monitoring status not monitored" }
|
69
|
-
it { should_not be_monitored_by('monit') }
|
70
|
-
end
|
71
|
-
|
72
|
-
describe service('invalid-daemon') do
|
73
|
-
it { should_not be_monitored_by('monit') }
|
74
|
-
end
|
75
|
-
|
76
|
-
describe service('unicorn') do
|
77
|
-
it { should be_monitored_by('god') }
|
78
|
-
its(:command) { should eq "god status unicorn" }
|
79
|
-
end
|
80
|
-
|
81
|
-
describe service('invalid-daemon') do
|
82
|
-
it { should_not be_monitored_by('god') }
|
83
|
-
end
|
84
|
-
|
85
|
-
describe service('sshd') do
|
86
|
-
it {
|
87
|
-
expect {
|
88
|
-
should be_monitored_by('not implemented')
|
89
|
-
}.to raise_error(ArgumentError, %r/\A`be_monitored_by` matcher doesn\'t support/)
|
90
|
-
}
|
91
|
-
end
|