Sha256: a501cbb4c459a6386206d4b8ab1d050821be3d0f8e80e1919728bcb788acf509

Contents?: true

Size: 1.7 KB

Versions: 27

Compression:

Stored size: 1.7 KB

Contents

require 'spec_helper'

include Serverspec::Helper::Solaris10

describe 'check_zfs' do
  context 'check without properties' do
    subject { commands.check_zfs('rpool') }
    it { should eq "zfs list -H rpool" }
  end

  context 'check with a property' do
    subject { commands.check_zfs('rpool', { 'mountpoint' => '/rpool' }) }
    it { should eq "zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
  end

  context 'check with multiple properties' do
    subject { commands.check_zfs('rpool', { 'mountpoint'  => '/rpool', 'compression' => 'off' }) }
    it { should eq "zfs list -H -o compression rpool | grep -- \\^off\\$ && zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
  end
end

describe 'check_ip_filter_rule' do
  subject { commands.check_ipfilter_rule('pass in quick on lo0 all') }
  it { should eq "ipfstat -io 2> /dev/null | grep -- pass\\ in\\ quick\\ on\\ lo0\\ all" }
end

describe 'check_ipnat_rule' do
  subject { commands.check_ipnat_rule('map net1 192.168.0.0/24 -> 0.0.0.0/32') }
  it { should eq "ipnat -l 2> /dev/null | grep -- \\^map\\ net1\\ 192.168.0.0/24\\ -\\>\\ 0.0.0.0/32\\$" }
end

describe 'check_svcprop' do
  subject { commands.check_svcprop('svc:/network/http:apache22', 'httpd/enable_64bit','false') }
  it { should eq "svcprop -p httpd/enable_64bit svc:/network/http:apache22 | grep -- \\^false\\$" }
end

describe 'check_svcprops' do
  subject {
    commands.check_svcprops('svc:/network/http:apache22', {
      'httpd/enable_64bit' => 'false',
      'httpd/server_type'  => 'worker',
    })
  }
  it { should eq "svcprop -p httpd/enable_64bit svc:/network/http:apache22 | grep -- \\^false\\$ && svcprop -p httpd/server_type svc:/network/http:apache22 | grep -- \\^worker\\$" }
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
serverspec-0.9.4 spec/solaris10/commands_spec.rb
serverspec-0.9.3 spec/solaris10/commands_spec.rb
serverspec-0.9.2 spec/solaris10/commands_spec.rb
serverspec-0.9.1 spec/solaris10/commands_spec.rb
serverspec-0.9.0 spec/solaris10/commands_spec.rb
serverspec-0.8.1 spec/solaris10/commands_spec.rb
serverspec-0.8.0 spec/solaris10/commands_spec.rb
serverspec-0.7.13 spec/solaris10/commands_spec.rb
serverspec-0.7.12 spec/solaris10/commands_spec.rb
serverspec-0.7.11 spec/solaris10/commands_spec.rb
serverspec-0.7.10 spec/solaris10/commands_spec.rb
serverspec-0.7.9 spec/solaris10/commands_spec.rb
serverspec-0.7.8 spec/solaris10/commands_spec.rb
serverspec-0.7.7 spec/solaris10/commands_spec.rb
serverspec-0.7.6 spec/solaris10/commands_spec.rb
serverspec-0.7.5 spec/solaris10/commands_spec.rb
serverspec-0.7.4 spec/solaris10/commands_spec.rb
serverspec-0.7.3 spec/solaris10/commands_spec.rb
serverspec-0.7.2 spec/solaris10/commands_spec.rb
serverspec-0.7.1 spec/solaris10/commands_spec.rb