serverspec 0.10.4 → 0.10.5
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.
- checksums.yaml +4 -4
 - data/.gitignore +2 -1
 - data/Gemfile +4 -0
 - data/lib/serverspec/commands/aix.rb +1 -1
 - data/lib/serverspec/helper/type.rb +4 -3
 - data/lib/serverspec/type/cgroup.rb +19 -0
 - data/lib/serverspec/version.rb +1 -1
 - data/spec/aix/file_spec.rb +0 -4
 - data/spec/debian/cgroup_spec.rb +16 -0
 - data/spec/gentoo/cgroup_spec.rb +16 -0
 - data/spec/plamo/cgroup_spec.rb +16 -0
 - data/spec/redhat/cgroup_spec.rb +16 -0
 - metadata +11 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: dcb9f644fd856ee0aab06fe035f9bed7af778f61
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 608dc6ee8cc695b3fb48f3426303245c51c63f98
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: cf6c417482127ec3ceca5363de2488829644212f028a67e4601b3c196e72952c65449774d09dc0bf3d7a6b212f564c847d1ca53eafabda8f0549b8e72aeba1f5
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 520fa26e75439d84da59aa679db5e42bfa8184dcabad1a745dc3889bcac9f14400955390ffaa61c81a4be4ad6044b8e067e354dc38bf9b9f64033a36cfe3dda2
         
     | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/Gemfile
    CHANGED
    
    
| 
         @@ -2,9 +2,10 @@ module Serverspec 
     | 
|
| 
       2 
2 
     | 
    
         
             
              module Helper
         
     | 
| 
       3 
3 
     | 
    
         
             
                module Type
         
     | 
| 
       4 
4 
     | 
    
         
             
                  types = %w(
         
     | 
| 
       5 
     | 
    
         
            -
                    base  
     | 
| 
       6 
     | 
    
         
            -
                     
     | 
| 
       7 
     | 
    
         
            -
                     
     | 
| 
      
 5 
     | 
    
         
            +
                    base cgroup command cron default_gateway file group host interface
         
     | 
| 
      
 6 
     | 
    
         
            +
                    ipfilter ipnat iptables kernel_module linux_kernel_parameter mail_alias
         
     | 
| 
      
 7 
     | 
    
         
            +
                    package php_config port routing_table selinux service user yumrepo
         
     | 
| 
      
 8 
     | 
    
         
            +
                    windows_registry_key zfs
         
     | 
| 
       8 
9 
     | 
    
         
             
                  )
         
     | 
| 
       9 
10 
     | 
    
         | 
| 
       10 
11 
     | 
    
         
             
                  types.each {|type| require "serverspec/type/#{type}" }
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Serverspec
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Type
         
     | 
| 
      
 3 
     | 
    
         
            +
                class Cgroup < Base
         
     | 
| 
      
 4 
     | 
    
         
            +
                  attr_accessor :subsystem
         
     | 
| 
      
 5 
     | 
    
         
            +
                  def method_missing(meth)
         
     | 
| 
      
 6 
     | 
    
         
            +
                    if @subsystem.nil?
         
     | 
| 
      
 7 
     | 
    
         
            +
                      @subsystem = meth.to_s
         
     | 
| 
      
 8 
     | 
    
         
            +
                      return self
         
     | 
| 
      
 9 
     | 
    
         
            +
                    else
         
     | 
| 
      
 10 
     | 
    
         
            +
                      param = "#{@subsystem}.#{meth.to_s}"
         
     | 
| 
      
 11 
     | 
    
         
            +
                      ret = backend.run_command("cgget -n -r #{param} #{@name} | awk '{print $2}'")
         
     | 
| 
      
 12 
     | 
    
         
            +
                      val = ret[:stdout].strip
         
     | 
| 
      
 13 
     | 
    
         
            +
                      val = val.to_i if val.match(/^\d+$/)
         
     | 
| 
      
 14 
     | 
    
         
            +
                      val
         
     | 
| 
      
 15 
     | 
    
         
            +
                    end
         
     | 
| 
      
 16 
     | 
    
         
            +
                  end
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/serverspec/version.rb
    CHANGED
    
    
    
        data/spec/aix/file_spec.rb
    CHANGED
    
    | 
         @@ -72,10 +72,6 @@ describe file('/etc/ssh/sshd_config') do 
     | 
|
| 
       72 
72 
     | 
    
         
             
              it { should_not contain('This is invalid text!!').before(/^end/) }
         
     | 
| 
       73 
73 
     | 
    
         
             
            end
         
     | 
| 
       74 
74 
     | 
    
         | 
| 
       75 
     | 
    
         
            -
            describe file('/etc/passwd') do
         
     | 
| 
       76 
     | 
    
         
            -
              it { should be_mode 644 }
         
     | 
| 
       77 
     | 
    
         
            -
            end
         
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
75 
     | 
    
         
             
            describe file('/etc/passwd') do
         
     | 
| 
       80 
76 
     | 
    
         
             
              it { should be_owned_by 'root' }
         
     | 
| 
       81 
77 
     | 
    
         
             
              its(:command) { should eq "ls -al /etc/passwd | awk '{print $3}' | grep -- \\^root\\$" }
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            RSpec.configure do |c|
         
     | 
| 
      
 4 
     | 
    
         
            +
              c.os = 'Debian'
         
     | 
| 
      
 5 
     | 
    
         
            +
            end
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            describe cgroup('group1') do
         
     | 
| 
      
 8 
     | 
    
         
            +
              let(:stdout) { "1\r\n" }
         
     | 
| 
      
 9 
     | 
    
         
            +
              its('cpuset.cpus') { should eq 1 }
         
     | 
| 
      
 10 
     | 
    
         
            +
              its(:command) { should eq "cgget -n -r cpuset.cpus group1 | awk '{print $2}'" }
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            describe cgroup('group1') do
         
     | 
| 
      
 14 
     | 
    
         
            +
              let(:stdout) { "1\r\n" }
         
     | 
| 
      
 15 
     | 
    
         
            +
              its('cpuset.cpus') { should_not eq 0 }
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            RSpec.configure do |c|
         
     | 
| 
      
 4 
     | 
    
         
            +
              c.os = 'Gentoo'
         
     | 
| 
      
 5 
     | 
    
         
            +
            end
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            describe cgroup('group1') do
         
     | 
| 
      
 8 
     | 
    
         
            +
              let(:stdout) { "1\r\n" }
         
     | 
| 
      
 9 
     | 
    
         
            +
              its('cpuset.cpus') { should eq 1 }
         
     | 
| 
      
 10 
     | 
    
         
            +
              its(:command) { should eq "cgget -n -r cpuset.cpus group1 | awk '{print $2}'" }
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            describe cgroup('group1') do
         
     | 
| 
      
 14 
     | 
    
         
            +
              let(:stdout) { "1\r\n" }
         
     | 
| 
      
 15 
     | 
    
         
            +
              its('cpuset.cpus') { should_not eq 0 }
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            RSpec.configure do |c|
         
     | 
| 
      
 4 
     | 
    
         
            +
              c.os = 'RedHat'
         
     | 
| 
      
 5 
     | 
    
         
            +
            end
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            describe cgroup('group1') do
         
     | 
| 
      
 8 
     | 
    
         
            +
              let(:stdout) { "1\r\n" }
         
     | 
| 
      
 9 
     | 
    
         
            +
              its('cpuset.cpus') { should eq 1 }
         
     | 
| 
      
 10 
     | 
    
         
            +
              its(:command) { should eq "cgget -n -r cpuset.cpus group1 | awk '{print $2}'" }
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            describe cgroup('group1') do
         
     | 
| 
      
 14 
     | 
    
         
            +
              let(:stdout) { "1\r\n" }
         
     | 
| 
      
 15 
     | 
    
         
            +
              its('cpuset.cpus') { should_not eq 0 }
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            RSpec.configure do |c|
         
     | 
| 
      
 4 
     | 
    
         
            +
              c.os = 'Debian'
         
     | 
| 
      
 5 
     | 
    
         
            +
            end
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            describe cgroup('group1') do
         
     | 
| 
      
 8 
     | 
    
         
            +
              let(:stdout) { "1\r\n" }
         
     | 
| 
      
 9 
     | 
    
         
            +
              its('cpuset.cpus') { should eq 1 }
         
     | 
| 
      
 10 
     | 
    
         
            +
              its(:command) { should eq "cgget -n -r cpuset.cpus group1 | awk '{print $2}'" }
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            describe cgroup('group1') do
         
     | 
| 
      
 14 
     | 
    
         
            +
              let(:stdout) { "1\r\n" }
         
     | 
| 
      
 15 
     | 
    
         
            +
              its('cpuset.cpus') { should_not eq 0 }
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: serverspec
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.10. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.10.5
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Gosuke Miyashita
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2013-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2013-10-15 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: net-ssh
         
     | 
| 
         @@ -176,6 +176,7 @@ files: 
     | 
|
| 
       176 
176 
     | 
    
         
             
            - lib/serverspec/setup.rb
         
     | 
| 
       177 
177 
     | 
    
         
             
            - lib/serverspec/subject.rb
         
     | 
| 
       178 
178 
     | 
    
         
             
            - lib/serverspec/type/base.rb
         
     | 
| 
      
 179 
     | 
    
         
            +
            - lib/serverspec/type/cgroup.rb
         
     | 
| 
       179 
180 
     | 
    
         
             
            - lib/serverspec/type/command.rb
         
     | 
| 
       180 
181 
     | 
    
         
             
            - lib/serverspec/type/cron.rb
         
     | 
| 
       181 
182 
     | 
    
         
             
            - lib/serverspec/type/default_gateway.rb
         
     | 
| 
         @@ -233,6 +234,7 @@ files: 
     | 
|
| 
       233 
234 
     | 
    
         
             
            - spec/darwin/routing_table_spec.rb
         
     | 
| 
       234 
235 
     | 
    
         
             
            - spec/darwin/service_spec.rb
         
     | 
| 
       235 
236 
     | 
    
         
             
            - spec/darwin/user_spec.rb
         
     | 
| 
      
 237 
     | 
    
         
            +
            - spec/debian/cgroup_spec.rb
         
     | 
| 
       236 
238 
     | 
    
         
             
            - spec/debian/command_spec.rb
         
     | 
| 
       237 
239 
     | 
    
         
             
            - spec/debian/cron_spec.rb
         
     | 
| 
       238 
240 
     | 
    
         
             
            - spec/debian/default_gateway_spec.rb
         
     | 
| 
         @@ -264,6 +266,7 @@ files: 
     | 
|
| 
       264 
266 
     | 
    
         
             
            - spec/freebsd/routing_table_spec.rb
         
     | 
| 
       265 
267 
     | 
    
         
             
            - spec/freebsd/service_spec.rb
         
     | 
| 
       266 
268 
     | 
    
         
             
            - spec/freebsd/user_spec.rb
         
     | 
| 
      
 269 
     | 
    
         
            +
            - spec/gentoo/cgroup_spec.rb
         
     | 
| 
       267 
270 
     | 
    
         
             
            - spec/gentoo/command_spec.rb
         
     | 
| 
       268 
271 
     | 
    
         
             
            - spec/gentoo/cron_spec.rb
         
     | 
| 
       269 
272 
     | 
    
         
             
            - spec/gentoo/default_gateway_spec.rb
         
     | 
| 
         @@ -284,6 +287,7 @@ files: 
     | 
|
| 
       284 
287 
     | 
    
         
             
            - spec/gentoo/user_spec.rb
         
     | 
| 
       285 
288 
     | 
    
         
             
            - spec/gentoo/zfs_spec.rb
         
     | 
| 
       286 
289 
     | 
    
         
             
            - spec/helpers/attributes_spec.rb
         
     | 
| 
      
 290 
     | 
    
         
            +
            - spec/plamo/cgroup_spec.rb
         
     | 
| 
       287 
291 
     | 
    
         
             
            - spec/plamo/command_spec.rb
         
     | 
| 
       288 
292 
     | 
    
         
             
            - spec/plamo/cron_spec.rb
         
     | 
| 
       289 
293 
     | 
    
         
             
            - spec/plamo/default_gateway_spec.rb
         
     | 
| 
         @@ -304,6 +308,7 @@ files: 
     | 
|
| 
       304 
308 
     | 
    
         
             
            - spec/plamo/service_spec.rb.plamo
         
     | 
| 
       305 
309 
     | 
    
         
             
            - spec/plamo/user_spec.rb
         
     | 
| 
       306 
310 
     | 
    
         
             
            - spec/plamo/zfs_spec.rb
         
     | 
| 
      
 311 
     | 
    
         
            +
            - spec/redhat/cgroup_spec.rb
         
     | 
| 
       307 
312 
     | 
    
         
             
            - spec/redhat/command_spec.rb
         
     | 
| 
       308 
313 
     | 
    
         
             
            - spec/redhat/commands_spec.rb
         
     | 
| 
       309 
314 
     | 
    
         
             
            - spec/redhat/cron_spec.rb
         
     | 
| 
         @@ -428,6 +433,7 @@ test_files: 
     | 
|
| 
       428 
433 
     | 
    
         
             
            - spec/darwin/routing_table_spec.rb
         
     | 
| 
       429 
434 
     | 
    
         
             
            - spec/darwin/service_spec.rb
         
     | 
| 
       430 
435 
     | 
    
         
             
            - spec/darwin/user_spec.rb
         
     | 
| 
      
 436 
     | 
    
         
            +
            - spec/debian/cgroup_spec.rb
         
     | 
| 
       431 
437 
     | 
    
         
             
            - spec/debian/command_spec.rb
         
     | 
| 
       432 
438 
     | 
    
         
             
            - spec/debian/cron_spec.rb
         
     | 
| 
       433 
439 
     | 
    
         
             
            - spec/debian/default_gateway_spec.rb
         
     | 
| 
         @@ -459,6 +465,7 @@ test_files: 
     | 
|
| 
       459 
465 
     | 
    
         
             
            - spec/freebsd/routing_table_spec.rb
         
     | 
| 
       460 
466 
     | 
    
         
             
            - spec/freebsd/service_spec.rb
         
     | 
| 
       461 
467 
     | 
    
         
             
            - spec/freebsd/user_spec.rb
         
     | 
| 
      
 468 
     | 
    
         
            +
            - spec/gentoo/cgroup_spec.rb
         
     | 
| 
       462 
469 
     | 
    
         
             
            - spec/gentoo/command_spec.rb
         
     | 
| 
       463 
470 
     | 
    
         
             
            - spec/gentoo/cron_spec.rb
         
     | 
| 
       464 
471 
     | 
    
         
             
            - spec/gentoo/default_gateway_spec.rb
         
     | 
| 
         @@ -479,6 +486,7 @@ test_files: 
     | 
|
| 
       479 
486 
     | 
    
         
             
            - spec/gentoo/user_spec.rb
         
     | 
| 
       480 
487 
     | 
    
         
             
            - spec/gentoo/zfs_spec.rb
         
     | 
| 
       481 
488 
     | 
    
         
             
            - spec/helpers/attributes_spec.rb
         
     | 
| 
      
 489 
     | 
    
         
            +
            - spec/plamo/cgroup_spec.rb
         
     | 
| 
       482 
490 
     | 
    
         
             
            - spec/plamo/command_spec.rb
         
     | 
| 
       483 
491 
     | 
    
         
             
            - spec/plamo/cron_spec.rb
         
     | 
| 
       484 
492 
     | 
    
         
             
            - spec/plamo/default_gateway_spec.rb
         
     | 
| 
         @@ -499,6 +507,7 @@ test_files: 
     | 
|
| 
       499 
507 
     | 
    
         
             
            - spec/plamo/service_spec.rb.plamo
         
     | 
| 
       500 
508 
     | 
    
         
             
            - spec/plamo/user_spec.rb
         
     | 
| 
       501 
509 
     | 
    
         
             
            - spec/plamo/zfs_spec.rb
         
     | 
| 
      
 510 
     | 
    
         
            +
            - spec/redhat/cgroup_spec.rb
         
     | 
| 
       502 
511 
     | 
    
         
             
            - spec/redhat/command_spec.rb
         
     | 
| 
       503 
512 
     | 
    
         
             
            - spec/redhat/commands_spec.rb
         
     | 
| 
       504 
513 
     | 
    
         
             
            - spec/redhat/cron_spec.rb
         
     |