recog 2.3.22 → 2.3.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/.github/workflows/verify.yml +1 -1
  4. data/.vscode/bin/monitor-recog-fingerprints.sh +54 -0
  5. data/.vscode/extensions.json +5 -0
  6. data/.vscode/settings.json +8 -0
  7. data/.vscode/tasks.json +77 -0
  8. data/CONTRIBUTING.md +2 -0
  9. data/bin/recog_verify +42 -7
  10. data/cpe-remap.yaml +20 -2
  11. data/features/data/schema_failure.xml +4 -0
  12. data/features/data/tests_with_failures.xml +6 -0
  13. data/features/support/hooks.rb +9 -0
  14. data/features/verify.feature +81 -17
  15. data/identifiers/hw_device.txt +2 -0
  16. data/identifiers/hw_product.txt +2 -0
  17. data/identifiers/os_device.txt +2 -0
  18. data/identifiers/os_family.txt +1 -0
  19. data/identifiers/os_product.txt +8 -1
  20. data/identifiers/service_product.txt +14 -0
  21. data/identifiers/vendor.txt +13 -1
  22. data/lib/recog/fingerprint.rb +21 -7
  23. data/lib/recog/fingerprint_parse_error.rb +10 -0
  24. data/lib/recog/verifier.rb +4 -4
  25. data/lib/recog/verify_reporter.rb +7 -6
  26. data/lib/recog/version.rb +1 -1
  27. data/requirements.txt +1 -1
  28. data/spec/data/external_example_fingerprint/hp_printer_ex_01.txt +1 -0
  29. data/spec/data/external_example_fingerprint/hp_printer_ex_02.txt +1 -0
  30. data/spec/data/external_example_fingerprint.xml +8 -0
  31. data/spec/data/external_example_illegal_path_fingerprint.xml +7 -0
  32. data/spec/lib/recog/db_spec.rb +84 -61
  33. data/spec/lib/recog/fingerprint_spec.rb +4 -4
  34. data/spec/lib/recog/verify_reporter_spec.rb +8 -8
  35. data/update_cpes.py +129 -36
  36. data/xml/apache_os.xml +61 -19
  37. data/xml/architecture.xml +15 -1
  38. data/xml/dhcp_vendor_class.xml +1 -1
  39. data/xml/dns_versionbind.xml +16 -13
  40. data/xml/favicons.xml +87 -5
  41. data/xml/fingerprints.xsd +9 -1
  42. data/xml/ftp_banners.xml +131 -141
  43. data/xml/h323_callresp.xml +2 -2
  44. data/xml/hp_pjl_id.xml +81 -81
  45. data/xml/html_title.xml +178 -9
  46. data/xml/http_cookies.xml +83 -27
  47. data/xml/http_servers.xml +409 -269
  48. data/xml/http_wwwauth.xml +70 -37
  49. data/xml/imap_banners.xml +2 -2
  50. data/xml/nntp_banners.xml +8 -5
  51. data/xml/ntp_banners.xml +33 -33
  52. data/xml/operating_system.xml +92 -77
  53. data/xml/pop_banners.xml +17 -17
  54. data/xml/sip_banners.xml +16 -5
  55. data/xml/sip_user_agents.xml +122 -27
  56. data/xml/smb_native_lm.xml +5 -5
  57. data/xml/smb_native_os.xml +25 -25
  58. data/xml/smtp_banners.xml +132 -131
  59. data/xml/smtp_help.xml +1 -1
  60. data/xml/snmp_sysdescr.xml +1227 -1227
  61. data/xml/snmp_sysobjid.xml +2 -2
  62. data/xml/ssh_banners.xml +9 -5
  63. data/xml/telnet_banners.xml +49 -0
  64. data/xml/tls_jarm.xml +22 -2
  65. data/xml/x11_banners.xml +3 -3
  66. data/xml/x509_issuers.xml +3 -2
  67. data/xml/x509_subjects.xml +3 -3
  68. metadata +19 -3
  69. data/lib/recog/verifier_factory.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e33013be558344280c798bb77321b809289a604f55a9f8447bba1cdd2b93151
4
- data.tar.gz: 4088c7af5a4dc2250562a610f2bbc6307436fefabe1203f1bd00fd2a9f9c0e3d
3
+ metadata.gz: a185ae988081b761341e8b8799c23feb5eb2ab85c2da2ce63fffe4f2d7ddcac3
4
+ data.tar.gz: 89e4ab65e87d190c3ea276d18771edd9c6fc75cb5a0863440be61d165ae5b80c
5
5
  SHA512:
6
- metadata.gz: abca30fbb5b218e69a2178c0b9b7337af15f1611d67076031ee5d489140505c558fe8981513d8d446bddc91b4166f304b88fed9eb23e22de0d4a5e10f2bfb668
7
- data.tar.gz: 57c7e248435b5d52860cd2117a814176673c0e8cb193f854880b3244c91d9b745ee67ca1bc8f2f67f1f3046d26857ca198c81a0e129f9d50b8cc28349070d250
6
+ metadata.gz: ff83575470bf78d4e5a5c464e0dfeb12ac310ecc856fde6919bf3f7a5e3ba9b69d2be479f9a0cab4cc2c03f7babb6f21673d7015d5cf3182587f86ab3f45f0cf
7
+ data.tar.gz: 68a7dad6b6cbafc8dac0ac46a0ae7aab6f64c0095c314fa126da107f05b3befff3e4f9f2af41836aa96437746dceeb17718927acc824d842cb9f4a56b234da34
@@ -9,7 +9,7 @@ jobs:
9
9
  strategy:
10
10
  fail-fast: false
11
11
  matrix:
12
- ruby-version: ['2.5', '2.6', '2.7', '3.0', 'jruby-9.1.17.0', 'jruby']
12
+ ruby-version: ['2.5', '2.6', '2.7', '3.0', 'jruby-9.2.20.1', 'jruby']
13
13
 
14
14
  steps:
15
15
  - uses: actions/checkout@v2
@@ -37,7 +37,7 @@ jobs:
37
37
  with:
38
38
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
39
39
  - name: Run recog verify
40
- run: bundle exec recog_verify --no-warnings xml/*.xml
40
+ run: bundle exec recog_verify --schema-location xml/fingerprints.xsd --no-warnings xml/*.xml
41
41
  java-verify:
42
42
  name: 'Java Verify'
43
43
  runs-on: ubuntu-latest
@@ -0,0 +1,54 @@
1
+ #!/bin/bash
2
+
3
+ ARGS=()
4
+ while [[ $# -gt 0 ]]; do
5
+ case $1 in
6
+ -s|--schema-location)
7
+ VALIDATE_SCHEMA="--schema-location $2"
8
+ shift
9
+ shift
10
+ ;;
11
+ -*|--*)
12
+ echo "Unknown option $1"
13
+ exit 1
14
+ ;;
15
+ *)
16
+ ARGS+=("$1")
17
+ shift
18
+ ;;
19
+ esac
20
+ done
21
+ set -- "${ARGS[@]}"
22
+
23
+ if [ $# -eq 0 ]
24
+ then
25
+ echo "Usage: $(basename $0) [--schema-location SCHEMA_LOCATION] <xml fingerprint directory>"
26
+ exit 1
27
+ fi
28
+
29
+ if [ ! -d "$1" ]
30
+ then
31
+ echo "The XML fingerprint file directory must be supplied."
32
+ exit 1
33
+ fi
34
+
35
+ bin/recog_verify $VALIDATE_SCHEMA "$1/*.xml"
36
+
37
+ if ! type fswatch &>/dev/null;
38
+ then
39
+ echo "'fswatch' is required to monitor fingerprint files for changes and update the editor."
40
+ echo "See: https://emcrisostomo.github.io/fswatch/ or install with:"
41
+ echo " MacOS Homebrew: brew install fswatch"
42
+ echo " Ubuntu/Debian: apt install fswatch"
43
+ echo
44
+ echo "Otherwise, you can re-run this task using the Visual Studio Code command palette"
45
+ exit 1
46
+ fi
47
+
48
+ echo "Waiting for changes..."
49
+ fswatch -0 $1 | while read -d "" event; do {
50
+ echo "Changes detected, validating: ${event}"
51
+ # TODO: VSCode doesn't support individual/incremental updates to files yet.
52
+ bin/recog_verify $VALIDATE_SCHEMA "$1/*.xml"
53
+ echo "Waiting for changes..."
54
+ }; done
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "redhat.vscode-xml"
4
+ ]
5
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "xml.fileAssociations": [
3
+ {
4
+ "pattern": "xml/*.xml",
5
+ "systemId": "xml/fingerprints.xsd"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "Recog Verify - Background Monitor",
6
+ "command": ".vscode/bin/monitor-recog-fingerprints.sh",
7
+ "args": [
8
+ "--schema-location",
9
+ "xml/fingerprints.xsd",
10
+ "${workspaceFolder}/xml"
11
+ ],
12
+ "windows": {
13
+ "command": ""
14
+ },
15
+ "type": "process",
16
+ "isBackground": true,
17
+ "problemMatcher": {
18
+ "owner": "recog",
19
+ "fileLocation": [
20
+ "absolute"
21
+ ],
22
+ "pattern": {
23
+ "regexp": "^(.*):(\\d+):\\s+(WARN|FAIL):\\s+(.*)$",
24
+ "file": 1,
25
+ "severity": 3,
26
+ "message": 4,
27
+ "location": 2
28
+ },
29
+ "background": {
30
+ "activeOnStart": true,
31
+ "beginsPattern": "^Changes detected",
32
+ "endsPattern": "^Waiting for changes"
33
+ },
34
+ },
35
+ "presentation": {
36
+ "reveal": "always",
37
+ "revealProblems": "onProblem"
38
+ },
39
+ "runOptions": {
40
+ "runOn": "folderOpen"
41
+ }
42
+ },
43
+ {
44
+ "label": "Recog Verify",
45
+ "command": "bin/recog_verify",
46
+ "args": [
47
+ "--schema-location",
48
+ "xml/fingerprints.xsd",
49
+ "${workspaceFolder}/xml/*.xml"
50
+ ],
51
+ "windows": {
52
+ "command": ""
53
+ },
54
+ "type": "process",
55
+ "problemMatcher": {
56
+ "owner": "recog",
57
+ "fileLocation": [
58
+ "absolute"
59
+ ],
60
+ "pattern": {
61
+ "regexp": "^(.*):(\\d+):\\s+(WARN|FAIL):\\s+(.*)$",
62
+ "file": 1,
63
+ "severity": 3,
64
+ "message": 4,
65
+ "location": 2
66
+ }
67
+ },
68
+ "presentation": {
69
+ "reveal": "always",
70
+ "revealProblems": "onProblem"
71
+ },
72
+ "runOptions": {
73
+ "runOn": "folderOpen"
74
+ }
75
+ }
76
+ ]
77
+ }
data/CONTRIBUTING.md CHANGED
@@ -141,6 +141,8 @@ $ echo 'OpenSSH_6.6p1 Ubuntu-2ubuntu1' | bin/recog_match xml/ssh_banners.xml -
141
141
  MATCH: {"matched"=>"OpenSSH running on Ubuntu 14.04", "service.version"=>"6.6p1", "openssh.comment"=>"Ubuntu-2ubuntu1", "service.vendor"=>"OpenBSD", "service.family"=>"OpenSSH", "service.product"=>"OpenSSH", "os.vendor"=>"Ubuntu", "os.device"=>"General", "os.family"=>"Linux", "os.product"=>"Linux", "os.version"=>"14.04", "service.protocol"=>"ssh", "fingerprint_db"=>"ssh.banner", "data"=>"OpenSSH_6.6p1 Ubuntu-2ubuntu1"}
142
142
  ```
143
143
 
144
+ Additionally, in Visual Studio Code, there is a task (.vscode/tasks.json) which will automatically run recog_verify in the background to watch all the XML fingerprint files (under the xml/ subdirectory of this repository). Additionally, if [fswatch](https://github.com/emcrisostomo/fswatch) is installed, whenever XML fingerprint files are added or modified this task will automatically update the Visual Studio Code user interface and highlight any errors or warnings discovered through recog_verify on the correct file/line. You can also manually run the task by bringing up the Visual Studio Code command menu (cmd + shift + P on mac, or ctrl + shift + P for linux/windows) -> Tasks: Run Task -> Recog Verify). Note that in order for the task to run successfully, you must have a valid ruby installed on your PATH with the gems from `bundle install` installed using bundler for that ruby engine. JRuby is not supported as it has issues related to line numbering due to a bug in Nokogiri.
145
+
144
146
  [^back to top](#contributing-to-recog)
145
147
 
146
148
 
data/bin/recog_verify CHANGED
@@ -1,12 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
4
+ require 'nokogiri'
4
5
  require 'optparse'
5
6
  require 'ostruct'
6
7
  require 'recog'
7
- require 'recog/verifier_factory'
8
+ require 'recog/formatter'
9
+ require 'recog/verifier'
10
+ require 'recog/verify_reporter'
8
11
 
9
- options = OpenStruct.new(color: false, detail: false, quiet: false, warnings: true)
12
+ options = OpenStruct.new(color: false, detail: false, quiet: false, warnings: true, schema: nil)
10
13
 
11
14
  option_parser = OptionParser.new do |opts|
12
15
  opts.banner = "Usage: #{$0} [options] XML_FINGERPRINT_FILE1 ..."
@@ -35,6 +38,10 @@ option_parser = OptionParser.new do |opts|
35
38
  options.warnings = o
36
39
  end
37
40
 
41
+ opts.on("--schema-location SCHEMA_FILE", "Location of the Recog XSD file. If not specified, validation will not be run.") do |schema_file|
42
+ options.schema = Nokogiri::XML::Schema(File.read(schema_file))
43
+ end
44
+
38
45
  opts.on("-h", "--help", "Show this message.") do
39
46
  puts opts
40
47
  exit
@@ -50,13 +57,41 @@ end
50
57
 
51
58
  warnings = 0
52
59
  failures = 0
60
+ formatter = Recog::Formatter.new(options, $stdout)
53
61
  ARGV.each do |arg|
54
62
  Dir.glob(arg).each do |file|
55
- ndb = Recog::DB.new(file)
56
- verifier = Recog::VerifierFactory.build(options, ndb)
57
- verified = verifier.verify
58
- failures += verifier.reporter.failure_count
59
- warnings += verifier.reporter.warning_count
63
+ # Create a new reporter per XML file to hold context on success/warn/fails
64
+ reporter = Recog::VerifyReporter.new(options, formatter, file)
65
+
66
+ begin
67
+ # Validate the XML database against the recog schema first, if requested
68
+ if options.schema
69
+ errors = options.schema.validate(Nokogiri::XML(File.read(file)))
70
+ if errors.size > 0
71
+ reporter.report(0) do
72
+ errors.each do |error|
73
+ reporter.failure(error.message, error.line)
74
+ end
75
+ end
76
+ # Skip validation of individual fingerprints since the XML itself
77
+ # is likely malformed.
78
+ next
79
+ end
80
+ end
81
+
82
+ # Now read the XML file directly and validate the fingerprints
83
+ # themselves
84
+ db = Recog::DB.new(file)
85
+ verifier = Recog::Verifier.new(db, reporter)
86
+ verifier.verify
87
+ rescue Recog::FingerprintParseError => e
88
+ reporter.failure(e.message, e.line_number)
89
+ rescue => e
90
+ reporter.failure(e.message)
91
+ ensure
92
+ failures += reporter.failure_count
93
+ warnings += reporter.warning_count
94
+ end
60
95
  end
61
96
  end
62
97
 
data/cpe-remap.yaml CHANGED
@@ -18,6 +18,9 @@ mappings:
18
18
  vendor: altn
19
19
  aruba_networks:
20
20
  vendor: arubanetworks
21
+ atlassian:
22
+ products:
23
+ confluence: confluence_server
21
24
  bea:
22
25
  products:
23
26
  weblogic: weblogic_server
@@ -127,6 +130,8 @@ mappings:
127
130
  vendor: mortbay
128
131
  munin:
129
132
  vendor: munin-monitoring
133
+ nginx:
134
+ vendor: f5
130
135
  nlnet_labs:
131
136
  vendor: nlnetlabs
132
137
  products:
@@ -201,6 +206,12 @@ mappings:
201
206
  x.org:
202
207
  products:
203
208
  x.org_x11: x11
209
+ xiongmai_technology:
210
+ vendor: xiongmaitech
211
+ zaphoyd_studios:
212
+ vendor: zaphoyd
213
+ products:
214
+ websocket++: websocketpp
204
215
 
205
216
  # The following section contains CPE operating system or 'o' remappings. These will
206
217
  # ONLY be used for mapping Recog 'os' attributes.
@@ -225,6 +236,7 @@ mappings:
225
236
  cisco:
226
237
  products:
227
238
  adaptive_security_appliance: adaptive_security_appliance_software
239
+ mds_9000: mds_9000_san-os
228
240
  nam: network_analysis_module_software
229
241
  pix: pix_firewall_software
230
242
  telepresence: telepresence_video_communication_server_software
@@ -243,6 +255,10 @@ mappings:
243
255
  debian:
244
256
  products:
245
257
  linux: debian_linux
258
+ eltex:
259
+ vendor: eltex-co
260
+ fedora_project:
261
+ vendor: fedoraproject
246
262
  hp:
247
263
  products:
248
264
  ilo: integrated_lights-out_firmware
@@ -286,8 +302,6 @@ mappings:
286
302
  vendor: phoenixcontact
287
303
  red_hat:
288
304
  vendor: redhat
289
- products:
290
- fedora_core_linux: fedora_core
291
305
  software_house:
292
306
  vendor: swhouse
293
307
  sun:
@@ -306,6 +320,8 @@ mappings:
306
320
  vmware_esxi_server: esxi
307
321
  wind_river:
308
322
  vendor: windriver
323
+ xiongmai_technology:
324
+ vendor: xiongmaitech
309
325
 
310
326
  # The following section contains CPE hardware or 'h' remappings. These will
311
327
  # ONLY be used for mapping Recog 'hw' attributes.
@@ -336,6 +352,8 @@ mappings:
336
352
  citrix:
337
353
  products:
338
354
  netscaler_sdx_gateway: netscaler_sdx
355
+ eltex:
356
+ vendor: eltex-co
339
357
  emc:
340
358
  products:
341
359
  celerra: celerra_network_attached_storage
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0"?>
2
+ <fingerprints>
3
+ <fingerprint name="foo"/>
4
+ </fingerprints>
@@ -17,4 +17,10 @@
17
17
  <param pos="2" name="os.version" />
18
18
  <param pos="1" name="os.name" value="Bar" />
19
19
  </fingerprint>
20
+ <fingerprint pattern="^(\S+) ([\d.]+)$">
21
+ <description>example with untested parameter</description>
22
+ <!-- Fail: missing example test os.version parameter -->
23
+ <example>bar 1.0</example>
24
+ <param pos="1" name="os.version" />
25
+ </fingerprint>
20
26
  </fingerprints>
@@ -0,0 +1,9 @@
1
+ require "cucumber/platform"
2
+
3
+ Before "@requires-ruby-platform-java" do
4
+ skip_this_scenario unless Cucumber::JRUBY
5
+ end
6
+
7
+ Before "@unsupported-on-platform-java" do
8
+ skip_this_scenario if Cucumber::JRUBY
9
+ end
@@ -16,33 +16,97 @@ Feature: Verify
16
16
  """
17
17
 
18
18
  @no-clobber
19
- Scenario: Tests with warnings, warnings enabled
19
+ Scenario: Tests with warnings, warnings disabled
20
+ When I run `recog_verify --no-warnings tests_with_warnings.xml`
21
+ Then it should pass with exactly:
22
+ """
23
+ tests_with_warnings.xml: SUMMARY: Test completed with 1 successful, 0 warnings, and 0 failures
24
+ """
25
+
26
+ # These tests vary due to line numbering issues in Nokogiri, so there are different versions
27
+ # of the same test depending on the ruby runtime. Nokogiri uses libxml under CRuby, and a custom
28
+ # java-based parser under JRuby. The Java-based parser only approximates line numbers, which are
29
+ # typically off if XML prolog or comments are present.
30
+ #
31
+ # See https://github.com/sparklemotion/nokogiri/issues/2380
32
+ @no-clobber
33
+ @unsupported-on-platform-java
34
+ Scenario: Tests with warnings, warnings enabled (CRuby)
20
35
  When I run `recog_verify tests_with_warnings.xml`
21
36
  Then it should fail with:
22
37
  """
23
- tests_with_warnings.xml: WARN: 'Pure-FTPd' has no test cases
24
- tests_with_warnings.xml: WARN: 'Pure-FTPd' is missing an example that checks for parameter 'pureftpd.config' which is derived from a capture group
25
- tests_with_warnings.xml: SUMMARY: Test completed with 1 successful, 2 warnings, and 0 failures
38
+ tests_with_warnings.xml:10: WARN: 'Pure-FTPd' has no test cases
39
+ tests_with_warnings.xml: SUMMARY: Test completed with 1 successful, 1 warnings, and 0 failures
26
40
  """
27
- And the exit status should be 2
28
-
41
+ And the exit status should be 1
42
+
43
+ # JRuby 9.2.20.1 and 9.3.3.0 differ in how they parse XML, where the latter is more close to libxml
44
+ # and Nokogiri. We use a regex test to match results from both versions.
29
45
  @no-clobber
30
- Scenario: Tests with warnings, warnings disabled
31
- When I run `recog_verify --no-warnings tests_with_warnings.xml`
32
- Then it should pass with exactly:
46
+ @requires-ruby-platform-java
47
+ Scenario: Tests with warnings, warnings enabled (JRuby)
48
+ When I run `recog_verify tests_with_warnings.xml`
49
+ Then it should fail with regex:
33
50
  """
34
- tests_with_warnings.xml: SUMMARY: Test completed with 1 successful, 0 warnings, and 0 failures
51
+ tests_with_warnings.xml:\d+: WARN: 'Pure-FTPd' has no test cases
52
+ tests_with_warnings.xml: SUMMARY: Test completed with 1 successful, 1 warnings, and 0 failures
35
53
  """
54
+ And the exit status should be 1
36
55
 
37
56
  @no-clobber
38
- Scenario: Tests with failures
57
+ @unsupported-on-platform-java
58
+ Scenario: Tests with failures (CRuby)
39
59
  When I run `recog_verify tests_with_failures.xml`
40
60
  Then it should fail with:
41
61
  """
42
- tests_with_failures.xml: FAIL: 'foo test' failed to match "bar" with (?-mix:^foo$)'
43
- tests_with_failures.xml: FAIL: '' failed to match "This almost matches" with (?-mix:^This matches$)'
44
- tests_with_failures.xml: FAIL: 'bar test's os.name is a non-zero pos but specifies a value of 'Bar'
45
- tests_with_failures.xml: FAIL: 'bar test' failed to find expected capture group os.version '5.0'. Result was 1.0
46
- tests_with_failures.xml: SUMMARY: Test completed with 0 successful, 0 warnings, and 4 failures
62
+ tests_with_failures.xml:3: FAIL: 'foo test' failed to match "bar" with (?-mix:^foo$)'
63
+ tests_with_failures.xml:8: FAIL: '' failed to match "This almost matches" with (?-mix:^This matches$)'
64
+ tests_with_failures.xml:13: FAIL: 'bar test's os.name is a non-zero pos but specifies a value of 'Bar'
65
+ tests_with_failures.xml:13: FAIL: 'bar test' failed to find expected capture group os.version '5.0'. Result was 1.0
66
+ tests_with_failures.xml:20: FAIL: 'example with untested parameter' is missing an example that checks for parameter 'os.version' which is derived from a capture group
67
+ tests_with_failures.xml: SUMMARY: Test completed with 1 successful, 0 warnings, and 5 failures
68
+ """
69
+ And the exit status should be 5
70
+
71
+ # JRuby 9.2.20.1 and 9.3.3.0 differ in how they parse XML, where the latter is more close to libxml
72
+ # and Nokogiri. We use a regex test to match results from both versions.
73
+ @no-clobber
74
+ @requires-ruby-platform-java
75
+ Scenario: Tests with failures (JRuby)
76
+ When I run `recog_verify tests_with_failures.xml`
77
+ Then it should fail with regex:
78
+ """
79
+ tests_with_failures.xml:\d+: FAIL: 'foo test' failed to match "bar" with \(\?-mix:\^foo\$\)'
80
+ tests_with_failures.xml:\d+: FAIL: '' failed to match "This almost matches" with \(\?-mix:\^This matches\$\)'
81
+ tests_with_failures.xml:\d+: FAIL: 'bar test's os\.name is a non-zero pos but specifies a value of 'Bar'
82
+ tests_with_failures.xml:\d+: FAIL: 'bar test' failed to find expected capture group os\.version '5\.0'. Result was 1\.0
83
+ tests_with_failures.xml:\d+: FAIL: 'example with untested parameter' is missing an example that checks for parameter 'os\.version' which is derived from a capture group
84
+ tests_with_failures.xml: SUMMARY: Test completed with 1 successful, 0 warnings, and 5 failures
85
+ """
86
+ And the exit status should be 5
87
+
88
+ @no-clobber
89
+ @unsupported-on-platform-java
90
+ Scenario: recog_verify produces XML errors from the XSD with a malformed XML document (CRuby)
91
+ When I run `recog_verify --schema-location ../../xml/fingerprints.xsd schema_failure.xml`
92
+ Then it should fail with:
93
+ """
94
+ schema_failure.xml:3: FAIL: 3:0: ERROR: Element 'fingerprint', attribute 'name': The attribute 'name' is not allowed.
95
+ schema_failure.xml:3: FAIL: 3:0: ERROR: Element 'fingerprint': The attribute 'pattern' is required but missing.
96
+ schema_failure.xml:3: FAIL: 3:0: ERROR: Element 'fingerprint': Missing child element(s). Expected is ( description ).
97
+ schema_failure.xml: SUMMARY: Test completed with 0 successful, 0 warnings, and 3 failures
98
+ """
99
+ And the exit status should be 3
100
+
101
+ @no-clobber
102
+ @requires-ruby-platform-java
103
+ Scenario: recog_verify produces XML errors from the XSD with a malformed XML document (JRuby)
104
+ When I run `recog_verify --schema_location ../../xml/fingerprints.xsd schema_failure.xml`
105
+ Then it should fail with:
106
+ """
107
+ schema_failure.xml:-1: FAIL: -1:-1: ERROR: cvc-complex-type.3.2.2: Attribute 'name' is not allowed to appear in element 'fingerprint'.
108
+ schema_failure.xml:-1: FAIL: -1:-1: ERROR: cvc-complex-type.4: Attribute 'pattern' must appear on element 'fingerprint'.
109
+ schema_failure.xml:-1: FAIL: -1:-1: ERROR: cvc-complex-type.2.4.b: The content of element 'fingerprint' is not complete. One of '{description}' is expected.
110
+ schema_failure.xml: SUMMARY: Test completed with 0 successful, 0 warnings, and 3 failures
47
111
  """
48
- And the exit status should be 4
112
+ And the exit status should be 3
@@ -25,6 +25,7 @@ Handheld Scanner
25
25
  Hypervisor
26
26
  IP Camera
27
27
  IPS
28
+ IPTV
28
29
  Industrial Control
29
30
  JTAG Adapter
30
31
  KVM
@@ -73,6 +74,7 @@ Video Conferencing
73
74
  Video Decoder
74
75
  Video Encoder
75
76
  VoIP
77
+ VoIP Gateway
76
78
  VoIP Server
77
79
  VoIP Switch
78
80
  Voice Appliance
@@ -227,6 +227,8 @@ NAS4Free
227
227
  NFVIS
228
228
  NPort
229
229
  NR900
230
+ NTP-2
231
+ NTP-RG-1402G
230
232
  NetScaler Gateway
231
233
  NetScaler SDX Gateway
232
234
  NetScreen
@@ -23,6 +23,7 @@ Hypervisor
23
23
  IDS
24
24
  IP Camera
25
25
  IPS
26
+ IPTV
26
27
  KVM
27
28
  Lights Out Management
28
29
  Linux
@@ -67,6 +68,7 @@ VPN
67
68
  Video Conferencing
68
69
  ViewStation
69
70
  VoIP
71
+ VoIP Gateway
70
72
  VoIP Switch
71
73
  WAN Accelerator
72
74
  WAP
@@ -207,6 +207,7 @@ VRP
207
207
  Vantage
208
208
  VarioLink
209
209
  VarioPrint
210
+ Vigor
210
211
  VoIP
211
212
  VxWorks
212
213
  WAP
@@ -81,7 +81,7 @@ Fabric OS
81
81
  Fastmark M5
82
82
  FaxPress
83
83
  Fedora
84
- Fedora Core Linux
84
+ Fedora Core
85
85
  Fermentrack
86
86
  Fiery Print Server
87
87
  Firepower
@@ -91,6 +91,7 @@ FortiOS
91
91
  FreeBSD
92
92
  FreeNAS Firmware
93
93
  Freebox OS
94
+ FreshTomato
94
95
  G2 Console Switch
95
96
  GAiA OS
96
97
  GXP1610 Firmware
@@ -152,6 +153,8 @@ NET+OS
152
153
  NFVIS
153
154
  NRG Printer
154
155
  NT
156
+ NTP-2 Firmware
157
+ NTP-RG-1402G Firmware
155
158
  NX-OS
156
159
  NetBSD
157
160
  NetCache
@@ -222,6 +225,7 @@ SCO UNIX
222
225
  SEHI
223
226
  SINIX
224
227
  SL2100 Firmware
228
+ SMG Firmware
225
229
  SPA112 Firmware
226
230
  SPA122 Firmware
227
231
  SV8100 Firmware
@@ -231,6 +235,7 @@ ScanFront
231
235
  ScreenOS
232
236
  Secure Linux
233
237
  SecureOS
238
+ Serenity
234
239
  SmartEdge OS
235
240
  SmartServer
236
241
  SmoothWall
@@ -258,6 +263,8 @@ Tenable Core
258
263
  TetrationOS
259
264
  TimOS
260
265
  Time Capsule Firmware
266
+ Tomato
267
+ TomatoUSB
261
268
  Traverse
262
269
  Tru64 Unix
263
270
  UCM6202 Firmware