serverspec 2.0.0.beta13 → 2.0.0.beta14

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/lib/serverspec.rb +1 -1
  3. data/lib/serverspec/type/default_gateway.rb +2 -2
  4. data/lib/serverspec/type/file.rb +1 -1
  5. data/lib/serverspec/type/interface.rb +1 -1
  6. data/lib/serverspec/type/package.rb +1 -1
  7. data/lib/serverspec/type/process.rb +1 -1
  8. data/lib/serverspec/version.rb +1 -1
  9. data/serverspec.gemspec +1 -1
  10. data/spec/type/aix/file_spec.rb +0 -4
  11. data/spec/type/aix/group_spec.rb +0 -4
  12. data/spec/type/aix/package_spec.rb +0 -4
  13. data/spec/type/aix/port_spec.rb +0 -4
  14. data/spec/type/aix/service_spec.rb +0 -4
  15. data/spec/type/aix/user_spec.rb +0 -4
  16. data/spec/type/arch/file_spec.rb +0 -4
  17. data/spec/type/arch/package_spec.rb +2 -4
  18. data/spec/type/arch/service_spec.rb +0 -4
  19. data/spec/type/base/cron_spec.rb +0 -4
  20. data/spec/type/base/default_gateway_spec.rb +0 -3
  21. data/spec/type/base/file_spec.rb +0 -4
  22. data/spec/type/base/group_spec.rb +0 -4
  23. data/spec/type/base/host_spec.rb +0 -4
  24. data/spec/type/base/mail_alias_spec.rb +0 -4
  25. data/spec/type/base/package_spec.rb +0 -4
  26. data/spec/type/base/port_spec.rb +0 -4
  27. data/spec/type/base/process_spec.rb +0 -4
  28. data/spec/type/base/routing_table_spec.rb +0 -4
  29. data/spec/type/base/service_spec.rb +0 -4
  30. data/spec/type/base/user_spec.rb +0 -4
  31. data/spec/type/darwin/file_spec.rb +0 -4
  32. data/spec/type/darwin/package_spec.rb +0 -4
  33. data/spec/type/darwin/port_spec.rb +0 -4
  34. data/spec/type/darwin/service_spec.rb +0 -4
  35. data/spec/type/debian/package_spec.rb +0 -4
  36. data/spec/type/debian/service_spec.rb +0 -4
  37. data/spec/type/fedora/service_spec.rb +0 -4
  38. data/spec/type/fedora15/service_spec.rb +0 -4
  39. data/spec/type/fedora20/service_spec.rb +0 -4
  40. data/spec/type/freebsd/file_spec.rb +0 -4
  41. data/spec/type/freebsd/package_spec.rb +0 -4
  42. data/spec/type/freebsd/port_spec.rb +0 -4
  43. data/spec/type/freebsd/service_spec.rb +0 -4
  44. data/spec/type/freebsd10/package_spec.rb +0 -4
  45. data/spec/type/gentoo/package_spec.rb +0 -4
  46. data/spec/type/gentoo/service_spec.rb +0 -4
  47. data/spec/type/linux/file_spec.rb +0 -4
  48. data/spec/type/linux/interface_spec.rb +0 -4
  49. data/spec/type/linux/iptables_spec.rb +0 -4
  50. data/spec/type/linux/kernel_module_spec.rb +0 -4
  51. data/spec/type/linux/lxc_container_spec.rb +0 -4
  52. data/spec/type/linux/selinux_spec.rb +0 -4
  53. data/spec/type/linux/zfs_spec.rb +0 -4
  54. data/spec/type/nixos/package_spec.rb +0 -4
  55. data/spec/type/nixos/service_spec.rb +0 -4
  56. data/spec/type/openbsd/file_spec.rb +0 -4
  57. data/spec/type/openbsd/interface_spec.rb +0 -4
  58. data/spec/type/openbsd/mail_alias_spec.rb +0 -4
  59. data/spec/type/openbsd/package_spec.rb +0 -4
  60. data/spec/type/openbsd/port_spec.rb +0 -4
  61. data/spec/type/openbsd/service_spec.rb +0 -4
  62. data/spec/type/openbsd/user_spec.rb +0 -4
  63. data/spec/type/opensuse/service_spec.rb +0 -4
  64. data/spec/type/plamo/package_spec.rb +0 -4
  65. data/spec/type/plamo/service_spec.rb +0 -4
  66. data/spec/type/redhat/file_spec.rb +0 -4
  67. data/spec/type/redhat/package_spec.rb +0 -4
  68. data/spec/type/redhat/service_spec.rb +0 -4
  69. data/spec/type/redhat/yumrepo_spec.rb +0 -4
  70. data/spec/type/redhat5/iptables_spec.rb +0 -4
  71. data/spec/type/redhat7/service_spec.rb +0 -4
  72. data/spec/type/smartos/package_spec.rb +0 -4
  73. data/spec/type/smartos/service_spec.rb +0 -4
  74. data/spec/type/solaris/cron_spec.rb +0 -4
  75. data/spec/type/solaris/file_spec.rb +0 -4
  76. data/spec/type/solaris/group_spec.rb +0 -4
  77. data/spec/type/solaris/host_spec.rb +0 -4
  78. data/spec/type/solaris/ipfilter_spec.rb +0 -4
  79. data/spec/type/solaris/ipnat_spec.rb +0 -4
  80. data/spec/type/solaris/package_spec.rb +0 -4
  81. data/spec/type/solaris/port_spec.rb +0 -4
  82. data/spec/type/solaris/service_spec.rb +0 -4
  83. data/spec/type/solaris/user_spec.rb +0 -4
  84. data/spec/type/solaris/zfs_spec.rb +0 -4
  85. data/spec/type/solaris10/file_spec.rb +0 -4
  86. data/spec/type/solaris10/group_spec.rb +0 -4
  87. data/spec/type/solaris10/host_spec.rb +0 -4
  88. data/spec/type/solaris10/package_spec.rb +0 -4
  89. data/spec/type/solaris10/user_spec.rb +0 -4
  90. data/spec/type/suse/package_spec.rb +0 -4
  91. data/spec/type/suse/service_spec.rb +0 -4
  92. data/spec/type/ubuntu/ppa_spec.rb +0 -4
  93. data/spec/type/ubuntu/service_spec.rb +0 -4
  94. data/spec/type/windows/feature_spec.rb +0 -4
  95. data/spec/type/windows/file_spec.rb +0 -4
  96. data/spec/type/windows/group_spec.rb +0 -4
  97. data/spec/type/windows/host_spec.rb +0 -4
  98. data/spec/type/windows/hot_fix_spec.rb +0 -4
  99. data/spec/type/windows/iis_app_pool_spec.rb +0 -4
  100. data/spec/type/windows/iis_webisite_spec.rb +0 -4
  101. data/spec/type/windows/package_spec.rb +0 -4
  102. data/spec/type/windows/port_spec.rb +0 -4
  103. data/spec/type/windows/registry_key_spec.rb +0 -4
  104. data/spec/type/windows/scheduled_task_spec.rb +0 -4
  105. data/spec/type/windows/service_spec.rb +0 -4
  106. data/spec/type/windows/user_spec.rb +0 -4
  107. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfe900aaf63d9ca678daab329a9f1a8bf938e158
4
- data.tar.gz: 979acbe1e6086adbf4dfaedce62ea1467c9b04ad
3
+ metadata.gz: 10e0a503abed00be31b8a9824c6fabd65493265f
4
+ data.tar.gz: 4633170014576075194dc5190171cbc9f8101008
5
5
  SHA512:
6
- metadata.gz: 0ac4886d3067ee1491102ea4e2072d7083e0fd0f41eab7342fce6a797fa7974243a8fc24a0a5ef71bd940e23362f65e4bcdf9a5a3d46bd93079b18717baa4c30
7
- data.tar.gz: 4ec79e587099951c3f1c721d747491f76636f06940f5ce34f02b3ea00ccb96b894825b159a361b95eafcccd806c0c5d84889692ffa5dda1a676ec8f7536b9539
6
+ metadata.gz: b59be2057429d85e4231467ef79ed844364453eca3c041400d56b1709be454c8c1996e642e25b5133ff5cfc290c2da4666f8e41fdca46aa4081cdeb40575fede
7
+ data.tar.gz: c480f1dc7ac100e1c7ae24b1a82b04e17d0131fe32ceef6b372c56264c1b51033edcfaa8cae0d1a3cbd8c81b3534282dfc3a981d7d0ab5beb3bd62d5cfe55d06
data/lib/serverspec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
+ require 'specinfra'
2
3
  require 'rspec'
3
4
  require 'rspec/its'
4
- require 'specinfra'
5
5
  require 'serverspec/version'
6
6
  require 'serverspec/matchers'
7
7
  require 'serverspec/helper'
@@ -2,13 +2,13 @@ module Serverspec
2
2
  module Type
3
3
  class DefaultGateway < Base
4
4
  def ipaddress
5
- ret = @runner.run_command(commands.check_routing_table_has_entry('default'))
5
+ ret = @runner.get_routing_table_entry(:destination => 'default')
6
6
  ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
7
7
  $2 ? $2 : $4
8
8
  end
9
9
 
10
10
  def interface
11
- ret = @runner.run_command(commands.check_routing_table_has_entry('default'))
11
+ ret = @runner.get_routing_table_entry(:destination => 'default')
12
12
  ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
13
13
  $3
14
14
  end
@@ -91,7 +91,7 @@ module Serverspec
91
91
 
92
92
  def content
93
93
  if @content.nil?
94
- @content = @runner.run_command(commands.get_file_content(@name)).stdout
94
+ @content = @runner.get_file_content(@name).stdout
95
95
  end
96
96
  @content
97
97
  end
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class Interface < Base
4
4
  def speed
5
- ret = @runner.run_command(commands.get_interface_speed_of(@name))
5
+ ret = @runner.get_interface_speed_of(@name)
6
6
  val = ret.stdout.strip
7
7
  val = val.to_i if val.match(/^\d+$/)
8
8
  val
@@ -11,7 +11,7 @@ module Serverspec
11
11
  end
12
12
 
13
13
  def version
14
- ret = @runner.run_command(commands.get_package_version(@name)).stdout.strip
14
+ ret = @runner.get_package_version(@name).stdout.strip
15
15
  if ret.empty?
16
16
  nil
17
17
  else
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class Process < Base
4
4
  def running?
5
- pid = @runner.run_command(commands.get_process(@name, :format => "pid=")).stdout
5
+ pid = @runner.get_process(@name, :format => "pid=").stdout
6
6
  not pid.empty?
7
7
  end
8
8
 
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.0.0.beta13"
2
+ VERSION = "2.0.0.beta14"
3
3
  end
data/serverspec.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency "rspec", "~> 3.0.0"
22
22
  spec.add_runtime_dependency "rspec-its"
23
- spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta12"
23
+ spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta13"
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
25
25
  spec.add_development_dependency "rake", "~> 10.1.1"
26
26
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, {:family => 'aix'}
4
4
 
5
- describe commands.command_class('file').create do
6
- it { should be_an_instance_of(Specinfra::Command::Aix::Base::File) }
7
- end
8
-
9
5
  describe file('/tmp') do
10
6
  it { should be_readable.by_user('mail') }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'aix'
4
4
 
5
- describe commands.command_class('group').create do
6
- it { should be_an_instance_of(Specinfra::Command::Aix::Base::Group) }
7
- end
8
-
9
5
  describe group('root') do
10
6
  it { should have_gid 0 }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'aix'
4
4
 
5
- describe commands.command_class('package').create do
6
- it { should be_an_instance_of(Specinfra::Command::Aix::Base::Package) }
7
- end
8
-
9
5
  describe package('httpd') do
10
6
  it { should be_installed }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'aix'
4
4
 
5
- describe commands.command_class('port').create do
6
- it { should be_an_instance_of(Specinfra::Command::Aix::Base::Port) }
7
- end
8
-
9
5
  describe Serverspec::Type::Port do
10
6
  describe port(80) do
11
7
  it { should be_listening }
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'aix'
4
4
 
5
- describe commands.command_class('service').create do
6
- it { should be_an_instance_of(Specinfra::Command::Aix::Base::Service) }
7
- end
8
-
9
5
  describe service('sshd') do
10
6
  it { should be_enabled }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'aix'
4
4
 
5
- describe commands.command_class('user').create do
6
- it { should be_an_instance_of(Specinfra::Command::Aix::Base::User) }
7
- end
8
-
9
5
  describe user('root') do
10
6
  it { should belong_to_group 'root' }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'arch'
4
4
 
5
- describe commands.command_class('file').create do
6
- it { should be_an_instance_of(Specinfra::Command::Arch::Base::File) }
7
- end
8
-
9
5
  describe file('/tmp') do
10
6
  it { should be_readable.by_user('mail') }
11
7
  end
@@ -2,10 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'arch'
4
4
 
5
- describe commands.command_class('package').create do
6
- it { should be_an_instance_of(Specinfra::Command::Arch::Base::Package) }
7
- end
8
-
5
+ =begin
9
6
  describe package('httpd') do
10
7
  it { should be_installed }
11
8
  end
@@ -21,6 +18,7 @@ end
21
18
  describe package('httpd') do
22
19
  it { should_not be_installed.with_version('invalid-version') }
23
20
  end
21
+ =end
24
22
 
25
23
  describe package('httpd') do
26
24
  let(:stdout) { "2.2.15\n" }
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'arch'
4
4
 
5
- describe commands.command_class('service').create do
6
- it { should be_an_instance_of(Specinfra::Command::Arch::Base::Service) }
7
- end
8
-
9
5
  describe service('sshd') do
10
6
  it { should be_enabled }
11
7
  it { should be_running }
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('cron').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::Cron) }
7
- end
8
-
9
5
  describe cron do
10
6
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
11
7
  end
@@ -4,11 +4,8 @@ set :os, :family => 'base'
4
4
 
5
5
  describe default_gateway do
6
6
  let(:stdout) { "default via 192.168.1.1 dev eth1 \r\n" }
7
-
8
7
  its(:ipaddress) { should eq '192.168.1.1' }
9
-
10
8
  its(:interface) { should eq 'eth1' }
11
-
12
9
  its(:ipaddress) { should_not eq '192.168.1.2' }
13
10
  its(:interface) { should_not eq 'eth0' }
14
11
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, {:family => 'base'}
4
4
 
5
- describe commands.command_class('file').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::File) }
7
- end
8
-
9
5
  describe file('/etc/ssh/sshd_config') do
10
6
  it { should be_file }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('group').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::Group) }
7
- end
8
-
9
5
  describe group('root') do
10
6
  it { should exist }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('host').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::Host) }
7
- end
8
-
9
5
  describe host('127.0.0.1') do
10
6
  it { should be_resolvable }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('mail_alias').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::MailAlias) }
7
- end
8
-
9
5
  describe mail_alias('daemon') do
10
6
  it { should be_aliased_to "root" }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('package').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::Package) }
7
- end
8
-
9
5
  describe package('jekyll') do
10
6
  it { should be_installed.by('gem') }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('port').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::Port) }
7
- end
8
-
9
5
  describe Serverspec::Type::Port do
10
6
  describe port(80) do
11
7
  it { should be_listening }
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('process').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::Process) }
7
- end
8
-
9
5
  describe process("memcached") do
10
6
  let(:stdout) { " 1407\n" }
11
7
  its(:pid) { should eq 1407 }
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('routing_table').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::RoutingTable) }
7
- end
8
-
9
5
  describe routing_table do
10
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" }
11
7
  it { should have_entry( :destination => '192.168.100.0/24' ) }
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('service').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::Service) }
7
- end
8
-
9
5
  describe service('sshd') do
10
6
  it { should be_running }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'base'
4
4
 
5
- describe commands.command_class('user').create do
6
- it { should be_an_instance_of(Specinfra::Command::Base::User) }
7
- end
8
-
9
5
  describe user('root') do
10
6
  it { should exist }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'darwin'
4
4
 
5
- describe commands.command_class('file').create do
6
- it { should be_an_instance_of(Specinfra::Command::Darwin::Base::File) }
7
- end
8
-
9
5
  describe file('/tmp') do
10
6
  it { should be_readable.by_user('mail') }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'darwin'
4
4
 
5
- describe commands.command_class('package').create do
6
- it { should be_an_instance_of(Specinfra::Command::Darwin::Base::Package) }
7
- end
8
-
9
5
  describe package('httpd') do
10
6
  it { should be_installed }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'darwin'
4
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
5
  describe Serverspec::Type::Port do
10
6
  describe port(80) do
11
7
  it { should be_listening }
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'darwin'
4
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
5
  describe service('sshd') do
10
6
  it { should be_enabled }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'debian'
4
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
5
  describe package('httpd') do
10
6
  it { should be_installed }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'debian'
4
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
5
  describe service('sshd') do
10
6
  it { should be_enabled }
11
7
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  set :os, :family => 'fedora'
4
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
5
  describe service('sshd') do
10
6
  it { should be_enabled }
11
7
  end