Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Nov 4, 2024
1 parent 37e7159 commit 60efa89
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/maltest/maltest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def shutdown_handler(signum, frame):
###################################################################################################
# main
def main():
global ShuttingDown

parser = argparse.ArgumentParser(
description='\n'.join(
[
Expand Down Expand Up @@ -330,20 +332,22 @@ def main():
# TODO: Assuming the Malcolm directory like this might not be very robust
pcapFileParts = os.path.splitext(pcapFile)
if pcapHash := shakey_file_hash(pcapFile):
copyCode = malcolmVm.CopyFile(
pcapFile,
f'/home/{args.vmImageUsername}/Malcolm/pcap/upload/{pcapHash}{pcapFileParts[1]}',
tolerateFailure=True,
)
if copyCode == 0:
set_pcap_hash(pcapFile, pcapHash)
if ShuttingDown[0] == False:
copyCode = malcolmVm.CopyFile(
pcapFile,
f'/home/{args.vmImageUsername}/Malcolm/pcap/upload/{pcapHash}{pcapFileParts[1]}',
tolerateFailure=True,
)
if copyCode == 0:
set_pcap_hash(pcapFile, pcapHash)

# wait for all logs to finish being ingested into the system
if not malcolmVm.WaitForLastEventTime():
logging.warning(f"Malcolm instance never achieved idle state after inserting events")

# run the tests
exitCode = pytest.main(list(mmguero.Flatten(['-p', 'no:cacheprovider', args.testPath, extraArgs])))
if ShuttingDown[0] == False:
exitCode = pytest.main(list(mmguero.Flatten(['-p', 'no:cacheprovider', args.testPath, extraArgs])))

# if we started Malcolm, sleep until instructed
if args.startMalcolm:
Expand Down

0 comments on commit 60efa89

Please sign in to comment.