serverspec 2.0.0.beta20 → 2.0.0.beta21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f5c21f68d3a593ac38c66936009b9b391d05981
4
- data.tar.gz: b56991bd56276db1d0bfedc54117f8ad7edc12e2
3
+ metadata.gz: 83316b5641c09a7adf3281b26dacd8fa569dbd7e
4
+ data.tar.gz: 760c91e4b4391c744ac6dbe6eb04942c31fae8cc
5
5
  SHA512:
6
- metadata.gz: a2d6724aa264a39827d3533c71f79aa3f5c90ff67ecbffd7dcc79d57e54951a41a0fd0df6e2fce7a6c12cd9f88002c997ff58443dda6e07b5ca7ca6d180e550e
7
- data.tar.gz: 8c74196779ee1f396a9ae8c215aa4cdf2b6d56ab276460ccb08ace4a03f2a932d730465c41a77644b66b55af202a3389b3ef77ff00db3908c92cddde29700eee
6
+ metadata.gz: 47b30ee4a0c698d6ef27d986894a49589193add7047fad908dd9fcc106d773950309b3dfd66db1b4540e3230e2ff4d051bf63279a78aa56f82d86a8a6921b536
7
+ data.tar.gz: 5eb3f9635119fd3f30fd149da72c2aaa96728ad081281d561fa45476b3f44d4aebce0170b3095415c3f97b4f5dae83e8e2f59fe524ebf84ffae29b4c25c2755f
data/lib/serverspec.rb CHANGED
@@ -16,7 +16,8 @@ module RSpec::Core::Notifications
16
16
  host = ENV['TARGET_HOST'] || Specinfra.configuration.host
17
17
  @failure_lines ||=
18
18
  begin
19
- lines = ["On host `#{host}`"]
19
+ lines = []
20
+ lines << "On host `#{host}'" if host
20
21
  lines << "Failure/Error: #{read_failed_line.strip}"
21
22
  lines << "#{exception_class_name}:" unless exception_class_name =~ /RSpec/
22
23
  exception.message.to_s.split("\n").each do |line|
@@ -4,9 +4,9 @@ module Serverspec
4
4
  types = %w(
5
5
  base cgroup command cron default_gateway file group host
6
6
  iis_website iis_app_pool interface ipfilter ipnat iptables
7
- kernel_module linux_kernel_parameter lxc mail_alias package
8
- php_config port ppa process routing_table selinux service user
9
- yumrepo windows_feature windows_hot_fix windows_registry_key
7
+ ip6tables kernel_module linux_kernel_parameter lxc mail_alias
8
+ package php_config port ppa process routing_table selinux service
9
+ user yumrepo windows_feature windows_hot_fix windows_registry_key
10
10
  windows_scheduled_task zfs
11
11
  )
12
12
 
@@ -23,7 +23,7 @@ require 'serverspec/matcher/be_running'
23
23
  require 'serverspec/matcher/belong_to_group'
24
24
  require 'serverspec/matcher/belong_to_primary_group'
25
25
 
26
- # ipfiter, ipnat, iptables
26
+ # ipfiter, ipnat, iptables, ip6tables
27
27
  require 'serverspec/matcher/have_rule'
28
28
 
29
29
  # cron, routing_table
@@ -1,6 +1,6 @@
1
1
  RSpec::Matchers.define :have_rule do |rule|
2
2
  match do |subject|
3
- if subject.class.name == 'Serverspec::Type::Iptables'
3
+ if subject.class.name == 'Serverspec::Type::Iptables' || subject.class.name == 'Serverspec::Type::Ip6tables'
4
4
  subject.has_rule?(rule, @table, @chain)
5
5
  else
6
6
  subject.has_rule?(rule)
@@ -1,15 +1,11 @@
1
1
  module Serverspec::Type
2
2
  class DefaultGateway < Base
3
3
  def ipaddress
4
- ret = @runner.get_routing_table_entry(:destination => 'default')
5
- ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
6
- $2 ? $2 : $4
4
+ @runner.get_default_gateway(:gateway)
7
5
  end
8
6
 
9
7
  def interface
10
- ret = @runner.get_routing_table_entry(:destination => 'default')
11
- ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
12
- $3
8
+ @runner.get_default_gateway(:interface)
13
9
  end
14
10
 
15
11
  def to_s
@@ -10,5 +10,9 @@ module Serverspec::Type
10
10
  def has_ipv4_address?(ip_address)
11
11
  @runner.check_interface_has_ipv4_address(@name, ip_address)
12
12
  end
13
+
14
+ def has_ipv6_address?(ip_address)
15
+ @runner.check_interface_has_ipv6_address(@name, ip_address)
16
+ end
13
17
  end
14
18
  end
@@ -0,0 +1,13 @@
1
+ module Serverspec
2
+ module Type
3
+ class Ip6tables < Base
4
+ def has_rule?(rule, table, chain)
5
+ @runner.check_ip6tables_has_rule(rule, table, chain)
6
+ end
7
+
8
+ def to_s
9
+ 'ip6tables'
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.0.0.beta20"
2
+ VERSION = "2.0.0.beta21"
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.beta30"
23
+ spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta50"
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
25
25
  spec.add_development_dependency "rake", "~> 10.1.1"
26
26
  end
data/spec/spec_helper.rb CHANGED
@@ -1,11 +1,7 @@
1
1
  require 'serverspec'
2
- require 'pathname'
3
- require 'rspec/mocks/standalone'
4
2
 
5
3
  set :backend, :exec
6
4
 
7
- PROJECT_ROOT = (Pathname.new(File.dirname(__FILE__)) + '..').expand_path
8
-
9
5
  module Specinfra
10
6
  module Backend
11
7
  class Exec < Base
@@ -8,11 +8,15 @@ describe interface('eth0') do
8
8
  end
9
9
 
10
10
  describe interface('eth0') do
11
- it { should have_ipv4_address("192.168.10.10") }
11
+ it { should have_ipv4_address('192.168.10.10') }
12
12
  end
13
13
 
14
14
  describe interface('eth0') do
15
- it { should have_ipv4_address("192.168.10.10/24") }
15
+ it { should have_ipv4_address('192.168.10.10/24') }
16
+ end
17
+
18
+ describe interface('eth0') do
19
+ it { should have_ipv6_address('2001:0db8:bd05:01d2:288a:1fc0:0001:10ee') }
16
20
  end
17
21
 
18
22
  describe interface('invalid-interface') do
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'linux'
4
+
5
+ describe ip6tables do
6
+ it { should have_rule '-P INPUT ACCEPT' }
7
+ end
8
+
9
+ describe ip6tables do
10
+ it { should have_rule('-P INPUT ACCEPT').with_table('mangle').with_chain('INPUT') }
11
+ end
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
data/wercker.yml CHANGED
@@ -1,4 +1,4 @@
1
- box: mizzy/serverspec-base@0.0.3
1
+ box: mizzy/serverspec-base@0.0.5
2
2
  build:
3
3
  steps:
4
4
  - script:
@@ -28,7 +28,7 @@ build:
28
28
  cwd: $WORKING_DIR
29
29
  - script:
30
30
  name: Run itamae
31
- code: bundle exec ./itamae.rb centos65
31
+ code: bundle exec itamae ssh --host centos65 --vagrant recipe.rb
32
32
  cwd: $WORKING_DIR
33
33
  - script:
34
34
  name: Run vagrant reload centos65
@@ -36,7 +36,7 @@ build:
36
36
  cwd: $WORKING_DIR
37
37
  - script:
38
38
  name: Run rake spec:centos65
39
- code: rake spec:centos65
39
+ code: DIGITALOCEAN=true rake spec:centos65
40
40
  cwd: $WORKING_DIR
41
41
  - script:
42
42
  name: Run vagrant up centos70
@@ -44,7 +44,7 @@ build:
44
44
  cwd: $WORKING_DIR
45
45
  - script:
46
46
  name: Run itamae
47
- code: bundle exec ./itamae.rb centos70
47
+ code: bundle exec itamae ssh --host centos70 --vagrant recipe.rb
48
48
  cwd: $WORKING_DIR
49
49
  - script:
50
50
  name: Run vagrant reload centos70
@@ -52,7 +52,7 @@ build:
52
52
  cwd: $WORKING_DIR
53
53
  - script:
54
54
  name: Run rake spec:centos70
55
- code: rake spec:centos70
55
+ code: DIGITALOCEAN=true rake spec:centos70
56
56
  cwd: $WORKING_DIR
57
57
  - script:
58
58
  name: Run vagrant up ubuntu1404
@@ -60,7 +60,7 @@ build:
60
60
  cwd: $WORKING_DIR
61
61
  - script:
62
62
  name: Run itamae
63
- code: bundle exec ./itamae.rb ubuntu1404
63
+ code: bundle exec itamae ssh --host ubuntu1404 --vagrant recipe.rb
64
64
  cwd: $WORKING_DIR
65
65
  - script:
66
66
  name: Run vagrant reload ubuntu1404
@@ -68,7 +68,7 @@ build:
68
68
  cwd: $WORKING_DIR
69
69
  - script:
70
70
  name: Run rake spec:ubuntu1404
71
- code: rake spec:ubuntu1404
71
+ code: DIGITALOCEAN=true rake spec:ubuntu1404
72
72
  cwd: $WORKING_DIR
73
73
 
74
74
  after-steps:
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: 2.0.0.beta20
4
+ version: 2.0.0.beta21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-17 00:00:00.000000000 Z
11
+ date: 2014-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.0.0.beta30
47
+ version: 2.0.0.beta50
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.0.0.beta30
54
+ version: 2.0.0.beta50
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +134,7 @@ files:
134
134
  - lib/serverspec/type/iis_app_pool.rb
135
135
  - lib/serverspec/type/iis_website.rb
136
136
  - lib/serverspec/type/interface.rb
137
+ - lib/serverspec/type/ip6tables.rb
137
138
  - lib/serverspec/type/ipfilter.rb
138
139
  - lib/serverspec/type/ipnat.rb
139
140
  - lib/serverspec/type/iptables.rb
@@ -202,6 +203,7 @@ files:
202
203
  - spec/type/linux/cgroup_spec.rb
203
204
  - spec/type/linux/file_spec.rb
204
205
  - spec/type/linux/interface_spec.rb
206
+ - spec/type/linux/ip6tables_spec.rb
205
207
  - spec/type/linux/iptables_spec.rb
206
208
  - spec/type/linux/kernel_module_spec.rb
207
209
  - spec/type/linux/linux_kernel_parameter_spec.rb
@@ -332,6 +334,7 @@ test_files:
332
334
  - spec/type/linux/cgroup_spec.rb
333
335
  - spec/type/linux/file_spec.rb
334
336
  - spec/type/linux/interface_spec.rb
337
+ - spec/type/linux/ip6tables_spec.rb
335
338
  - spec/type/linux/iptables_spec.rb
336
339
  - spec/type/linux/kernel_module_spec.rb
337
340
  - spec/type/linux/linux_kernel_parameter_spec.rb