specinfra 2.0.0.beta45 → 2.0.0.beta46

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: da34115f7301508e58d4ce39282f0424d6f2ca9b
4
- data.tar.gz: fe5b623278cdebae40aaec7dad64ed3e676be930
3
+ metadata.gz: 6ef443698205c62b7286f11f976c9e5fc2095ade
4
+ data.tar.gz: b9aededa5d8a142d8934a83de794580ccc6f77c6
5
5
  SHA512:
6
- metadata.gz: dfdbfe7d21fd49334d4b27cd5088cea06f89528a1ff342e2f95997be59c7bc26d929ef50dae149c5db7e542423fb126114c909c9912201b0b28087e0de47982c
7
- data.tar.gz: 60e692b38a48cd2f040b452ddf4bb474c604fd118288822a76db4ebe07d4058fddaf2a42f83dbe9d692b4a3be188bf12e616d5a698efc91e2937ef81912e3cc8
6
+ metadata.gz: c70f63fb853464ff83b7773449a76decaa009cad8ccb454f46b57948f5f57c46a203dba841211b715d22b32572148f8e4acc3717915273fe125968cd5012adf0
7
+ data.tar.gz: 789b9b9a72f2d83eee74476ec9aa6fc1770ada83789a45079d4ae9348f73fe8277b51c85490b1926c9756211a6a412cfa9b2247c0b018fe765184feb96455cbc
@@ -18,6 +18,7 @@ require 'specinfra/command/base/iptables'
18
18
  require 'specinfra/command/base/ip6tables'
19
19
  require 'specinfra/command/base/kernel_module'
20
20
  require 'specinfra/command/base/lxc_container'
21
+ require 'specinfra/command/base/localhost'
21
22
  require 'specinfra/command/base/mail_alias'
22
23
  require 'specinfra/command/base/package'
23
24
  require 'specinfra/command/base/port'
@@ -0,0 +1,7 @@
1
+ class Specinfra::Command::Base::Localhost < Specinfra::Command::Base
2
+ class << self
3
+ def check_is_ec2_instance
4
+ 'curl --connect-timeout=1 http://169.254.169.254:80/'
5
+ end
6
+ end
7
+ end
@@ -14,6 +14,17 @@ class Specinfra::Command::Linux::Base::Interface < Specinfra::Command::Base::Int
14
14
  ip_address.gsub!(".", "\\.")
15
15
  "ip addr show #{interface} | grep 'inet #{ip_address}'"
16
16
  end
17
+
18
+ def check_has_ipv6_address(interface, ip_address)
19
+ ip_address = ip_address.dup
20
+ if ip_address =~ /\/\d+$/
21
+ ip_address << " "
22
+ else
23
+ ip_address << "/"
24
+ end
25
+ ip_address.downcase!
26
+ "ip addr show #{interface} | grep 'inet6 #{ip_address}'"
27
+ end
17
28
  end
18
29
  end
19
30
 
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.0.0.beta45"
2
+ VERSION = "2.0.0.beta46"
3
3
  end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, { :family => nil }
4
+
5
+ describe get_command(:check_localhost_is_ec2_instance) do
6
+ it { should eq 'curl --connect-timeout=1 http://169.254.169.254:80/' }
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'linux'
4
+
5
+ describe get_command(:check_interface_has_ipv6_address, 'eth0', '2001:0db8:bd05:01d2:288a:1fc0:0001:10ee') do
6
+ it { should eq "ip addr show eth0 | grep 'inet6 2001:0db8:bd05:01d2:288a:1fc0:0001:10ee/'" }
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta45
4
+ version: 2.0.0.beta46
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-09-02 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -160,6 +160,7 @@ files:
160
160
  - lib/specinfra/command/base/ipnat.rb
161
161
  - lib/specinfra/command/base/iptables.rb
162
162
  - lib/specinfra/command/base/kernel_module.rb
163
+ - lib/specinfra/command/base/localhost.rb
163
164
  - lib/specinfra/command/base/lxc_container.rb
164
165
  - lib/specinfra/command/base/mail_alias.rb
165
166
  - lib/specinfra/command/base/package.rb
@@ -326,9 +327,11 @@ files:
326
327
  - spec/backend/exec/env_spec.rb
327
328
  - spec/backend/ssh/build_command_spec.rb
328
329
  - spec/command/base/file_spec.rb
330
+ - spec/command/base/localhost_spec.rb
329
331
  - spec/command/base/user_spec.rb
330
332
  - spec/command/debian/service_spec.rb
331
333
  - spec/command/factory_spec.rb
334
+ - spec/command/linux/interface_spec.rb
332
335
  - spec/command/linux/ip6tables_spec.rb
333
336
  - spec/command/module/systemd_spec.rb
334
337
  - spec/command/redhat/interface_spec.rb
@@ -371,9 +374,11 @@ test_files:
371
374
  - spec/backend/exec/env_spec.rb
372
375
  - spec/backend/ssh/build_command_spec.rb
373
376
  - spec/command/base/file_spec.rb
377
+ - spec/command/base/localhost_spec.rb
374
378
  - spec/command/base/user_spec.rb
375
379
  - spec/command/debian/service_spec.rb
376
380
  - spec/command/factory_spec.rb
381
+ - spec/command/linux/interface_spec.rb
377
382
  - spec/command/linux/ip6tables_spec.rb
378
383
  - spec/command/module/systemd_spec.rb
379
384
  - spec/command/redhat/interface_spec.rb