specinfra 2.37.5 → 2.37.6

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: 26aae46d93a52fe9be0bf48a361b4fc7df7dac7d
4
- data.tar.gz: 8d5d8091031b25961d6fa92ccc173be8e698bda9
3
+ metadata.gz: 36a656182853eec32ae07fd4664afd2c25ed6425
4
+ data.tar.gz: 4f42b1d1155f8617a6ab60d85ece08ffb3a05d6e
5
5
  SHA512:
6
- metadata.gz: 4c4dc1b2806c1d9e4eb821cfebb64c25c9404bc2357f2db47eb60a15f82450828a00cd9e78ed828bd70ce43f7e18e87a9324cd1616b37fdac61a24e9a658ee76
7
- data.tar.gz: b6152e6dc12d93169fd73c60e2d6ca037998b6fc33eeff9c28f86fc14426d76f17cacbf26d7334d4b4077c0f72f9715936f1d055480f594cf8c341800ebd5c8b
6
+ metadata.gz: 5838d02f668de7a7f1c025b2c77b04be3ae32297348412c6911fbd4439d38e3db815bd6e1c0030df9576894fc50fa02e24dfcd4616779511fcd4da9094fe3c10
7
+ data.tar.gz: 2f525eaf1bc2c90af280af07ec00fbc233c5466fd4a97e027773814c020889f9f31a3c8b497e748b9db8b1c4fbef1a90d588a06424eb5c322e89cd7619595120
@@ -79,6 +79,7 @@ require 'specinfra/command/esxi/base/package'
79
79
  require 'specinfra/command/redhat'
80
80
  require 'specinfra/command/redhat/base'
81
81
  require 'specinfra/command/redhat/base/file'
82
+ require 'specinfra/command/redhat/base/host'
82
83
  require 'specinfra/command/redhat/base/iptables'
83
84
  require 'specinfra/command/redhat/base/package'
84
85
  require 'specinfra/command/redhat/base/service'
@@ -90,6 +91,7 @@ require 'specinfra/command/redhat/v5/iptables'
90
91
 
91
92
  # RedHat V7 (inherit RedHat)
92
93
  require 'specinfra/command/redhat/v7'
94
+ require 'specinfra/command/redhat/v7/host'
93
95
  require 'specinfra/command/redhat/v7/service'
94
96
  require 'specinfra/command/redhat/v7/port'
95
97
 
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Redhat::Base::Host < Specinfra::Command::Base::Host
2
+ end
@@ -0,0 +1,15 @@
1
+ class Specinfra::Command::Redhat::V7::Host < Specinfra::Command::Redhat::Base::Host
2
+ class << self
3
+ def check_is_reachable(host, port, proto, timeout)
4
+ if port.nil?
5
+ "ping -w #{escape(timeout)} -c 2 -n #{escape(host)}"
6
+ else
7
+ # RHEL7 comes with ncat which does no longer sport the -z option
8
+ # hence this kludge
9
+ "ncat -vvvv#{escape(proto[0].chr)} #{escape(host)} #{escape(port)} " +
10
+ "-w #{escape(timeout)} -i #{escape(timeout)} 2>&1 | " +
11
+ "grep -q SUCCESS"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.37.5"
2
+ VERSION = "2.37.6"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
+ property[:os] = nil
3
4
  set :os, { :family => 'redhat' }
4
5
 
5
6
  describe get_command(:check_package_is_installed, 'httpd') do
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ property[:os] = nil
4
+ set :os, :family => 'redhat', :release => '7'
5
+
6
+
7
+ describe get_command(:check_host_is_reachable, 'example.jp', '53', 'udp', 2) do
8
+ it { should eq "ncat -vvvvu example.jp 53 -w 2 -i 2 2>&1 | grep -q SUCCESS" }
9
+ end
10
+
11
+ describe get_command(:check_host_is_reachable, 'example.jp', '80', 'tcp', 3) do
12
+ it { should eq "ncat -vvvvt example.jp 80 -w 3 -i 3 2>&1 | grep -q SUCCESS" }
13
+ 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.37.5
4
+ version: 2.37.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -325,6 +325,7 @@ files:
325
325
  - lib/specinfra/command/redhat.rb
326
326
  - lib/specinfra/command/redhat/base.rb
327
327
  - lib/specinfra/command/redhat/base/file.rb
328
+ - lib/specinfra/command/redhat/base/host.rb
328
329
  - lib/specinfra/command/redhat/base/iptables.rb
329
330
  - lib/specinfra/command/redhat/base/package.rb
330
331
  - lib/specinfra/command/redhat/base/port.rb
@@ -333,6 +334,7 @@ files:
333
334
  - lib/specinfra/command/redhat/v5.rb
334
335
  - lib/specinfra/command/redhat/v5/iptables.rb
335
336
  - lib/specinfra/command/redhat/v7.rb
337
+ - lib/specinfra/command/redhat/v7/host.rb
336
338
  - lib/specinfra/command/redhat/v7/port.rb
337
339
  - lib/specinfra/command/redhat/v7/service.rb
338
340
  - lib/specinfra/command/smartos.rb
@@ -467,9 +469,10 @@ files:
467
469
  - spec/command/module/systemd_spec.rb
468
470
  - spec/command/module/zfs_spec.rb
469
471
  - spec/command/openbsd/file_spec.rb
470
- - spec/command/redhat/interface_spec.rb
471
472
  - spec/command/redhat/package_spec.rb
472
473
  - spec/command/redhat/service_spec.rb
474
+ - spec/command/redhat7/host_spec.rb
475
+ - spec/command/redhat7/interface_spec.rb
473
476
  - spec/command/redhat7/port_spec.rb
474
477
  - spec/command/redhat7/service_spec.rb
475
478
  - spec/command/ubuntu/ppa_spec.rb
@@ -552,9 +555,10 @@ test_files:
552
555
  - spec/command/module/systemd_spec.rb
553
556
  - spec/command/module/zfs_spec.rb
554
557
  - spec/command/openbsd/file_spec.rb
555
- - spec/command/redhat/interface_spec.rb
556
558
  - spec/command/redhat/package_spec.rb
557
559
  - spec/command/redhat/service_spec.rb
560
+ - spec/command/redhat7/host_spec.rb
561
+ - spec/command/redhat7/interface_spec.rb
558
562
  - spec/command/redhat7/port_spec.rb
559
563
  - spec/command/redhat7/service_spec.rb
560
564
  - spec/command/ubuntu/ppa_spec.rb