Skip to content

Commit

Permalink
ssvplwc: server-side implementation
Browse files Browse the repository at this point in the history
This patch implements the module for tests via ssvplwc.

Signed-off-by: Amy Parker <amy@amyip.net>
  • Loading branch information
amyipdev committed Jul 28, 2023
1 parent b19d926 commit 6a3d906
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion srv/test_modules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from . import ping
from . import httpt
from . import ssvplwc

modules = {
"ping": ping.ping_t,
"http": httpt.http_t
"http": httpt.http_t,
"ssvplwc": ssvplwc.ssvplwc_t
}


Expand Down
11 changes: 11 additions & 0 deletions srv/test_modules/ssvplwc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import socket


def ssvplwc_t(srv: dict) -> bool:
try:
ss = socket.socket()
ss.connect((srv["ip"], int(srv["args"])))
b = ss.recv(2048)
return b == b"ssvp-ok"
except ConnectionError:
return False

0 comments on commit 6a3d906

Please sign in to comment.