updated skeleton with true data
This commit is contained in:
@ -1,2 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
print(8000)
|
||||
import socket
|
||||
|
||||
START, END = 8000, 8100
|
||||
|
||||
def port_free(port):
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
try:
|
||||
s.bind(("0.0.0.0", port))
|
||||
return True
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
for port in range(START, END + 1):
|
||||
if port_free(port):
|
||||
print(port)
|
||||
exit(0)
|
||||
|
||||
print("ERR_NO_FREE_PORT")
|
||||
exit(1)
|
||||
|
||||
40
scripts/selftest.py
Normal file
40
scripts/selftest.py
Normal file
@ -0,0 +1,40 @@
|
||||
import requests, sys, json
|
||||
|
||||
def main():
|
||||
# Try read port file
|
||||
try:
|
||||
with open("gateway/port.txt") as f:
|
||||
port = f.read().strip()
|
||||
except:
|
||||
print("❌ port.txt nicht gefunden")
|
||||
return
|
||||
|
||||
base = f"http://localhost:{port}"
|
||||
|
||||
print("🔍 Healthcheck…")
|
||||
try:
|
||||
r = requests.get(base + "/health")
|
||||
print("Health:", r.status_code, r.text)
|
||||
except Exception as e:
|
||||
print("❌ Healthcheck fehlgeschlagen:", e)
|
||||
return
|
||||
|
||||
print("🎤 Test-Synthese…")
|
||||
try:
|
||||
payload = {
|
||||
"model": "xtts-v2",
|
||||
"input": "Dies ist ein Test.",
|
||||
"voice": "auto",
|
||||
"format": "wav"
|
||||
}
|
||||
r = requests.post(base + "/v1/audio/speech", json=payload)
|
||||
print("TTS Status:", r.status_code)
|
||||
if r.status_code == 200:
|
||||
print("OK ✓")
|
||||
else:
|
||||
print("❌ TTS Fehler:", r.text)
|
||||
except Exception as e:
|
||||
print("❌ Synthese fehlgeschlagen:", e)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user