Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Commit 3e722b2

Browse files
author
Rony Xavier
committed
Update test setup to test file based attestation feature
Signed-off-by: Rony Xavier <rxavier@mitre.org>
1 parent aee577a commit 3e722b2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/generate_attestation_file.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require 'json'
22
require 'date'
3+
require 'csv'
34

45

56
DATE_FORMAT = '%Y-%m-%d'.freeze
@@ -144,10 +145,21 @@
144145
config_json = {
145146
'plugins' => {
146147
'inspec-reporter-json-hdf' => {
147-
'attestations' => attestations
148+
'include-attestations-file' => {
149+
'type' => 'csv',
150+
'path' => './attestations.csv'
151+
},
152+
'attestations' => attestations[0..6]
148153
}
149154
},
150155
'version' => '1.2'
151156
}
152157

153158
File.write('attestations.json', config_json.to_json)
159+
160+
CSV.open("attestations.csv", "wb") do |csv|
161+
csv << ["Control_ID","Explanation","Frequency","Status","Updated","Updated_By"]
162+
attestations[7..15].each do |hash|
163+
csv << hash.values
164+
end
165+
end

0 commit comments

Comments
 (0)