-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
--with-raw
flag to DBProtect converter (#1499)
* Updated DBProtect to include withraw Signed-off-by: Charles Hu <[email protected]> * Removed object literals --------- Signed-off-by: Charles Hu <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ce68ce3
commit 8f61110
Showing
9 changed files
with
131,007 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {expect, test} from '@oclif/test' | ||
import tmp from 'tmp' | ||
import path from 'path' | ||
import fs from 'fs' | ||
import {omitHDFChangingFields} from '../utils' | ||
|
||
describe('Test dbprotect', () => { | ||
const tmpobj = tmp.dirSync({unsafeCleanup: true}) | ||
|
||
test | ||
.stdout() | ||
.command(['convert dbprotect2hdf', '-i', path.resolve('./test/sample_data/dbprotect/sample_input_report/DbProtect-Check-Results-Details-XML-Sample.xml'), '-o', `${tmpobj.name}/dbprotecttest.json`]) | ||
.it('hdf-converter output test - check results', () => { | ||
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/dbprotecttest.json`, 'utf8')) | ||
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_data/dbprotect/dbprotect-check-hdf.json'), 'utf8')) | ||
expect(omitHDFChangingFields(test)).to.eql(omitHDFChangingFields(sample)) | ||
}) | ||
|
||
test | ||
.stdout() | ||
.command(['convert dbprotect2hdf', '-i', path.resolve('./test/sample_data/dbprotect/sample_input_report/DbProtect-Findings-Detail-XML-Sample.xml'), '-o', `${tmpobj.name}/dbprotecttest.json`]) | ||
.it('hdf-converter output test - findings results', () => { | ||
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/dbprotecttest.json`, 'utf8')) | ||
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_data/dbprotect/dbprotect-findings-hdf.json'), 'utf8')) | ||
expect(omitHDFChangingFields(test)).to.eql(omitHDFChangingFields(sample)) | ||
}) | ||
}) | ||
|
||
describe('Test dbprotect using withraw flag', () => { | ||
const tmpobj = tmp.dirSync({unsafeCleanup: true}) | ||
|
||
test | ||
.stdout() | ||
.command(['convert dbprotect2hdf', '-i', path.resolve('./test/sample_data/dbprotect/sample_input_report/DbProtect-Check-Results-Details-XML-Sample.xml'), '-o', `${tmpobj.name}/dbprotecttest.json`, '-w']) | ||
.it('hdf-converter withraw output test - check results', () => { | ||
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/dbprotecttest.json`, 'utf8')) | ||
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_data/dbprotect/dbprotect-check-hdf-withraw.json'), 'utf8')) | ||
expect(omitHDFChangingFields(test)).to.eql(omitHDFChangingFields(sample)) | ||
}) | ||
|
||
test | ||
.stdout() | ||
.command(['convert dbprotect2hdf', '-i', path.resolve('./test/sample_data/dbprotect/sample_input_report/DbProtect-Findings-Detail-XML-Sample.xml'), '-o', `${tmpobj.name}/dbprotecttest.json`, '-w']) | ||
.it('hdf-converter withraw output test - findings results', () => { | ||
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/dbprotecttest.json`, 'utf8')) | ||
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_data/dbprotect/dbprotect-findings-hdf-withraw.json'), 'utf8')) | ||
expect(omitHDFChangingFields(test)).to.eql(omitHDFChangingFields(sample)) | ||
}) | ||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.