mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-03 09:19:24 +00:00
Sync test: added stratum connections
This commit is contained in:
parent
b20db0a117
commit
7134187dc9
2 changed files with 44 additions and 6 deletions
21
.github/workflows/test-sync.yml
vendored
21
.github/workflows/test-sync.yml
vendored
|
@ -32,7 +32,10 @@ jobs:
|
|||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
./p2pool --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --no-cache --data-api data --local-api --loglevel 6
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy1.log &
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy2.log &
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy3.log &
|
||||
./p2pool --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
|
@ -40,7 +43,7 @@ jobs:
|
|||
with:
|
||||
name: p2pool_ubuntu_data
|
||||
path: |
|
||||
build/p2pool.log
|
||||
build/*.log
|
||||
build/data/
|
||||
|
||||
sync-test-macos:
|
||||
|
@ -69,7 +72,10 @@ jobs:
|
|||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
./p2pool --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --no-cache --data-api data --local-api --loglevel 6
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy1.log &
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy2.log &
|
||||
python ../tests/src/stratum_dummy.py stratum_dummy3.log &
|
||||
./p2pool --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
|
@ -77,7 +83,7 @@ jobs:
|
|||
with:
|
||||
name: p2pool_macos_data
|
||||
path: |
|
||||
build/p2pool.log
|
||||
build/*.log
|
||||
build/data/
|
||||
|
||||
sync-test-windows:
|
||||
|
@ -106,7 +112,10 @@ jobs:
|
|||
run: |
|
||||
cd build/Debug
|
||||
mkdir data
|
||||
./p2pool.exe --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --no-cache --data-api data --local-api --loglevel 6
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py stratum_dummy1.log"
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py stratum_dummy2.log"
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py stratum_dummy3.log"
|
||||
./p2pool.exe --host p2pmd.xmrvsbeast.com --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||
findstr /C:"Synchronization finished successfully" p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
|
@ -114,5 +123,5 @@ jobs:
|
|||
with:
|
||||
name: p2pool_windows_data
|
||||
path: |
|
||||
build/Debug/p2pool.log
|
||||
build/Debug/*.log
|
||||
build/Debug/data/
|
||||
|
|
29
tests/src/stratum_dummy.py
Normal file
29
tests/src/stratum_dummy.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
import socket
|
||||
import time
|
||||
import sys
|
||||
|
||||
f = open(sys.argv[1], 'wb');
|
||||
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.settimeout(1)
|
||||
sock.setblocking(True)
|
||||
|
||||
time.sleep(5)
|
||||
|
||||
while sock.connect_ex(('127.0.0.1', 3333)) != 0:
|
||||
f.write(b'.\n')
|
||||
print('.')
|
||||
time.sleep(1)
|
||||
|
||||
sock.sendall(b'{"id":1,"method":"login","params":{"login":"x"}}\n')
|
||||
|
||||
while True:
|
||||
data = sock.recv(1024)
|
||||
if len(data) == 0:
|
||||
break;
|
||||
f.write(data)
|
||||
f.flush()
|
||||
print(data.decode('utf-8'))
|
||||
|
||||
sock.close()
|
||||
f.close()
|
Loading…
Reference in a new issue