mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-25 20:30:47 +00:00
fix(test): correct parent dir creation for strict tests
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
This commit is contained in:
@@ -224,13 +224,14 @@ class FalcoTest(Test):
|
|||||||
output['actual'] = key
|
output['actual'] = key
|
||||||
output['expected'] = value
|
output['expected'] = value
|
||||||
output_strictly_contains.append(output)
|
output_strictly_contains.append(output)
|
||||||
# Clean up file from previous tests, if any
|
if not output['actual'] == 'stdout':
|
||||||
if not output['actual'] == 'stdout' and os.path.exists(output['actual']):
|
# Clean up file from previous tests, if any
|
||||||
os.remove(output['actual'])
|
if os.path.exists(output['actual']):
|
||||||
filedir = os.path.dirname(output['expected'])
|
os.remove(output['actual'])
|
||||||
# Create the parent directory for the file if it doesn't exist.
|
# Create the parent directory for the file if it doesn't exist.
|
||||||
if not os.path.isdir(filedir):
|
filedir = os.path.dirname(output['actual'])
|
||||||
os.makedirs(filedir)
|
if not os.path.isdir(filedir):
|
||||||
|
os.makedirs(filedir)
|
||||||
self.output_strictly_contains = output_strictly_contains
|
self.output_strictly_contains = output_strictly_contains
|
||||||
|
|
||||||
self.grpcurl_res = None
|
self.grpcurl_res = None
|
||||||
|
Reference in New Issue
Block a user