Skip to content

Commit

Permalink
remove make_ws_request function
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo committed Jul 5, 2024
1 parent ce1f951 commit 4dd16e3
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions tests/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())

0 comments on commit 4dd16e3

Please sign in to comment.