Skip to content

Commit

Permalink
tests/psoc6: Fixed test failure.
Browse files Browse the repository at this point in the history
Signed-off-by: NikhitaR-IFX <[email protected]>
  • Loading branch information
NikhitaR-IFX committed Feb 21, 2024
1 parent 2f67193 commit 78d81cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/psoc6/test_scripts/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ def exec(cmd, op_file_path="null"):
subprocess.run(f"{cmd} {op_file_path}", shell=True, capture_output=False)
else:
with open(op_file_path, "a") as file:
subprocess.call(cmd, shell=True, stdout=file)
subprocess.check_call(cmd, shell=True, stdout=file)


def validate_test(op, exp_op):
with open(op, "r") as output_file:
output = output_file.read()
output = [line.strip() for line in output_file]

with open(exp_op, "r") as exp_output_file:
exp_output = exp_output_file.read()
exp_output = [line.strip() for line in exp_output_file]

if output == exp_output:
if output != exp_output:
print("Operation failed!")
sys.exit(1)
else:
Expand Down Expand Up @@ -73,7 +73,7 @@ def fs_adv_test():
exec(mpr_rm, "test_fs_large_file.txt")
exec(mpr_large_file_cp, adv_test_op_fp)
validate_test(adv_test_op_fp, exp_adv_op_fp)
os.remove(adv_test_op_fp_test_op_fp)
os.remove(adv_test_op_fp)


if test_type == "0":
Expand Down

0 comments on commit 78d81cd

Please sign in to comment.