passivedns-client 2.1.7 → 2.1.13

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.
@@ -205,11 +205,12 @@ module PassiveDNS # :nodoc:
205
205
  # creates an SQLite3-based Passive DNS Client state
206
206
  # only argument is the filename of the sqlite3 database
207
207
  def initialize(sqlitedb=nil)
208
+ @debug = false
208
209
  puts "PDNSToolState initialize #{sqlitedb}" if @debug
209
210
  @level = 0
210
211
  @sqlitedb = sqlitedb
211
212
  raise "Cannot use this class without a database file" unless @sqlitedb
212
- unless File.exists?(@sqlitedb)
213
+ unless File.exist?(@sqlitedb)
213
214
  newdb = true
214
215
  end
215
216
  @sqlitedbh = SQLite3::Database.new(@sqlitedb)
@@ -2,6 +2,6 @@ module PassiveDNS # :nodoc:
2
2
  # coodinates the lookups accross all configured PassiveDNS providers
3
3
  class Client
4
4
  # version of PassiveDNS::Client
5
- VERSION = "2.1.7"
5
+ VERSION = "2.1.13"
6
6
  end
7
7
  end
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'json', '>= 1.4.3'
22
- spec.add_runtime_dependency 'sqlite3', '>= 1.3.3'
23
- spec.add_runtime_dependency 'structformatter', '~> 0.0.1'
24
- spec.add_runtime_dependency 'configparser', '~> 0.1.3'
25
- spec.add_development_dependency "minitest", "~> 5.5"
26
- spec.add_development_dependency "bundler", "~> 1.3"
21
+ spec.add_runtime_dependency 'json'
22
+ spec.add_runtime_dependency 'sqlite3'
23
+ spec.add_runtime_dependency 'structformatter'
24
+ spec.add_runtime_dependency 'configparser'
25
+ spec.add_development_dependency "minitest"
26
+ spec.add_development_dependency "bundler"
27
27
  spec.add_development_dependency "rake"
28
28
 
29
29
  #spec.signing_key = "#{File.dirname(__FILE__)}/../gem-private_key.pem"
@@ -13,26 +13,22 @@ require_relative '../lib/passivedns/client/cli.rb'
13
13
  class TestCLI < Minitest::Test
14
14
  def test_letter_map
15
15
  letter_map = PassiveDNS::CLI.get_letter_map
16
- assert_equal("3bcdmprtv", letter_map.keys.sort.join(""))
16
+ assert_equal("cdprv", letter_map.keys.sort.join(""))
17
17
  end
18
18
 
19
19
  def test_help_text
20
20
  helptext = PassiveDNS::CLI.run(["--help"])
21
21
  helptext.gsub!(/Usage: .*?\[/, "Usage: [")
22
22
  assert_equal(
23
- "Usage: [-d [3bcdmprtv]] [-g|-v|-m|-c|-x|-y|-j|-t] [-os <sep>] [-f <file>] [-r#|-w#|-v] [-l <count>] <ip|domain|cidr>
23
+ "Usage: [-d [cdprv]] [-g|-v|-m|-c|-x|-y|-j|-t] [-os <sep>] [-f <file>] [-r#|-w#|-v] [-l <count>] [--config <file>] <ip|domain|cidr>
24
24
  Passive DNS Providers
25
- -d3bcdmprtv uses all of the available passive dns database
26
- -d3 use 360.cn
27
- -db use BFK.de
25
+ -dcdprv uses all of the available passive dns database
28
26
  -dc use CIRCL
29
27
  -dd use DNSDB
30
- -dm use Mnemonic
31
28
  -dp use PassiveTotal
32
29
  -dr use RiskIQ
33
- -dt use TCPIPUtils
34
30
  -dv use VirusTotal
35
- -dvt uses VirusTotal and TCPIPUtils (for example)
31
+ -dvr uses VirusTotal and RiskIQ (for example)
36
32
 
37
33
  Output Formatting
38
34
  -g link-nodal GDF visualization definition
@@ -51,6 +47,9 @@ State and Recursion
51
47
  -w# specifies the amount of time to wait, in seconds, between queries (Default: 0)
52
48
  -l <count> limits the number of records returned per passive dns database queried.
53
49
 
50
+ Specifying a Configuration File
51
+ --config <file> specifies a config file. default: #{ENV['HOME']}/.passivedns-client
52
+
54
53
  Getting Help
55
54
  -h hello there. This option produces this helpful help information on how to access help.
56
55
  -v debugging information
@@ -59,7 +58,7 @@ Getting Help
59
58
 
60
59
  def test_provider_parsing
61
60
  options_target = {
62
- :pdnsdbs => ["bfk"],
61
+ :pdnsdbs => ["virustotal"],
63
62
  :format => "text",
64
63
  :sep => "\t",
65
64
  :recursedepth => 1,
@@ -68,30 +67,21 @@ Getting Help
68
67
  :debug => false,
69
68
  :sqlitedb => nil,
70
69
  :limit => nil,
71
- :help => false
70
+ :help => false,
71
+ :configfile => "#{ENV['HOME']}/.passivedns-client"
72
72
  }
73
73
 
74
74
  options, items = PassiveDNS::CLI.parse_command_line([])
75
75
  assert_equal(options_target, options)
76
76
  assert_equal([], items)
77
-
78
- options_target[:pdnsdbs] = ["cn360"]
79
- options, items = PassiveDNS::CLI.parse_command_line(["-d3"])
80
- assert_equal(options_target, options)
81
- assert_equal([], items)
82
-
83
- options_target[:pdnsdbs] = ["bfk"]
84
- options, items = PassiveDNS::CLI.parse_command_line(["-db"])
85
- assert_equal(options_target, options)
86
- assert_equal([], items)
87
-
88
- options_target[:pdnsdbs] = ["circl", "dnsdb", "mnemonic", "riskiq"]
89
- options, items = PassiveDNS::CLI.parse_command_line(["-dcdmr"])
77
+
78
+ options_target[:pdnsdbs] = ["circl", "dnsdb", "riskiq"]
79
+ options, items = PassiveDNS::CLI.parse_command_line(["-dcdr"])
90
80
  assert_equal(options_target, options)
91
81
  assert_equal([], items)
92
82
 
93
- options_target[:pdnsdbs] = ["passivetotal", "tcpiputils", "virustotal"]
94
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv"])
83
+ options_target[:pdnsdbs] = ["passivetotal", "virustotal"]
84
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv"])
95
85
  assert_equal(options_target, options)
96
86
  assert_equal([], items)
97
87
 
@@ -99,7 +89,7 @@ Getting Help
99
89
 
100
90
  def test_output_parsing
101
91
  options_target = {
102
- :pdnsdbs => ["passivetotal", "tcpiputils", "virustotal"],
92
+ :pdnsdbs => ["passivetotal", "virustotal"],
103
93
  :format => "text",
104
94
  :sep => "\t",
105
95
  :recursedepth => 1,
@@ -108,52 +98,53 @@ Getting Help
108
98
  :debug => false,
109
99
  :sqlitedb => nil,
110
100
  :limit => nil,
111
- :help => false
101
+ :help => false,
102
+ :configfile => "#{ENV['HOME']}/.passivedns-client"
112
103
  }
113
104
 
114
105
  options_target[:sep] = ","
115
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-c", "8.8.8.8"])
106
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-c", "8.8.8.8"])
116
107
  assert_equal(options_target, options)
117
108
  assert_equal(["8.8.8.8"], items)
118
109
 
119
110
  options_target[:sep] = "|"
120
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-s", "|", "8.8.8.8"])
111
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-s", "|", "8.8.8.8"])
121
112
  assert_equal(options_target, options)
122
113
  assert_equal(["8.8.8.8"], items)
123
114
 
124
115
  options_target[:sep] = "\t"
125
116
 
126
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-t", "8.8.8.8"])
117
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-t", "8.8.8.8"])
127
118
  assert_equal(options_target, options)
128
119
  assert_equal(["8.8.8.8"], items)
129
120
 
130
121
  options_target[:format] = "json"
131
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-j", "8.8.8.8"])
122
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-j", "8.8.8.8"])
132
123
  assert_equal(options_target, options)
133
124
  assert_equal(["8.8.8.8"], items)
134
125
 
135
126
  options_target[:format] = "xml"
136
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-x", "8.8.8.8"])
127
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-x", "8.8.8.8"])
137
128
  assert_equal(options_target, options)
138
129
  assert_equal(["8.8.8.8"], items)
139
130
 
140
131
  options_target[:format] = "yaml"
141
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-y", "8.8.8.8"])
132
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-y", "8.8.8.8"])
142
133
  assert_equal(options_target, options)
143
134
  assert_equal(["8.8.8.8"], items)
144
135
 
145
136
  options_target[:format] = "gdf"
146
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-g", "8.8.8.8"])
137
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-g", "8.8.8.8"])
147
138
  assert_equal(options_target, options)
148
139
  assert_equal(["8.8.8.8"], items)
149
140
 
150
141
  options_target[:format] = "graphviz"
151
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-z", "8.8.8.8"])
142
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-z", "8.8.8.8"])
152
143
  assert_equal(options_target, options)
153
144
  assert_equal(["8.8.8.8"], items)
154
145
 
155
146
  options_target[:format] = "graphml"
156
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-m", "8.8.8.8"])
147
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-m", "8.8.8.8"])
157
148
  assert_equal(options_target, options)
158
149
  assert_equal(["8.8.8.8"], items)
159
150
 
@@ -162,7 +153,7 @@ Getting Help
162
153
 
163
154
  def test_help_debug_parsing
164
155
  options_target = {
165
- :pdnsdbs => ["passivetotal", "tcpiputils", "virustotal"],
156
+ :pdnsdbs => ["passivetotal", "virustotal"],
166
157
  :format => "text",
167
158
  :sep => "\t",
168
159
  :recursedepth => 1,
@@ -171,22 +162,23 @@ Getting Help
171
162
  :debug => false,
172
163
  :sqlitedb => nil,
173
164
  :limit => nil,
174
- :help => true
165
+ :help => true,
166
+ :configfile => "#{ENV['HOME']}/.passivedns-client"
175
167
  }
176
168
 
177
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-h", "8.8.8.8"])
169
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-h", "8.8.8.8"])
178
170
  assert_equal(options_target, options)
179
171
  assert_equal(["8.8.8.8"], items)
180
172
 
181
173
  options_target[:debug] = true
182
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-h", "-v", "8.8.8.8"])
174
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-h", "-v", "8.8.8.8"])
183
175
  assert_equal(options_target, options)
184
176
  assert_equal(["8.8.8.8"], items)
185
177
  end
186
178
 
187
179
  def test_state_recursion_parsing
188
180
  options_target = {
189
- :pdnsdbs => ["passivetotal", "tcpiputils", "virustotal"],
181
+ :pdnsdbs => ["passivetotal", "virustotal"],
190
182
  :format => "text",
191
183
  :sep => "\t",
192
184
  :recursedepth => 5,
@@ -195,11 +187,33 @@ Getting Help
195
187
  :debug => false,
196
188
  :sqlitedb => "test.db",
197
189
  :limit => 10,
198
- :help => false
190
+ :help => false,
191
+ :configfile => "#{ENV['HOME']}/.passivedns-client"
199
192
  }
200
193
 
201
- options, items = PassiveDNS::CLI.parse_command_line(["-dptv", "-f", "test.db", "-r", "5", "-w", "30", "-l", "10", "8.8.8.8"])
194
+ options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-f", "test.db", "-r", "5", "-w", "30", "-l", "10", "8.8.8.8"])
202
195
  assert_equal(options_target, options)
203
196
  assert_equal(["8.8.8.8"], items)
204
197
  end
198
+
199
+ def test_configuration_file
200
+ options_target = {
201
+ :pdnsdbs => ["virustotal"],
202
+ :format => "text",
203
+ :sep => "\t",
204
+ :recursedepth => 1,
205
+ :wait => 0,
206
+ :res => nil,
207
+ :debug => false,
208
+ :sqlitedb => nil,
209
+ :limit => nil,
210
+ :help => false,
211
+ :configfile => "#{ENV['HOME']}/.passivedns-client"
212
+ }
213
+
214
+ options, items = PassiveDNS::CLI.parse_command_line(["--config", "#{ENV['HOME']}/.passivedns-client"])
215
+ assert_equal(options_target, options)
216
+ assert_equal([], items)
217
+
218
+ end
205
219
  end
@@ -1,9 +1,9 @@
1
1
  unless Kernel.respond_to?(:require_relative)
2
- module Kernel
3
- def require_relative(path)
4
- require File.join(File.dirname(caller[0]), path.to_str)
5
- end
6
- end
2
+ module Kernel
3
+ def require_relative(path)
4
+ require File.join(File.dirname(caller[0]), path.to_str)
5
+ end
6
+ end
7
7
  end
8
8
 
9
9
  require_relative 'helper'
@@ -22,59 +22,40 @@ class TestPassiveDnsQuery < Minitest::Test
22
22
  end
23
23
  end
24
24
 
25
- def test_instantiate_Nonexisting_Client
26
- assert_raises RuntimeError do
27
- PassiveDNS::Client.new(['doesnotexist'])
28
- end
29
- end
25
+ def test_instantiate_Nonexisting_Client
26
+ assert_raises RuntimeError do
27
+ PassiveDNS::Client.new(['doesnotexist'])
28
+ end
29
+ end
30
30
 
31
- def test_instantiate_All_Clients
32
- PassiveDNS::Client.new()
33
- end
34
-
35
- def test_instantiate_Passive_DNS_State
36
- refute_nil(PassiveDNS::PDNSToolState.new)
37
- end
38
-
39
- def test_instantiate_Passive_DNS_State_database
40
- if File.exists?("test/test.sqlite3")
41
- File.unlink("test/test.sqlite3")
42
- end
43
- refute_nil(PassiveDNS::PDNSToolStateDB.new("test/test.sqlite3"))
44
- if File.exists?("test/test.sqlite3")
45
- File.unlink("test/test.sqlite3")
46
- end
47
- end
48
-
49
- def test_BFK
50
- PassiveDNS::Client.new(['bfk'])
51
- d = PassiveDNS::Provider::BFK.new(@cp['bfk'] || {})
31
+ def test_instantiate_All_Clients
32
+ PassiveDNS::Client.new()
33
+ end
34
+
35
+ def test_instantiate_Passive_DNS_State
36
+ refute_nil(PassiveDNS::PDNSToolState.new)
37
+ end
38
+
39
+ def test_instantiate_Passive_DNS_State_database
40
+ if File.exist?("test/test.sqlite3")
41
+ File.unlink("test/test.sqlite3")
42
+ end
43
+ refute_nil(PassiveDNS::PDNSToolStateDB.new("test/test.sqlite3"))
44
+ if File.exist?("test/test.sqlite3")
45
+ File.unlink("test/test.sqlite3")
46
+ end
47
+ end
48
+
49
+ def test_DNSDB
50
+ PassiveDNS::Client.new(['dnsdb'])
51
+ d = PassiveDNS::Provider::DNSDB.new(@cp['dnsdb'] || {})
52
52
  refute_nil(d)
53
- rows = d.lookup("example.org",3)
54
- refute_nil(rows)
55
- refute_nil(rows.to_s)
56
- refute_nil(rows.to_xml)
57
- refute_nil(rows.to_json)
58
- refute_nil(rows.to_yaml)
59
- assert_equal(3, rows.length)
60
- rows = d.lookup("8.8.8.8")
53
+ rows = d.lookup("example.org",3)
61
54
  refute_nil(rows)
62
55
  refute_nil(rows.to_s)
63
56
  refute_nil(rows.to_xml)
64
57
  refute_nil(rows.to_json)
65
58
  refute_nil(rows.to_yaml)
66
- end
67
-
68
- def test_DNSDB
69
- PassiveDNS::Client.new(['dnsdb'])
70
- d = PassiveDNS::Provider::DNSDB.new(@cp['dnsdb'] || {})
71
- refute_nil(d)
72
- rows = d.lookup("example.org",3)
73
- refute_nil(rows)
74
- refute_nil(rows.to_s)
75
- refute_nil(rows.to_xml)
76
- refute_nil(rows.to_json)
77
- refute_nil(rows.to_yaml)
78
59
  assert_equal(3, rows.length) # this will fail since DNSDB has an off by one error
79
60
  rows = d.lookup("8.8.8.8")
80
61
  refute_nil(rows)
@@ -82,18 +63,18 @@ class TestPassiveDnsQuery < Minitest::Test
82
63
  refute_nil(rows.to_xml)
83
64
  refute_nil(rows.to_json)
84
65
  refute_nil(rows.to_yaml)
85
- end
66
+ end
86
67
 
87
- def test_VirusTotal
88
- PassiveDNS::Client.new(['virustotal'])
68
+ def test_VirusTotal
69
+ PassiveDNS::Client.new(['virustotal'])
89
70
  d = PassiveDNS::Provider::VirusTotal.new(@cp['virustotal'] || {})
90
71
  refute_nil(d)
91
- rows = d.lookup("google.com",3)
92
- refute_nil(rows)
93
- refute_nil(rows.to_s)
94
- refute_nil(rows.to_xml)
95
- refute_nil(rows.to_json)
96
- refute_nil(rows.to_yaml)
72
+ rows = d.lookup("google.com",3)
73
+ refute_nil(rows)
74
+ refute_nil(rows.to_s)
75
+ refute_nil(rows.to_xml)
76
+ refute_nil(rows.to_json)
77
+ refute_nil(rows.to_yaml)
97
78
  assert_equal(3, rows.length)
98
79
  rows = d.lookup("8.8.8.8")
99
80
  refute_nil(rows)
@@ -101,11 +82,11 @@ class TestPassiveDnsQuery < Minitest::Test
101
82
  refute_nil(rows.to_xml)
102
83
  refute_nil(rows.to_json)
103
84
  refute_nil(rows.to_yaml)
104
- end
85
+ end
105
86
 
106
- def test_TCPIPUtils
107
- PassiveDNS::Client.new(['tcpiputils'])
108
- d = PassiveDNS::Provider::TCPIPUtils.new(@cp['tcpiputils'] || {})
87
+ def test_passivetotal
88
+ PassiveDNS::Client.new(['passivetotal'])
89
+ d = PassiveDNS::Provider::PassiveTotal.new(@cp['passivetotal'] || {})
109
90
  refute_nil(d)
110
91
  rows = d.lookup("example.org")
111
92
  refute_nil(rows)
@@ -113,12 +94,13 @@ class TestPassiveDnsQuery < Minitest::Test
113
94
  refute_nil(rows.to_xml)
114
95
  refute_nil(rows.to_json)
115
96
  refute_nil(rows.to_yaml)
116
- rows = d.lookup("example.org",3)
97
+ rows = d.lookup("example.org", 3)
117
98
  refute_nil(rows)
118
99
  refute_nil(rows.to_s)
119
100
  refute_nil(rows.to_xml)
120
101
  refute_nil(rows.to_json)
121
102
  refute_nil(rows.to_yaml)
103
+ puts(rows)
122
104
  assert_equal(3, rows.length)
123
105
  rows = d.lookup("8.8.8.8")
124
106
  refute_nil(rows)
@@ -127,10 +109,10 @@ class TestPassiveDnsQuery < Minitest::Test
127
109
  refute_nil(rows.to_json)
128
110
  refute_nil(rows.to_yaml)
129
111
  end
130
-
131
- def test_cn360
132
- PassiveDNS::Client.new(['cn360'])
133
- d = PassiveDNS::Provider::CN360.new(@cp['cn360'] || {})
112
+
113
+ def test_circl
114
+ PassiveDNS::Client.new(['circl'])
115
+ d = PassiveDNS::Provider::CIRCL.new(@cp['circl'] || {})
134
116
  refute_nil(d)
135
117
  rows = d.lookup("example.org")
136
118
  refute_nil(rows)
@@ -151,105 +133,30 @@ class TestPassiveDnsQuery < Minitest::Test
151
133
  refute_nil(rows.to_xml)
152
134
  refute_nil(rows.to_json)
153
135
  refute_nil(rows.to_yaml)
154
- end
155
-
156
- def test_nmemonic
157
- PassiveDNS::Client.new(['mnemonic'])
158
- d = PassiveDNS::Provider::Mnemonic.new(@cp['mnemonic'] || {})
159
- refute_nil(d)
160
- rows = d.lookup("example.org")
161
- refute_nil(rows)
162
- refute_nil(rows.to_s)
163
- refute_nil(rows.to_xml)
164
- refute_nil(rows.to_json)
165
- refute_nil(rows.to_yaml)
166
- rows = d.lookup("example.org",3)
167
- refute_nil(rows)
168
- refute_nil(rows.to_s)
169
- refute_nil(rows.to_xml)
170
- refute_nil(rows.to_json)
171
- refute_nil(rows.to_yaml)
172
- assert_equal(3, rows.length)
173
- rows = d.lookup("8.8.8.8")
174
- refute_nil(rows)
175
- refute_nil(rows.to_s)
176
- refute_nil(rows.to_xml)
177
- refute_nil(rows.to_json)
178
- refute_nil(rows.to_yaml)
179
- end
180
-
181
- def test_passivetotal
182
- PassiveDNS::Client.new(['passivetotal'])
183
- d = PassiveDNS::Provider::PassiveTotal.new(@cp['passivetotal'] || {})
184
- refute_nil(d)
185
- rows = d.lookup("example.org")
186
- refute_nil(rows)
187
- refute_nil(rows.to_s)
188
- refute_nil(rows.to_xml)
189
- refute_nil(rows.to_json)
190
- refute_nil(rows.to_yaml)
191
- rows = d.lookup("example.org",3)
192
- refute_nil(rows)
193
- refute_nil(rows.to_s)
194
- refute_nil(rows.to_xml)
195
- refute_nil(rows.to_json)
196
- refute_nil(rows.to_yaml)
197
- assert_equal(3, rows.length)
198
- rows = d.lookup("8.8.8.8")
199
- refute_nil(rows)
200
- refute_nil(rows.to_s)
201
- refute_nil(rows.to_xml)
202
- refute_nil(rows.to_json)
203
- refute_nil(rows.to_yaml)
204
- end
205
-
206
- def test_circl
207
- PassiveDNS::Client.new(['circl'])
208
- d = PassiveDNS::Provider::CIRCL.new(@cp['circl'] || {})
209
- refute_nil(d)
210
- rows = d.lookup("example.org")
211
- refute_nil(rows)
212
- refute_nil(rows.to_s)
213
- refute_nil(rows.to_xml)
214
- refute_nil(rows.to_json)
215
- refute_nil(rows.to_yaml)
216
- rows = d.lookup("example.org",3)
217
- refute_nil(rows)
218
- refute_nil(rows.to_s)
219
- refute_nil(rows.to_xml)
220
- refute_nil(rows.to_json)
221
- refute_nil(rows.to_yaml)
222
- assert_equal(3, rows.length)
223
- rows = d.lookup("8.8.8.8")
224
- refute_nil(rows)
225
- refute_nil(rows.to_s)
226
- refute_nil(rows.to_xml)
227
- refute_nil(rows.to_json)
228
- refute_nil(rows.to_yaml)
229
- end
136
+ end
230
137
 
231
138
  def test_riskiq
232
- PassiveDNS::Client.new(['riskiq'])
139
+ PassiveDNS::Client.new(['riskiq'])
233
140
  d = PassiveDNS::Provider::RiskIQ.new(@cp['riskiq'] || {})
234
141
  refute_nil(d)
235
- rows = d.lookup("example.org")
236
- refute_nil(rows)
237
- refute_nil(rows.to_s)
238
- refute_nil(rows.to_xml)
239
- refute_nil(rows.to_json)
240
- refute_nil(rows.to_yaml)
241
- rows = d.lookup("example.org",3)
242
- refute_nil(rows)
243
- refute_nil(rows.to_s)
244
- refute_nil(rows.to_xml)
245
- refute_nil(rows.to_json)
246
- refute_nil(rows.to_yaml)
247
- assert_equal(3, rows.length)
248
- rows = d.lookup("8.8.8.8")
249
- refute_nil(rows)
250
- refute_nil(rows.to_s)
251
- refute_nil(rows.to_xml)
252
- refute_nil(rows.to_json)
253
- refute_nil(rows.to_yaml)
254
- end
142
+ rows = d.lookup("example.org")
143
+ refute_nil(rows)
144
+ refute_nil(rows.to_s)
145
+ refute_nil(rows.to_xml)
146
+ refute_nil(rows.to_json)
147
+ refute_nil(rows.to_yaml)
148
+ rows = d.lookup("example.org",3)
149
+ refute_nil(rows)
150
+ refute_nil(rows.to_s)
151
+ refute_nil(rows.to_xml)
152
+ refute_nil(rows.to_json)
153
+ refute_nil(rows.to_yaml)
154
+ assert_equal(3, rows.length)
155
+ rows = d.lookup("8.8.8.8")
156
+ refute_nil(rows)
157
+ refute_nil(rows.to_s)
158
+ refute_nil(rows.to_xml)
159
+ refute_nil(rows.to_json)
160
+ refute_nil(rows.to_yaml)
161
+ end
255
162
  end