17 lines
543 B
Python
17 lines
543 B
Python
#!/usr/bin/env python3
|
|
import subprocess
|
|
import sys
|
|
|
|
# Test that our tool produces correct sha256 hash
|
|
result = subprocess.run(['python3', '/root/troupe-standup/wizard-work/spark/sha256_tool.py', '/etc/hostname'],
|
|
capture_output=True, text=True)
|
|
|
|
expected = '1c7ae0f30a68699c38441fd54bfbe20aed8e0c7c8793e25db41d2ff169b9639c'
|
|
actual = result.stdout.strip()
|
|
|
|
if expected == actual:
|
|
print("PASS: Hash verification successful")
|
|
sys.exit(0)
|
|
else:
|
|
print(f"FAIL: Expected {expected}, got {actual}")
|
|
sys.exit(1) |