pip initial changes
This commit is contained in:
0
python/p2prc-homeserver/tests/__init__.py
Normal file
0
python/p2prc-homeserver/tests/__init__.py
Normal file
38
python/p2prc-homeserver/tests/test.py
Normal file
38
python/p2prc-homeserver/tests/test.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from p2prc_homeserver import *
|
||||
|
||||
if __name__ == "__main__":
|
||||
P2PRCNodes = ListNodes()
|
||||
|
||||
# Create sample process
|
||||
sample_process = Process(
|
||||
ID="",
|
||||
TaskName="TestServer",
|
||||
InternalPortNo="8084",
|
||||
NodeInfo=P2PRCNodes.ip_address[2],
|
||||
CommandToRunScript="sh SamplePythonTestServer/server.sh &",
|
||||
CommandToKillScript="sh SamplePythonTestServer/killserver.sh",
|
||||
DomainName="",
|
||||
Status=False,
|
||||
ExternalAddress=""
|
||||
)
|
||||
|
||||
print("------------ Starting process -------------")
|
||||
|
||||
# Spin process
|
||||
sample_process = SpinProcess(sample_process)
|
||||
|
||||
print("------------ Process Public address -------------")
|
||||
|
||||
print(ListProcess())
|
||||
|
||||
print("------------ Process kept waiting for 20 seconds -------------")
|
||||
|
||||
# Runs the process for 20 seconds
|
||||
time.sleep(20)
|
||||
|
||||
print("------------ Process getting killed -------------")
|
||||
|
||||
# Kills the process
|
||||
# KillProcess(sample_process)
|
||||
|
||||
print("------------ Process current process -------------")
|
||||
Reference in New Issue
Block a user