igp 1.0.0 → 1.1.0
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/.github/workflows/ruby.yml +2 -0
- data/.gitignore +2 -3
- data/.rubocop_todo.yml +3 -0
- data/CHANGELOG +11 -0
- data/igp.gemspec +3 -0
- data/lib/igp/base.rb +2 -3
- data/lib/igp/shell.rb +5 -6
- data/lib/igp/version.rb +1 -1
- data/lib/igp.rb +1 -0
- data/lib/net/ping/ldap.rb +105 -0
- data/spec/base_spec.rb +10 -11
- data/spec/net/ping/ldap_spec.rb +193 -0
- data/spec/shell_spec.rb +38 -39
- metadata +46 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea3cd46567b9578ee580171eefef7ef44de44cd62acb3e809ba5644db1bdf8b
|
4
|
+
data.tar.gz: 1a2d1f5b44a460bf2b68d797b1d5c24b87f2130522db6d3e73ff2ecd451d210d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cbf84188e9ee2d1f7d50ac9e36b8d7d80260f134fd595de7032191821aae37b6b500f7ca5e5320d0c091d7be6e4c58ca9ba3629c1961e7366974890e87d15ce
|
7
|
+
data.tar.gz: 76c1fe528924bb24918cc721e1ee9b9aba476f577858356eff0f35442c1f38b1ef2e3cc017ae12136564a30dd0949f92081525b824bfdda179b4b806e6f89584
|
data/.github/workflows/ruby.yml
CHANGED
data/.gitignore
CHANGED
@@ -14,6 +14,8 @@
|
|
14
14
|
Gemfile.lock
|
15
15
|
.ruby-version
|
16
16
|
.ruby-gemset
|
17
|
+
*.gem
|
18
|
+
pkg
|
17
19
|
|
18
20
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
19
21
|
.rvmrc
|
@@ -21,9 +23,6 @@ Gemfile.lock
|
|
21
23
|
# rcov generated
|
22
24
|
coverage
|
23
25
|
|
24
|
-
# jeweler generated
|
25
|
-
pkg
|
26
|
-
|
27
26
|
# logs
|
28
27
|
log
|
29
28
|
*.log
|
data/.rubocop_todo.yml
CHANGED
@@ -38,6 +38,7 @@ Style/ClassAndModuleChildren:
|
|
38
38
|
Exclude:
|
39
39
|
- 'lib/igp/base.rb'
|
40
40
|
- 'lib/igp/shell.rb'
|
41
|
+
- 'lib/net/ping/ldap.rb'
|
41
42
|
|
42
43
|
# Offense count: 1
|
43
44
|
# Cop supports --auto-correct.
|
@@ -72,8 +73,10 @@ Style/FrozenStringLiteralComment:
|
|
72
73
|
- 'lib/igp/base.rb'
|
73
74
|
- 'lib/igp/shell.rb'
|
74
75
|
- 'lib/igp/version.rb'
|
76
|
+
- 'lib/net/ping/ldap.rb'
|
75
77
|
- 'spec/base_spec.rb'
|
76
78
|
- 'spec/format_spec.rb'
|
79
|
+
- 'spec/net/ping/ldap_spec.rb'
|
77
80
|
- 'spec/shell_spec.rb'
|
78
81
|
- 'spec/spec_helper.rb'
|
79
82
|
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
Version 1.1.0 Release: 2022-03-01
|
2
|
+
==================================================
|
3
|
+
|
4
|
+
* added back LDAP ping functionality (built-in for now)
|
5
|
+
|
6
|
+
Version 1.0.0 Release: 2022-03-01
|
7
|
+
==================================================
|
8
|
+
|
9
|
+
* updated to ruby 2.7+ and net-ping 2.0.8+
|
10
|
+
* LDAP functionality removed (since dropped from net-ping)
|
11
|
+
|
1
12
|
Version 0.0.3 Release: 7th May 2011
|
2
13
|
==================================================
|
3
14
|
* more ruby 1.8.7 compatibility fixes:
|
data/igp.gemspec
CHANGED
@@ -20,14 +20,17 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
22
|
spec.add_runtime_dependency 'getoptions', '~> 0.3'
|
23
|
+
spec.add_runtime_dependency 'net-ldap', '~> 0.16.0'
|
23
24
|
spec.add_runtime_dependency 'net-ping', '~> 2.0.8'
|
24
25
|
|
25
26
|
spec.add_development_dependency 'bundler'
|
27
|
+
spec.add_development_dependency 'fakeldap', '~> 0.1.1'
|
26
28
|
spec.add_development_dependency 'guard-rspec'
|
27
29
|
spec.add_development_dependency 'rake'
|
28
30
|
spec.add_development_dependency 'rb-fsevent'
|
29
31
|
spec.add_development_dependency 'rdoc'
|
30
32
|
spec.add_development_dependency 'rspec'
|
31
33
|
spec.add_development_dependency 'rubocop'
|
34
|
+
spec.add_development_dependency 'ruby-ldapserver', '~> 0.5.0'
|
32
35
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
33
36
|
end
|
data/lib/igp/base.rb
CHANGED
@@ -33,9 +33,8 @@ class Igp::Base
|
|
33
33
|
@ping_handler = Net::Ping::TCP.new(@options[:host], @options[:port])
|
34
34
|
when :http, :https
|
35
35
|
@ping_handler = Net::Ping::HTTP.new(@options[:url])
|
36
|
-
|
37
|
-
|
38
|
-
# @ping_handler = Net::Ping::LDAP.new(@options[:url])
|
36
|
+
when :ldap, :ldaps
|
37
|
+
@ping_handler = Net::Ping::LDAP.new(@options[:url])
|
39
38
|
end
|
40
39
|
end
|
41
40
|
|
data/lib/igp/shell.rb
CHANGED
@@ -52,8 +52,7 @@ class Igp::Shell
|
|
52
52
|
# runs the ping task
|
53
53
|
def run
|
54
54
|
case options[:type]
|
55
|
-
|
56
|
-
when :icmp, :http, :https, :tcp, :udp # :ldap, :ldaps
|
55
|
+
when :icmp, :http, :https, :tcp, :udp, :ldap, :ldaps
|
57
56
|
Igp::Base.new(options).run
|
58
57
|
else
|
59
58
|
usage
|
@@ -101,10 +100,10 @@ class Igp::Shell
|
|
101
100
|
igp http://localhost:8080
|
102
101
|
igp https://localhost:4443
|
103
102
|
|
103
|
+
LDAP/S ping:
|
104
|
+
igp ldap://localhost
|
105
|
+
igp ldaps://localhost:6636
|
106
|
+
|
104
107
|
EOS
|
105
|
-
# TODO: LDAP was retired from net-ping. to add back in one way or another
|
106
|
-
# LDAP/S ping:
|
107
|
-
# igp ldap://localhost
|
108
|
-
# igp ldaps://localhost:6636
|
109
108
|
end
|
110
109
|
end
|
data/lib/igp/version.rb
CHANGED
data/lib/igp.rb
CHANGED
@@ -0,0 +1,105 @@
|
|
1
|
+
require 'net/ping'
|
2
|
+
require 'net/ldap'
|
3
|
+
require 'uri'
|
4
|
+
|
5
|
+
# The Net module serves as a namespace only.
|
6
|
+
module Net
|
7
|
+
# The Ping::LDAP class encapsulates methods for LDAP pings.
|
8
|
+
class Ping::LDAP < Ping
|
9
|
+
# uri contains the URI object for the request
|
10
|
+
#
|
11
|
+
attr_accessor :uri
|
12
|
+
|
13
|
+
# username and password may be set for ping using
|
14
|
+
# an authenticated LDAP bind
|
15
|
+
#
|
16
|
+
attr_accessor :username
|
17
|
+
attr_accessor :password
|
18
|
+
|
19
|
+
# set/get the encryption method. By default nil,
|
20
|
+
# but may be set to :simple_tls
|
21
|
+
#
|
22
|
+
attr_reader :encryption
|
23
|
+
|
24
|
+
def encryption=(value)
|
25
|
+
@encryption = value.is_a?(Symbol) ? value : value.to_sym
|
26
|
+
end
|
27
|
+
|
28
|
+
# Creates and returns a new Ping::LDAP object.
|
29
|
+
# The default +timeout+ is 5 seconds.
|
30
|
+
#
|
31
|
+
# +uri+ string is expected to be a full URI with scheme (ldap/ldaps)
|
32
|
+
# and optionally the port (else default port is assumed) e.g.
|
33
|
+
# ldap://my.ldap.host.com
|
34
|
+
# ldap://my.ldap.host.com:1389
|
35
|
+
# ldaps://my.ldap.host.com
|
36
|
+
# ldaps://my.ldap.host.com:6636
|
37
|
+
#
|
38
|
+
# If a plain hostname is provided as the +uri+, a default port of 389 is assumed
|
39
|
+
#
|
40
|
+
def initialize(uri = nil, timeout = 5)
|
41
|
+
host, port = decode_uri(uri)
|
42
|
+
super(host, port, timeout)
|
43
|
+
end
|
44
|
+
|
45
|
+
# method used to decode uri string
|
46
|
+
#
|
47
|
+
def decode_uri(value)
|
48
|
+
@uri = URI.parse(value)
|
49
|
+
if uri.scheme =~ /ldap/
|
50
|
+
p = @port = uri.port
|
51
|
+
h = @host = uri.host
|
52
|
+
@encryption = uri.scheme == 'ldaps' ? :simple_tls : nil
|
53
|
+
else
|
54
|
+
h = value
|
55
|
+
p = 389
|
56
|
+
end
|
57
|
+
[h, p]
|
58
|
+
end
|
59
|
+
|
60
|
+
# constructs the LDAP configuration structure
|
61
|
+
#
|
62
|
+
def config
|
63
|
+
{
|
64
|
+
host: uri.host,
|
65
|
+
port: uri.port,
|
66
|
+
encryption: encryption
|
67
|
+
}.merge(
|
68
|
+
if username && password
|
69
|
+
{ auth: { method: :simple, username: username, password: password } }
|
70
|
+
else
|
71
|
+
{ auth: { method: :anonymous } }
|
72
|
+
end
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
# perform ping, optionally providing the ping destination uri
|
77
|
+
#
|
78
|
+
def ping(host = nil)
|
79
|
+
decode_uri(host) if host
|
80
|
+
super(@host)
|
81
|
+
|
82
|
+
bool = false
|
83
|
+
|
84
|
+
start_time = Time.now
|
85
|
+
|
86
|
+
begin
|
87
|
+
Timeout.timeout(@timeout) do
|
88
|
+
Net::LDAP.new(config).bind
|
89
|
+
end
|
90
|
+
rescue StandardError => e
|
91
|
+
@exception = e.message
|
92
|
+
else
|
93
|
+
bool = true
|
94
|
+
end
|
95
|
+
|
96
|
+
# There is no duration if the ping failed
|
97
|
+
@duration = Time.now - start_time if bool
|
98
|
+
|
99
|
+
bool
|
100
|
+
end
|
101
|
+
|
102
|
+
alias ping? ping
|
103
|
+
alias pingecho ping
|
104
|
+
end
|
105
|
+
end
|
data/spec/base_spec.rb
CHANGED
@@ -40,17 +40,16 @@ describe Igp::Base do
|
|
40
40
|
base = Igp::Base.new(options)
|
41
41
|
expect(base.ping_handler).to be_a(Net::Ping::HTTP)
|
42
42
|
end
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
# end
|
43
|
+
it 'should be Net::Ping::LDAP for :ldap' do
|
44
|
+
options = { type: :ldap, url: 'ldap://localhost' }
|
45
|
+
base = Igp::Base.new(options)
|
46
|
+
expect(base.ping_handler).to be_a(Net::Ping::LDAP)
|
47
|
+
end
|
48
|
+
it 'should be Net::Ping::LDAP for :ldaps' do
|
49
|
+
options = { type: :ldaps, url: 'ldaps://localhost' }
|
50
|
+
base = Igp::Base.new(options)
|
51
|
+
expect(base.ping_handler).to be_a(Net::Ping::LDAP)
|
52
|
+
end
|
54
53
|
end
|
55
54
|
|
56
55
|
describe '#run' do
|
@@ -0,0 +1,193 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'fakeldap'
|
3
|
+
|
4
|
+
describe Net::Ping::LDAP do
|
5
|
+
before :all do
|
6
|
+
@ldap_server = FakeLDAP::Server.new(port: 2389)
|
7
|
+
@ldap_server.run_tcpserver
|
8
|
+
@ldap_server.add_user('cn=el.Daper,ou=USERS,dc=example,dc=com', 'ldappassword')
|
9
|
+
end
|
10
|
+
|
11
|
+
after :all do
|
12
|
+
@ldap_server.stop
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when valid ldap url' do
|
16
|
+
let(:timeout) { 30 }
|
17
|
+
let(:cn) { 'el.Daper' }
|
18
|
+
let(:password) { 'ldappassword' }
|
19
|
+
let(:uri) { 'ldap://localhost:2389' }
|
20
|
+
subject(:ldap) do
|
21
|
+
ldap = Net::Ping::LDAP.new(uri, timeout)
|
22
|
+
ldap.username = cn
|
23
|
+
ldap.password = password
|
24
|
+
ldap
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '#ping' do
|
28
|
+
subject { ldap.ping }
|
29
|
+
it 'ping basic functionality' do
|
30
|
+
expect { subject }.to_not raise_error
|
31
|
+
expect(subject).to eql(true)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
describe '#ping?' do
|
35
|
+
subject { ldap.ping? }
|
36
|
+
it 'returns a boolean' do
|
37
|
+
expect(subject).to eql(true)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
describe '#pingecho' do
|
41
|
+
subject { ldap.pingecho }
|
42
|
+
it 'returns a boolean' do
|
43
|
+
expect(subject).to eql(true)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
describe '#duration' do
|
47
|
+
subject { ldap.duration }
|
48
|
+
before { ldap.ping }
|
49
|
+
it 'returns a float' do
|
50
|
+
expect(subject).to be_a(Float)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'when bad ldap url' do
|
56
|
+
let(:uri) { 'ldap://blabfoobarurghxxxx.com' }
|
57
|
+
subject(:ldap) { Net::Ping::LDAP.new(uri) }
|
58
|
+
describe '#ping' do
|
59
|
+
subject { ldap.ping }
|
60
|
+
it 'ping basic functionality' do
|
61
|
+
expect { subject }.to_not raise_error
|
62
|
+
expect(subject).to eql(false)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
describe '#ping?' do
|
66
|
+
subject { ldap.ping? }
|
67
|
+
it 'returns a boolean' do
|
68
|
+
expect(subject).to eql(false)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
describe '#pingecho' do
|
72
|
+
subject { ldap.pingecho }
|
73
|
+
it 'returns a boolean' do
|
74
|
+
expect(subject).to eql(false)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
describe '#duration' do
|
78
|
+
subject { ldap.duration }
|
79
|
+
before { ldap.ping }
|
80
|
+
it 'returns nil' do
|
81
|
+
expect(subject).to be_nil
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# test 'host attribute basic functionality' do
|
87
|
+
# assert_respond_to(@ldap, :host)
|
88
|
+
# assert_respond_to(@ldap, :host=)
|
89
|
+
# assert_equal(@@host, @ldap.host)
|
90
|
+
# end
|
91
|
+
|
92
|
+
# test 'port attribute basic functionality' do
|
93
|
+
# assert_respond_to(@ldap, :port)
|
94
|
+
# assert_respond_to(@ldap, :port=)
|
95
|
+
# end
|
96
|
+
|
97
|
+
# test 'port attribute expected value' do
|
98
|
+
# assert_equal(@@port, @ldap.port)
|
99
|
+
# end
|
100
|
+
|
101
|
+
# test 'timeout attribute basic functionality' do
|
102
|
+
# assert_respond_to(@ldap, :timeout)
|
103
|
+
# assert_respond_to(@ldap, :timeout=)
|
104
|
+
# end
|
105
|
+
|
106
|
+
# test 'timeout attribute expected values' do
|
107
|
+
# assert_equal(@@timeout, @ldap.timeout)
|
108
|
+
# assert_equal(5, @bad.timeout)
|
109
|
+
# end
|
110
|
+
|
111
|
+
# test 'exception attribute basic functionality' do
|
112
|
+
# assert_respond_to(@ldap, :exception)
|
113
|
+
# assert_nil(@ldap.exception)
|
114
|
+
# end
|
115
|
+
|
116
|
+
# test 'exception attribute is nil if the ping is successful' do
|
117
|
+
# assert_true(@ldap.ping)
|
118
|
+
# assert_nil(@ldap.exception)
|
119
|
+
# end
|
120
|
+
|
121
|
+
# test 'exception attribute is not nil if the ping is unsuccessful' do
|
122
|
+
# assert_false(@bad.ping)
|
123
|
+
# assert_not_nil(@bad.exception)
|
124
|
+
# end
|
125
|
+
|
126
|
+
# test 'warning attribute basic functionality' do
|
127
|
+
# assert_respond_to(@ldap, :warning)
|
128
|
+
# assert_nil(@ldap.warning)
|
129
|
+
# end
|
130
|
+
|
131
|
+
# test 'uri attribute basic functionality' do
|
132
|
+
# assert_respond_to(@ldap, :uri)
|
133
|
+
# assert_respond_to(@ldap, :uri=)
|
134
|
+
# end
|
135
|
+
|
136
|
+
# test 'username attribute basic functionality' do
|
137
|
+
# assert_respond_to(@ldap, :username)
|
138
|
+
# assert_respond_to(@ldap, :username=)
|
139
|
+
# end
|
140
|
+
|
141
|
+
# test 'password attribute basic functionality' do
|
142
|
+
# assert_respond_to(@ldap, :password)
|
143
|
+
# assert_respond_to(@ldap, :password=)
|
144
|
+
# end
|
145
|
+
|
146
|
+
# test 'encryption attribute basic functionality' do
|
147
|
+
# assert_respond_to(@ldap, :encryption)
|
148
|
+
# assert_respond_to(@ldap, :encryption=)
|
149
|
+
# end
|
150
|
+
|
151
|
+
# test 'encryption defaults to nil for ldap' do
|
152
|
+
# assert_nil(Net::Ping::LDAP.new('ldap://somehost.example.net').encryption)
|
153
|
+
# end
|
154
|
+
|
155
|
+
# test 'encryption defaults to simple_tls for ldaps' do
|
156
|
+
# assert_equal(:simple_tls, Net::Ping::LDAP.new('ldaps://somehost.example.net').encryption)
|
157
|
+
# end
|
158
|
+
|
159
|
+
# test 'port defaults to 389 for ldap' do
|
160
|
+
# assert_equal(389, Net::Ping::LDAP.new('ldap://somehost.example.net').port)
|
161
|
+
# end
|
162
|
+
|
163
|
+
# test 'port defaults to 636 for ldaps' do
|
164
|
+
# assert_equal(636, Net::Ping::LDAP.new('ldaps://somehost.example.net').port)
|
165
|
+
# end
|
166
|
+
|
167
|
+
# test 'port extracted from uri if provided' do
|
168
|
+
# assert_equal(12345, Net::Ping::LDAP.new('ldap://somehost.example.net:12345').port)
|
169
|
+
# assert_equal(12345, Net::Ping::LDAP.new('ldaps://somehost.example.net:12345').port)
|
170
|
+
# end
|
171
|
+
|
172
|
+
# test 'encryption setting is forced to symbol' do
|
173
|
+
# @ldap.encryption = 'simple_tls'
|
174
|
+
# assert_true( @ldap.encryption.is_a? Symbol )
|
175
|
+
# assert_true( @ldap.config[:encryption].is_a? Symbol )
|
176
|
+
# end
|
177
|
+
|
178
|
+
# test 'username/password set in config auth section' do
|
179
|
+
# @ldap.username, @ldap.password = 'fred', 'derf'
|
180
|
+
# assert_equal('fred', @ldap.config[:auth][:username] )
|
181
|
+
# assert_equal('derf', @ldap.config[:auth][:password] )
|
182
|
+
# end
|
183
|
+
|
184
|
+
# test 'auth method defaults to simple if username/password set' do
|
185
|
+
# @ldap.username, @ldap.password = 'fred', 'derf'
|
186
|
+
# assert_equal(:simple, @ldap.config[:auth][:method] )
|
187
|
+
# end
|
188
|
+
|
189
|
+
# test 'if no username/password then defaults to auth anonymous' do
|
190
|
+
# @ldap.username = @ldap.password = nil
|
191
|
+
# assert_equal({:method => :anonymous}, @ldap.config[:auth] )
|
192
|
+
# end
|
193
|
+
end
|
data/spec/shell_spec.rb
CHANGED
@@ -117,44 +117,43 @@ describe Igp::Shell do
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
# end
|
120
|
+
describe 'ldap configuration' do
|
121
|
+
before(:each) do
|
122
|
+
@type = :ldap
|
123
|
+
@host = 'localhost'
|
124
|
+
@port = 389
|
125
|
+
@options_server_value = "#{@type}://#{@host}"
|
126
|
+
@shell = Igp::Shell.new(GetOptions.new(Igp::Shell::OPTIONS, []), [@options_server_value])
|
127
|
+
end
|
128
|
+
it 'should support url accessor' do
|
129
|
+
expect(@shell.options[:url]).to eql(@options_server_value)
|
130
|
+
end
|
131
|
+
it 'should default to tcp ping with url when given server with tcp protocol setting' do
|
132
|
+
expect(@shell.options[:type]).to eql(@type)
|
133
|
+
end
|
134
|
+
it 'should resolve host/port' do
|
135
|
+
expect(@shell.options[:host]).to eql(@host)
|
136
|
+
expect(@shell.options[:port]).to eql(@port)
|
137
|
+
end
|
138
|
+
end
|
140
139
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
140
|
+
describe 'ldaps configuration' do
|
141
|
+
before(:each) do
|
142
|
+
@type = :ldaps
|
143
|
+
@host = 'localhost'
|
144
|
+
@port = 636
|
145
|
+
@options_server_value = "#{@type}://#{@host}"
|
146
|
+
@shell = Igp::Shell.new(GetOptions.new(Igp::Shell::OPTIONS, []), [@options_server_value])
|
147
|
+
end
|
148
|
+
it 'should support url accessor' do
|
149
|
+
expect(@shell.options[:url]).to eql(@options_server_value)
|
150
|
+
end
|
151
|
+
it 'should default to tcp ping with url when given server with tcp protocol setting' do
|
152
|
+
expect(@shell.options[:type]).to eql(@type)
|
153
|
+
end
|
154
|
+
it 'should resolve host/port' do
|
155
|
+
expect(@shell.options[:host]).to eql(@host)
|
156
|
+
expect(@shell.options[:port]).to eql(@port)
|
157
|
+
end
|
158
|
+
end
|
160
159
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: igp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Gallagher
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: net-ldap
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.16.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.16.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: net-ping
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +66,20 @@ dependencies:
|
|
52
66
|
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fakeldap
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.1
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: guard-rspec
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +164,20 @@ dependencies:
|
|
136
164
|
- - ">="
|
137
165
|
- !ruby/object:Gem::Version
|
138
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: ruby-ldapserver
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 0.5.0
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 0.5.0
|
139
181
|
description: 'Simple command-line server monitoring with a range of protocols: ICMP,
|
140
182
|
TCP, UDP, HTTP/S, LDAP/S'
|
141
183
|
email:
|
@@ -161,8 +203,10 @@ files:
|
|
161
203
|
- lib/igp/base.rb
|
162
204
|
- lib/igp/shell.rb
|
163
205
|
- lib/igp/version.rb
|
206
|
+
- lib/net/ping/ldap.rb
|
164
207
|
- spec/base_spec.rb
|
165
208
|
- spec/format_spec.rb
|
209
|
+
- spec/net/ping/ldap_spec.rb
|
166
210
|
- spec/shell_spec.rb
|
167
211
|
- spec/spec_helper.rb
|
168
212
|
homepage: https://github.com/tardate/igp
|
@@ -192,5 +236,6 @@ summary: It goes PING!
|
|
192
236
|
test_files:
|
193
237
|
- spec/base_spec.rb
|
194
238
|
- spec/format_spec.rb
|
239
|
+
- spec/net/ping/ldap_spec.rb
|
195
240
|
- spec/shell_spec.rb
|
196
241
|
- spec/spec_helper.rb
|