serverspec 2.0.0.beta8 → 2.0.0.beta9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +24 -2
  3. data/lib/serverspec/setup.rb +6 -8
  4. data/lib/serverspec/type/cgroup.rb +1 -0
  5. data/lib/serverspec/type/command.rb +1 -1
  6. data/lib/serverspec/type/cron.rb +1 -1
  7. data/lib/serverspec/type/default_gateway.rb +2 -2
  8. data/lib/serverspec/type/file.rb +21 -17
  9. data/lib/serverspec/type/group.rb +2 -2
  10. data/lib/serverspec/type/host.rb +3 -3
  11. data/lib/serverspec/type/iis_app_pool.rb +2 -2
  12. data/lib/serverspec/type/iis_website.rb +5 -5
  13. data/lib/serverspec/type/interface.rb +1 -1
  14. data/lib/serverspec/type/ipfilter.rb +1 -1
  15. data/lib/serverspec/type/ipnat.rb +1 -1
  16. data/lib/serverspec/type/iptables.rb +1 -1
  17. data/lib/serverspec/type/kernel_module.rb +1 -1
  18. data/lib/serverspec/type/lxc.rb +2 -2
  19. data/lib/serverspec/type/mail_alias.rb +1 -1
  20. data/lib/serverspec/type/package.rb +2 -7
  21. data/lib/serverspec/type/port.rb +1 -1
  22. data/lib/serverspec/type/ppa.rb +2 -2
  23. data/lib/serverspec/type/routing_table.rb +1 -1
  24. data/lib/serverspec/type/selinux.rb +3 -3
  25. data/lib/serverspec/type/service.rb +7 -15
  26. data/lib/serverspec/type/user.rb +12 -6
  27. data/lib/serverspec/type/windows_feature.rb +1 -1
  28. data/lib/serverspec/type/windows_hot_fix.rb +1 -1
  29. data/lib/serverspec/type/windows_registry_key.rb +4 -4
  30. data/lib/serverspec/type/windows_scheduled_task.rb +1 -1
  31. data/lib/serverspec/type/yumrepo.rb +2 -2
  32. data/lib/serverspec/type/zfs.rb +2 -2
  33. data/lib/serverspec/version.rb +1 -1
  34. data/serverspec.gemspec +1 -1
  35. data/spec/spec_helper.rb +11 -0
  36. data/spec/type/aix/file_spec.rb +35 -0
  37. data/spec/type/aix/group_spec.rb +15 -0
  38. data/spec/type/aix/package_spec.rb +15 -0
  39. data/spec/type/aix/port_spec.rb +37 -0
  40. data/spec/type/aix/service_spec.rb +23 -0
  41. data/spec/type/aix/user_spec.rb +32 -0
  42. data/spec/type/arch/file_spec.rb +32 -0
  43. data/spec/type/arch/package_spec.rb +31 -0
  44. data/spec/type/arch/service_spec.rb +13 -0
  45. data/spec/type/{command_spec.rb → base/command_spec.rb} +1 -3
  46. data/spec/type/{cron_spec.rb → base/cron_spec.rb} +5 -1
  47. data/spec/type/{default_gateway_spec.rb → base/default_gateway_spec.rb} +1 -1
  48. data/spec/type/{file_spec.rb → base/file_spec.rb} +23 -24
  49. data/spec/type/{group_spec.rb → base/group_spec.rb} +5 -1
  50. data/spec/type/{host_spec.rb → base/host_spec.rb} +5 -1
  51. data/spec/type/{mail_alias_spec.rb → base/mail_alias_spec.rb} +5 -1
  52. data/spec/type/{package_spec.rb → base/package_spec.rb} +3 -32
  53. data/spec/type/{php_config_spec.rb → base/php_config_spec.rb} +1 -1
  54. data/spec/type/{port_spec.rb → base/port_spec.rb} +5 -1
  55. data/spec/type/{process_spec.rb → base/process_spec.rb} +5 -1
  56. data/spec/type/{routing_table_spec.rb → base/routing_table_spec.rb} +5 -1
  57. data/spec/type/{service_spec.rb → base/service_spec.rb} +5 -25
  58. data/spec/type/{user_spec.rb → base/user_spec.rb} +5 -1
  59. data/spec/type/darwin/file_spec.rb +43 -0
  60. data/spec/type/darwin/package_spec.rb +24 -0
  61. data/spec/type/darwin/port_spec.rb +37 -0
  62. data/spec/type/darwin/service_spec.rb +32 -0
  63. data/spec/type/debian/package_spec.rb +39 -0
  64. data/spec/type/debian/service_spec.rb +23 -0
  65. data/spec/type/fedora/service_spec.rb +19 -0
  66. data/spec/type/fedora15/service_spec.rb +19 -0
  67. data/spec/type/fedora20/service_spec.rb +19 -0
  68. data/spec/type/freebsd/file_spec.rb +11 -0
  69. data/spec/type/freebsd/package_spec.rb +31 -0
  70. data/spec/type/freebsd/port_spec.rb +37 -0
  71. data/spec/type/freebsd/service_spec.rb +16 -0
  72. data/spec/type/freebsd10/package_spec.rb +31 -0
  73. data/spec/type/gentoo/package_spec.rb +16 -0
  74. data/spec/type/gentoo/service_spec.rb +24 -0
  75. data/spec/type/{cgroup_spec.rb → linux/cgroup_spec.rb} +1 -1
  76. data/spec/type/linux/file_spec.rb +38 -0
  77. data/spec/type/{interface_spec.rb → linux/interface_spec.rb} +5 -1
  78. data/spec/type/{iptables_spec.rb → linux/iptables_spec.rb} +6 -2
  79. data/spec/type/linux/kernel_module_spec.rb +15 -0
  80. data/spec/type/{linux_kernel_parameter_spec.rb → linux/linux_kernel_parameter_spec.rb} +1 -1
  81. data/spec/type/{lxc_spec.rb → linux/lxc_container_spec.rb} +5 -1
  82. data/spec/type/{selinux_spec.rb → linux/selinux_spec.rb} +5 -1
  83. data/spec/type/{zfs_spec.rb → linux/zfs_spec.rb} +5 -1
  84. data/spec/type/nixos/package_spec.rb +31 -0
  85. data/spec/type/nixos/service_spec.rb +13 -0
  86. data/spec/type/openbsd/file_spec.rb +174 -0
  87. data/spec/type/openbsd/interface_spec.rb +25 -0
  88. data/spec/type/openbsd/mail_alias_spec.rb +15 -0
  89. data/spec/type/openbsd/package_spec.rb +24 -0
  90. data/spec/type/openbsd/port_spec.rb +11 -0
  91. data/spec/type/openbsd/service_spec.rb +24 -0
  92. data/spec/type/openbsd/user_spec.rb +24 -0
  93. data/spec/type/opensuse/service_spec.rb +32 -0
  94. data/spec/type/plamo/package_spec.rb +16 -0
  95. data/spec/type/plamo/service_spec.rb +16 -0
  96. data/spec/type/redhat/file_spec.rb +36 -0
  97. data/spec/type/redhat/package_spec.rb +39 -0
  98. data/spec/type/redhat/service_spec.rb +23 -0
  99. data/spec/type/{yumrepo_spec.rb → redhat/yumrepo_spec.rb} +5 -1
  100. data/spec/type/redhat5/iptables_spec.rb +23 -0
  101. data/spec/type/redhat7/service_spec.rb +13 -0
  102. data/spec/type/smartos/package_spec.rb +31 -0
  103. data/spec/type/smartos/service_spec.rb +32 -0
  104. data/spec/type/solaris/cron_spec.rb +23 -0
  105. data/spec/type/solaris/file_spec.rb +33 -0
  106. data/spec/type/solaris/group_spec.rb +15 -0
  107. data/spec/type/solaris/host_spec.rb +31 -0
  108. data/spec/type/solaris/ipfilter_spec.rb +11 -0
  109. data/spec/type/solaris/ipnat_spec.rb +11 -0
  110. data/spec/type/solaris/package_spec.rb +15 -0
  111. data/spec/type/solaris/port_spec.rb +37 -0
  112. data/spec/type/solaris/service_spec.rb +32 -0
  113. data/spec/type/solaris/user_spec.rb +32 -0
  114. data/spec/type/solaris/zfs_spec.rb +19 -0
  115. data/spec/type/solaris10/file_spec.rb +391 -0
  116. data/spec/type/solaris10/group_spec.rb +16 -0
  117. data/spec/type/solaris10/host_spec.rb +24 -0
  118. data/spec/type/solaris10/package_spec.rb +15 -0
  119. data/spec/type/solaris10/user_spec.rb +16 -0
  120. data/spec/type/suse/package_spec.rb +39 -0
  121. data/spec/type/suse/service_spec.rb +23 -0
  122. data/spec/type/ubuntu/ppa_spec.rb +23 -0
  123. data/spec/type/ubuntu/service_spec.rb +15 -0
  124. data/spec/type/windows/command_spec.rb +65 -0
  125. data/spec/type/windows/feature_spec.rb +13 -0
  126. data/spec/type/windows/file_spec.rb +161 -0
  127. data/spec/type/windows/group_spec.rb +31 -0
  128. data/spec/type/windows/host_spec.rb +56 -0
  129. data/spec/type/windows/hot_fix_spec.rb +26 -0
  130. data/spec/type/windows/iis_app_pool_spec.rb +18 -0
  131. data/spec/type/windows/iis_webisite_spec.rb +30 -0
  132. data/spec/type/windows/package_spec.rb +14 -0
  133. data/spec/type/windows/port_spec.rb +33 -0
  134. data/spec/type/windows/registry_key_spec.rb +62 -0
  135. data/spec/type/windows/scheduled_task_spec.rb +13 -0
  136. data/spec/type/windows/service_spec.rb +42 -0
  137. data/spec/type/windows/user_spec.rb +45 -0
  138. metadata +208 -50
  139. data/spec/type/kernel_module_spec.rb +0 -11
@@ -0,0 +1,37 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'darwin'
4
+
5
+ describe commands.command_class('port').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Darwin::Base::Port) }
7
+ end
8
+
9
+ describe Serverspec::Type::Port do
10
+ describe port(80) do
11
+ it { should be_listening }
12
+
13
+ it('protocol: tcp') { should be_listening.with('tcp') }
14
+
15
+ it 'invalid protocol raises error' do
16
+ expect {
17
+ should be_listening.with('not implemented')
18
+ }.to raise_error(ArgumentError, %r/\A`be_listening` matcher doesn\'t support/)
19
+ end
20
+
21
+ it('on: 127.0.0.1') do
22
+ should be_listening.on('127.0.0.1')
23
+ end
24
+
25
+ it 'invalid local address raises error' do
26
+ expect{ should be_listening.on('') }.to raise_error(ArgumentError)
27
+ end
28
+ end
29
+
30
+ describe port('invalid') do
31
+ it { should_not be_listening }
32
+ end
33
+
34
+ describe port(123) do
35
+ it { should be_listening.with("udp") }
36
+ end
37
+ end
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'darwin'
4
+
5
+ describe commands.command_class('service').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Darwin::Base::Service) }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled }
11
+ end
12
+
13
+ describe service('invalid-service') do
14
+ it { should_not be_enabled }
15
+ end
16
+
17
+ describe service('sshd') do
18
+ it { should be_enabled.with_level(4) }
19
+ end
20
+
21
+ describe service('invalid-service') do
22
+ it { should_not be_enabled.with_level(4) }
23
+ end
24
+
25
+ describe service('sshd') do
26
+ it { should be_running }
27
+ end
28
+
29
+ describe service('invalid-service') do
30
+ it { should_not be_running }
31
+ end
32
+
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'debian'
4
+
5
+ describe commands.command_class('package').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Debian::Base::Package) }
7
+ end
8
+
9
+ describe package('httpd') do
10
+ it { should be_installed }
11
+ end
12
+
13
+ describe package('invalid-package') do
14
+ it { should_not be_installed }
15
+ end
16
+
17
+ describe package('invalid-package') do
18
+ it { should_not be_installed.by('apt') }
19
+ end
20
+
21
+ describe package('httpd') do
22
+ it { should be_installed.with_version('2.2.15-28.el6') }
23
+ end
24
+
25
+ describe package('httpd') do
26
+ it { should be_installed.by('apt').with_version('2.2.15-28.el6') }
27
+ end
28
+
29
+ describe package('httpd') do
30
+ it { should_not be_installed.with_version('invalid-version') }
31
+ end
32
+
33
+ describe package('httpd') do
34
+ let(:stdout) { "2.2.15\n" }
35
+ its(:version) { should eq '2.2.15' }
36
+ its(:version) { should > '2.2.14' }
37
+ its(:version) { should < '2.2.16' }
38
+ its(:version) { should > '2.2.9' }
39
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'debian'
4
+
5
+ describe commands.command_class('service').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Debian::Base::Service) }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled }
11
+ end
12
+
13
+ describe service('invalid-service') do
14
+ it { should_not be_enabled }
15
+ end
16
+
17
+ describe service('sshd') do
18
+ it { should be_enabled.with_level(4) }
19
+ end
20
+
21
+ describe service('invalid-service') do
22
+ it { should_not be_enabled.with_level(4) }
23
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'fedora'
4
+
5
+ describe commands.command_class('service').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Fedora::Base::Service) }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled }
11
+ end
12
+
13
+ describe service('sshd') do
14
+ it { should be_enabled.with_level(4) }
15
+ end
16
+
17
+ describe service('sshd') do
18
+ it { should be_running }
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'fedora', :release => 15
4
+
5
+ describe commands.command_class('service').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Fedora::V15::Service) }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled }
11
+ end
12
+
13
+ describe service('sshd') do
14
+ it { should be_enabled.with_level(4) }
15
+ end
16
+
17
+ describe service('sshd') do
18
+ it { should be_running }
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'fedora', :release => 20
4
+
5
+ describe commands.command_class('service').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Fedora::V15::Service) }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled }
11
+ end
12
+
13
+ describe service('sshd') do
14
+ it { should be_enabled.with_level(4) }
15
+ end
16
+
17
+ describe service('sshd') do
18
+ it { should be_running }
19
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'freebsd'
4
+
5
+ describe commands.command_class('file').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Freebsd::Base::File) }
7
+ end
8
+
9
+ describe file('/tmp') do
10
+ it { should be_mode 777 }
11
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'freebsd'
4
+
5
+ describe commands.command_class('package').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Freebsd::Base::Package) }
7
+ end
8
+
9
+ describe package('httpd') do
10
+ it { should be_installed }
11
+ end
12
+
13
+ describe package('invalid-package') do
14
+ it { should_not be_installed }
15
+ end
16
+
17
+ describe package('httpd') do
18
+ it { should be_installed.with_version('2.2.15-28.el6') }
19
+ end
20
+
21
+ describe package('httpd') do
22
+ it { should_not be_installed.with_version('invalid-version') }
23
+ end
24
+
25
+ describe package('httpd') do
26
+ let(:stdout) { "2.2.15\n" }
27
+ its(:version) { should eq '2.2.15' }
28
+ its(:version) { should > '2.2.14' }
29
+ its(:version) { should < '2.2.16' }
30
+ its(:version) { should > '2.2.9' }
31
+ end
@@ -0,0 +1,37 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'freebsd'
4
+
5
+ describe commands.command_class('port').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Freebsd::Base::Port) }
7
+ end
8
+
9
+ describe Serverspec::Type::Port do
10
+ describe port(80) do
11
+ it { should be_listening }
12
+
13
+ it('protocol: tcp') { should be_listening.with('tcp') }
14
+
15
+ it 'invalid protocol raises error' do
16
+ expect {
17
+ should be_listening.with('not implemented')
18
+ }.to raise_error(ArgumentError, %r/\A`be_listening` matcher doesn\'t support/)
19
+ end
20
+
21
+ it('on: 127.0.0.1') do
22
+ should be_listening.on('127.0.0.1')
23
+ end
24
+
25
+ it 'invalid local address raises error' do
26
+ expect{ should be_listening.on('') }.to raise_error(ArgumentError)
27
+ end
28
+ end
29
+
30
+ describe port('invalid') do
31
+ it { should_not be_listening }
32
+ end
33
+
34
+ describe port(123) do
35
+ it { should be_listening.with("udp") }
36
+ end
37
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'freebsd'
4
+
5
+ describe commands.command_class('service').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Freebsd::Base::Service) }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled }
11
+ end
12
+
13
+ describe service('invalid-service') do
14
+ it { should_not be_enabled }
15
+ end
16
+
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'freebsd', :release => 10
4
+
5
+ describe commands.command_class('package').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Freebsd::V10::Package) }
7
+ end
8
+
9
+ describe package('httpd') do
10
+ it { should be_installed }
11
+ end
12
+
13
+ describe package('invalid-package') do
14
+ it { should_not be_installed }
15
+ end
16
+
17
+ describe package('httpd') do
18
+ it { should be_installed.with_version('2.2.15-28.el6') }
19
+ end
20
+
21
+ describe package('httpd') do
22
+ it { should_not be_installed.with_version('invalid-version') }
23
+ end
24
+
25
+ describe package('httpd') do
26
+ let(:stdout) { "2.2.15\n" }
27
+ its(:version) { should eq '2.2.15' }
28
+ its(:version) { should > '2.2.14' }
29
+ its(:version) { should < '2.2.16' }
30
+ its(:version) { should > '2.2.9' }
31
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'gentoo'
4
+
5
+ describe commands.command_class('package').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Gentoo::Base::Package) }
7
+ end
8
+
9
+ describe package('httpd') do
10
+ it { should be_installed }
11
+ end
12
+
13
+ describe package('invalid-package') do
14
+ it { should_not be_installed }
15
+ end
16
+
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'gentoo'
4
+
5
+ describe commands.command_class('service').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Gentoo::Base::Service) }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled }
11
+ end
12
+
13
+ describe service('invalid-service') do
14
+ it { should_not be_enabled }
15
+ end
16
+
17
+ describe service('sshd') do
18
+ it { should be_running }
19
+ end
20
+
21
+ describe service('invalid-service') do
22
+ it { should_not be_running }
23
+ end
24
+
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Specinfra::Helper::RedHat
3
+ set :os, :family => 'linux'
4
4
 
5
5
  describe cgroup('group1') do
6
6
  let(:stdout) { "1\r\n" }
@@ -0,0 +1,38 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, {:family => 'linux'}
4
+
5
+ property[:os_by_host] = nil
6
+
7
+ describe commands.command_class('file').create do
8
+ it { should be_an_instance_of(Specinfra::Command::Linux::Base::File) }
9
+ end
10
+
11
+ describe file('/tmp') do
12
+ it { should be_readable.by_user('mail') }
13
+ end
14
+
15
+ describe file('/tmp') do
16
+ it { should_not be_readable.by_user('invalid-user') }
17
+ end
18
+
19
+ describe file('/tmp') do
20
+ it { should be_writable.by_user('mail') }
21
+ end
22
+
23
+ describe file('/tmp') do
24
+ it { should_not be_writable.by_user('invalid-user') }
25
+ end
26
+
27
+
28
+ describe file('/tmp') do
29
+ it { should be_executable.by_user('mail') }
30
+ end
31
+
32
+ describe file('/tmp') do
33
+ it { should_not be_executable.by_user('invalid-user') }
34
+ end
35
+
36
+ describe file('/tmp') do
37
+ it { should be_immutable }
38
+ end
@@ -1,6 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Specinfra::Helper::RedHat
3
+ set :os, :family => 'linux'
4
+
5
+ describe commands.command_class('interface').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Linux::Base::Interface) }
7
+ end
4
8
 
5
9
  describe interface('eth0') do
6
10
  let(:stdout) { '1000' }
@@ -1,9 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Specinfra::Helper::RedHat
3
+ set :os, :family => 'linux'
4
+
5
+ describe commands.command_class('iptables').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Linux::Base::Iptables) }
7
+ end
4
8
 
5
9
  describe iptables do
6
- it { should have_rule '-P INPUT ACCEPT' }
10
+ it { should have_rule '-P INPUT ACCEPT' }
7
11
  end
8
12
 
9
13
  describe iptables do
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'linux'
4
+
5
+ describe commands.command_class('kernel_module').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Linux::Base::KernelModule) }
7
+ end
8
+
9
+ describe kernel_module('lp') do
10
+ it { should be_loaded }
11
+ end
12
+
13
+ describe kernel_module('invalid-module') do
14
+ it { should_not be_loaded }
15
+ end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Specinfra::Helper::RedHat
3
+ set :os, :family => 'linux'
4
4
 
5
5
  describe linux_kernel_parameter('net.ipv4.tcp_syncookies') do
6
6
  let(:stdout) { "1\n" }
@@ -1,6 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Specinfra::Helper::RedHat
3
+ set :os, :family => 'linux'
4
+
5
+ describe commands.command_class('lxc_container').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Linux::Base::LxcContainer) }
7
+ end
4
8
 
5
9
  describe lxc('ct01') do
6
10
  it { should exist }
@@ -1,6 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Specinfra::Helper::RedHat
3
+ set :os, :family => 'linux'
4
+
5
+ describe commands.command_class('selinux').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Linux::Base::Selinux)}
7
+ end
4
8
 
5
9
  describe selinux do
6
10
  it { should be_enforcing }
@@ -1,6 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Specinfra::Helper::RedHat
3
+ set :os, :family => 'linux'
4
+
5
+ describe commands.command_class('zfs').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Linux::Base::Zfs) }
7
+ end
4
8
 
5
9
  describe zfs('rpool') do
6
10
  it { should exist }
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'nixos'
4
+
5
+ describe commands.command_class('package').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Nixos::Base::Package) }
7
+ end
8
+
9
+ describe package('httpd') do
10
+ it { should be_installed }
11
+ end
12
+
13
+ describe package('invalid-package') do
14
+ it { should_not be_installed }
15
+ end
16
+
17
+ describe package('invalid-package') do
18
+ it { should_not be_installed.by('nix') }
19
+ end
20
+
21
+ describe package('httpd') do
22
+ it { should be_installed.with_version('2.2.15-28.el6') }
23
+ end
24
+
25
+ describe package('httpd') do
26
+ it { should be_installed.by('nix').with_version('2.2.15-28.el6') }
27
+ end
28
+
29
+ describe package('httpd') do
30
+ it { should_not be_installed.with_version('invalid-version') }
31
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'nixos'
4
+
5
+ describe commands.command_class('service').create do
6
+ it { should be_an_instance_of(Specinfra::Command::Nixos::Base::Service) }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled }
11
+ it { should be_running }
12
+ end
13
+