fix(ci): use public /health probe and authorize Hermes report requests in pipeline test
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 1m50s
Release Binaries & Installers / Build & Release Linux Binaries (push) Failing after 1m47s
Release Binaries & Installers / Build & Release Windows Binaries & Installers (push) Canceled after 3m20s
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 1m50s
Release Binaries & Installers / Build & Release Linux Binaries (push) Failing after 1m47s
Release Binaries & Installers / Build & Release Windows Binaries & Installers (push) Canceled after 3m20s
This commit is contained in:
@@ -49,10 +49,10 @@ jobs:
|
|||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
echo "[*] Server launched in background with PID $SERVER_PID"
|
echo "[*] Server launched in background with PID $SERVER_PID"
|
||||||
|
|
||||||
# 3. Poll Hermes health / report endpoint until server is listening
|
# 3. Poll /health endpoint until server is listening
|
||||||
READY=0
|
READY=0
|
||||||
for i in $(seq 1 20); do
|
for i in $(seq 1 20); do
|
||||||
if python3 -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8443/api/hermes/report', timeout=1)" >/dev/null 2>&1; then
|
if python3 -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8443/health', timeout=1)" >/dev/null 2>&1; then
|
||||||
echo "[+] LOGAR Server is ready after ${i}s."
|
echo "[+] LOGAR Server is ready after ${i}s."
|
||||||
READY=1
|
READY=1
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ def run_tests():
|
|||||||
return json.loads(resp_bytes.decode("utf-8"))
|
return json.loads(resp_bytes.decode("utf-8"))
|
||||||
|
|
||||||
print("\n=== [3] Testing Temporal Persistence & Direct Anomaly Verification over mTLS ===")
|
print("\n=== [3] Testing Temporal Persistence & Direct Anomaly Verification over mTLS ===")
|
||||||
test_signature = "TestServiceDegraded"
|
test_signature = f"TestServiceDegraded_{int(time.time())}"
|
||||||
candidate_log = [{
|
candidate_log = [{
|
||||||
"server": client_id,
|
"server": client_id,
|
||||||
"os_type": "linux",
|
"os_type": "linux",
|
||||||
@@ -181,7 +181,7 @@ def run_tests():
|
|||||||
print("[OK] Direct verification confirmed: Warning immediately verified for Hermes with run count tracking over mTLS!")
|
print("[OK] Direct verification confirmed: Warning immediately verified for Hermes with run count tracking over mTLS!")
|
||||||
|
|
||||||
print("\n=== [4] Testing Immediate Pass for Errors over mTLS ===")
|
print("\n=== [4] Testing Immediate Pass for Errors over mTLS ===")
|
||||||
error_signature = "TestServiceCrashImmediate"
|
error_signature = f"TestServiceCrashImmediate_{int(time.time())}"
|
||||||
error_log = [{
|
error_log = [{
|
||||||
"server": client_id,
|
"server": client_id,
|
||||||
"os_type": "linux",
|
"os_type": "linux",
|
||||||
@@ -207,7 +207,9 @@ def run_tests():
|
|||||||
print("[OK] Immediate pass verified: Error promoted to VERIFIED anomaly immediately!")
|
print("[OK] Immediate pass verified: Error promoted to VERIFIED anomaly immediately!")
|
||||||
|
|
||||||
print("\n=== [5] Testing Hermes Reporting Endpoint (/api/hermes/report) ===")
|
print("\n=== [5] Testing Hermes Reporting Endpoint (/api/hermes/report) ===")
|
||||||
req = urllib.request.Request(f"http://{HERMES_HOST}:{HERMES_PORT}/api/hermes/report")
|
token = server_conf.get("auth_token") or client_conf.get("auth_token")
|
||||||
|
headers = {"Authorization": f"Bearer {token}"} if token else {}
|
||||||
|
req = urllib.request.Request(f"http://{HERMES_HOST}:{HERMES_PORT}/api/hermes/report", headers=headers)
|
||||||
with urllib.request.urlopen(req, timeout=5) as response:
|
with urllib.request.urlopen(req, timeout=5) as response:
|
||||||
assert response.status == 200, f"Expected 200, got {response.status}"
|
assert response.status == 200, f"Expected 200, got {response.status}"
|
||||||
hermes_data = json.loads(response.read().decode("utf-8"))
|
hermes_data = json.loads(response.read().decode("utf-8"))
|
||||||
|
|||||||
Reference in New Issue
Block a user