diff --git a/tests/functions.py b/tests/functions.py index f73c3dc8a13d6..06e4a1bec3778 100755 --- a/tests/functions.py +++ b/tests/functions.py @@ -7,13 +7,11 @@ import json import os import re -import uuid from subprocess import PIPE, Popen, TimeoutExpired, run from time import sleep from urllib.parse import urlparse import requests -import websocket from auto_config import password, user from middlewared.test.integration.utils import host @@ -356,22 +354,3 @@ def wait_on_job(job_id, max_timeout): if timeout >= max_timeout: return {'state': 'TIMEOUT', 'results': job_results.json()[0]} timeout += 5 - - -def make_ws_request(ip, payload): - # create connection - ws = websocket.create_connection(f'ws://{ip}:80/websocket') - - # setup features - ws.send(json.dumps({'msg': 'connect', 'version': '1', 'support': ['1'], 'features': []})) - ws.recv() - - # login - id = str(uuid.uuid4()) - ws.send(json.dumps({'id': id, 'msg': 'method', 'method': 'auth.login', 'params': list(authentication)})) - ws.recv() - - # return the request - payload.update({'id': id}) - ws.send(json.dumps(payload)) - return json.loads(ws.recv())