Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore and enhance fingerprint self test spec #444

Merged

Conversation

mkienow-r7
Copy link
Contributor

@mkienow-r7 mkienow-r7 commented Apr 14, 2022

Description

Restores spec/lib/fingerprint_self_test_spec.rb that was previously removed during the repo split. The fingerprint self tests are more detailed than the checks performed by recog_verify, and should always be run to test fingerprint updates. The test file and spec/spec_helper.rb were modified so that the test could also run from within the recog-ruby repo.

Diff against last version before the repo split

--- a/spec/lib/fingerprint_self_test_spec.rb.fac7d6d6688330b155fd35f80eacc920ec9db75e
+++ b/spec/lib/fingerprint_self_test_spec.rb
@@ -3,8 +3,8 @@ require 'regexp_parser'
 require 'nokogiri'

 describe Recog::DB do
-  let(:schema) { Nokogiri::XML::Schema(open(File.expand_path(File.join(%w(xml fingerprints.xsd))))) }
-  Dir[File.expand_path File.join('xml', '*.xml')].each do |xml_file_name|
+  let(:schema) { Nokogiri::XML::Schema(open(File.join(FINGERPRINT_DIR, 'fingerprints.xsd'))) }
+  Dir[File.join(FINGERPRINT_DIR, '*.xml')].each do |xml_file_name|

     describe "##{File.basename(xml_file_name)}" do

@@ -172,4 +172,4 @@ describe Recog::DB do

     end
   end
-end
\ No newline at end of file
+end

Motivation and Context

To ensure that fingerprint quality is maintained.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have updated the documentation accordingly (or changes are not required).
  • I have added tests to cover my changes (or new tests are not required).
  • All new and existing tests passed.

The test will now run from the recog or recog-ruby rspec using the
correct fingerprint dir.
@mkienow-r7 mkienow-r7 merged commit c348962 into rapid7:main Apr 15, 2022
@mkienow-r7 mkienow-r7 deleted the feature/move-fingerprint-self-test-spec branch April 15, 2022 17:31
mkienow-r7 added a commit to mkienow-r7/recog-ruby that referenced this pull request Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants