""" Simple test: Just download from GeViServer and check ROUNDTRIP_TEST mapping """ import requests import json BASE_URL = "http://localhost:8000" def authenticate(): response = requests.post(f'{BASE_URL}/api/v1/auth/login', json={ 'username': 'admin', 'password': 'admin123' }) return response.json()['access_token'] def main(): token = authenticate() headers = {'Authorization': f'Bearer {token}'} print("=" * 80) print("DOWNLOADING FROM GEVISERVER") print("=" * 80) print() # Download from GeViServer response = requests.get( f'{BASE_URL}/api/v1/configuration/download', headers=headers ) if response.status_code != 200: print(f"ERROR: Download failed: {response.status_code}") print(response.text) return print("[OK] Download successful") print() # Find ROUNDTRIP_TEST mapping config = response.json() found_mapping = None for mapping in config.get('actionMappings', {}).get('mappings', []): if mapping.get('name') == 'ROUNDTRIP_TEST': found_mapping = mapping break if not found_mapping: print("ERROR: ROUNDTRIP_TEST mapping not found!") print(f"Available mappings: {[m.get('name') for m in config.get('actionMappings', {}).get('mappings', [])[:10]]}") return print("[OK] Found ROUNDTRIP_TEST mapping") print() print("Full mapping data:") print(json.dumps(found_mapping, indent=2)) print() print("=" * 80) print("OUTPUT ACTIONS ANALYSIS") print("=" * 80) print() for i, action in enumerate(found_mapping.get('outputActions', []), 1): print(f"Output Action {i}:") print(f" Action name: {action.get('action', 'MISSING')}") print(f" Parameters:") for key, value in action.get('parameters', {}).items(): print(f" {key}: {value}") print() # Check what we expected vs what we got if i == 1: # First action should be PanLeft with GscServer expected_action = "PanLeft" expected_server_param = "GscServer" else: # Second action should be PanRight with GCoreServer expected_action = "PanRight" expected_server_param = "GCoreServer" actual_action = action.get('action') params = action.get('parameters', {}) issues = [] if actual_action != expected_action: issues.append(f"[WARNING] Expected action '{expected_action}', got '{actual_action}'") if expected_server_param not in params: issues.append(f"[WARNING] Missing expected parameter '{expected_server_param}'") if 'SwitchMode' in params or 'VideoInput' in params or 'VideoOutput' in params: issues.append("[WARNING] Has invalid CrossSwitch parameters!") if issues: print(" ISSUES:") for issue in issues: print(f" {issue}") else: print(" [OK] Looks correct!") print() if __name__ == '__main__': main()