Files
recipe-maintainer/recipe-info/lasuite-drive/tests/wopi_configured.py
T
autonomic-bot f283a371bb recipe-maintainer: public snapshot (secrets + deployment plans removed, single commit)
Sanitized single-commit public mirror of recipe-maintainer.
- Removed test-ssh/.testenv (live creds); added test-ssh/.testenv.example placeholders.
- Removed plans/ and planned-updates/ (deployment-planning docs) so no client/
  deployment domains appear in the public repo.
- All other secret stores were already gitignored.
- docs.coopcloud.tech retained as a submodule (public upstream).
2026-06-16 20:18:24 +00:00

64 lines
2.1 KiB
Python
Executable File

#!/usr/bin/env python3
"""WOPI configuration verification test."""
import argparse
import os
import sys
import urllib.request
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from utils.tests.helpers import resolve_domain
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--domain', default=os.environ.get('TEST_DOMAIN'))
args = parser.parse_args()
domain = args.domain or resolve_domain('lasuite-drive')
collabora_url = f"https://collabora.{domain}/hosting/discovery"
onlyoffice_url = f"https://onlyoffice.{domain}/hosting/discovery"
print("Testing WOPI configuration")
print()
# Step 1: Check Collabora discovery endpoint
print("Step 1: Checking Collabora discovery endpoint ...")
try:
req = urllib.request.Request(collabora_url)
with urllib.request.urlopen(req, timeout=15) as resp:
body = resp.read().decode('utf-8', errors='replace')
status = resp.getcode()
except Exception as e:
print(f" FAIL: Collabora discovery check failed: {e}")
sys.exit(1)
if status == 200 and 'wopi-discovery' in body:
print(" PASS: Collabora discovery returns valid WOPI XML")
else:
print(f" FAIL: Collabora discovery check failed (HTTP {status})")
sys.exit(1)
# Step 2: Check OnlyOffice discovery endpoint
print("Step 2: Checking OnlyOffice discovery endpoint ...")
try:
req = urllib.request.Request(onlyoffice_url)
with urllib.request.urlopen(req, timeout=15) as resp:
body = resp.read().decode('utf-8', errors='replace')
status = resp.getcode()
except Exception as e:
print(f" FAIL: OnlyOffice discovery check failed: {e}")
sys.exit(1)
if status == 200 and 'wopi-discovery' in body:
print(" PASS: OnlyOffice discovery returns valid WOPI XML")
else:
print(f" FAIL: OnlyOffice discovery check failed (HTTP {status})")
sys.exit(1)
print()
print("PASS: WOPI discovery endpoints are reachable and returning valid XML")
if __name__ == '__main__':
main()