rapid7/recog — pull request #7 by jhart-r7 (2014-10-10 16:31:51+00:00)
Title: More updates to specs, sanity checks, fingerprints and recog_verify (CONTENT-6127, again)

As of the last commit, all of this content will pass complete ```rspec``` and ```recog_verify``` along with ```DTest_Fingerprints``` from Nexpose, but the later only if you remove ```smb_native_os.xml``` (temporarily), as this file is unused by Nexpose but ```DTest_Fingerprints``` fails on it because it extracts fields Nexpose doesn't know about.

The changes were, roughly:

* Update ```recog_verify``` to support validating multiple files. This makes one off-changes easier to test rather than waiting the ~minute for ```rspec```
* Prevent over grouping (a regex grouping more times than it extracts) and under grouping (a regex that grouping less than it extracts)
* Properly handle non-asserting fingerprint matches
* Updating all fingerprints to pass all tests in recog and Nexpose

Design-wise, I am debating the following and would like feedback on:

* When raising parse/test related exceptions, right now they are just vanilla RTEs. I am debating using/creating something else to make some future error handling (see next point) easier
* Right now, sanity checking is split between spec, and fingerprint.rb. IOW, there are some things currently only caught with rspec and some only caught when running ```recog_verify``` or similar. I am debating moving all validation of ```xml/*.xml``` into fingerprint.rb or somewhere else (the key part being out of ```rspec```), so there is a central location where sanity checking happens, and then updating spec to simply call recog_verify or similar on all XML files
* In 15a874d, I removed three example extraction tests that are testing values that are hard-coded (read: they are not extracted from the regex). Recog handles this just fine, but ```DTest_Fingerprints``` complains. On one hand, it is a little weird to be "testing" a value that is set by hand a few lines below, but on the other, why not?