mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-07 02:26:28 +02:00
Cleaning
This commit is contained in:
parent
f6fc8a4c86
commit
c73ebc1fbc
2 changed files with 11 additions and 11 deletions
10
README.md
10
README.md
|
@ -3,21 +3,21 @@
|
||||||
[](https://www.python.org/) [](https://gitlab.com/manzerbredes/esds/-/tree/main)
|
[](https://www.python.org/) [](https://gitlab.com/manzerbredes/esds/-/tree/main)
|
||||||
|
|
||||||
### What is ESDS ?
|
### What is ESDS ?
|
||||||
It is a short learning curve and coarse-grain network simulator. It contains the essential building blocks for the simulation of *Distributed Systems*, *Cyber-Physical Systems* (CPS), *Wireless Sensors Networks* (WSN) scenarios. It was originally designed to improve node implementation flexibility/faithfulness and mitigate the learning curve compare to existing network simulators.
|
It is a short learning curve and coarse-grain network simulator. It contains the essential building blocks for the simulation of *Distributed Systems*, *Cyber-Physical Systems* (CPS), *Wireless Sensors Networks* (WSN) scenarios. It was originally designed to improve the flexibility/faithfulness of nodes implementations and mitigate the learning curve compare to existing network simulators.
|
||||||
|
|
||||||
ESDS is part of a research project. Thus, studies and validation experiments are available online. For more details please visit http://todo.com.
|
ESDS is part of a research project. Studies and validation experiments are available online. For more details please visit http://todo.com.
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
`> pip install esds`
|
`> pip install esds`
|
||||||
|
|
||||||
To ensure that esds is properly working and installed on your system, you can run the simulations tests with one of the following scripts:
|
To ensure that esds is properly working and installed on your system, you can run the simulation tests with one of the following scripts:
|
||||||
- `tests/run.sh`
|
- `tests/run.sh`
|
||||||
- `tests/run.py`
|
- `tests/run.py`
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
- Easy to use
|
- Easy to use
|
||||||
- Small API
|
- Small API
|
||||||
- Agent-based: node implementations are in independant python files
|
- Agent-based: node implementations are located in independant python files
|
||||||
- Wireless interferences detection (i.e no modelization)
|
- Wireless interferences detection (i.e no modelization)
|
||||||
- Custom node mobility (by updating the network matrix)
|
- Custom node mobility (by updating the network matrix)
|
||||||
- Nodes plugins (e.g energy consumption)
|
- Nodes plugins (e.g energy consumption)
|
||||||
|
@ -43,4 +43,4 @@ To ensure that esds is properly working and installed on your system, you can ru
|
||||||
- *More details on the API in [example/sender.py](example/sender.py)*
|
- *More details on the API in [example/sender.py](example/sender.py)*
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
See `example/`, `tests/` and `manual/manual.pdf`
|
See `manual/manual.pdf` and the source code in `example/` and`tests/`.
|
||||||
|
|
12
tests/run.py
12
tests/run.py
|
@ -1,12 +1,12 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os, subprocess, time,sys
|
import os,subprocess,time,sys
|
||||||
|
|
||||||
##### Setup Variables
|
##### Setup variables
|
||||||
tests_timeout=20 # Max duration of a test
|
tests_timeout=20 # Max duration of a test
|
||||||
tests_path = os.path.dirname(os.path.realpath(__file__))
|
tests_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
##### Run All Tests
|
##### Run all tests
|
||||||
for file in os.listdir(tests_path):
|
for file in os.listdir(tests_path):
|
||||||
current_test_path=os.path.join(tests_path,file)
|
current_test_path=os.path.join(tests_path,file)
|
||||||
if os.path.isdir(current_test_path):
|
if os.path.isdir(current_test_path):
|
||||||
|
@ -15,7 +15,7 @@ for file in os.listdir(tests_path):
|
||||||
print("- %-40s%s " % (file,"=>"),end='')
|
print("- %-40s%s " % (file,"=>"),end='')
|
||||||
try:
|
try:
|
||||||
start_at=time.time()
|
start_at=time.time()
|
||||||
out=subprocess.check_output([sys.executable, simulator_path], stderr=subprocess.STDOUT,timeout=tests_timeout,encoding="utf-8")
|
out=subprocess.check_output([sys.executable, simulator_path],stderr=subprocess.STDOUT,timeout=tests_timeout,encoding="utf-8")
|
||||||
out_expected=open(out_path).read()
|
out_expected=open(out_path).read()
|
||||||
end_at=time.time()
|
end_at=time.time()
|
||||||
if out_expected != out:
|
if out_expected != out:
|
||||||
|
@ -28,12 +28,12 @@ for file in os.listdir(tests_path):
|
||||||
print("passed (%0.1fs)"%(end_at-start_at))
|
print("passed (%0.1fs)"%(end_at-start_at))
|
||||||
except subprocess.TimeoutExpired as err:
|
except subprocess.TimeoutExpired as err:
|
||||||
print("failed :(")
|
print("failed :(")
|
||||||
print("------------- Test timeout (should not exceed "+str(tests_timeout)+"s) -------------")
|
print("------------- Test duration expired (timeout="+str(tests_timeout)+"s) -------------")
|
||||||
print(err.output,end="")
|
print(err.output,end="")
|
||||||
exit(1)
|
exit(1)
|
||||||
except subprocess.CalledProcessError as err:
|
except subprocess.CalledProcessError as err:
|
||||||
print("failed :(")
|
print("failed :(")
|
||||||
print("------------- Non test has a non-zero exit code -------------")
|
print("------------- Test has a non-zero exit code -------------")
|
||||||
print(err.output,end="")
|
print(err.output,end="")
|
||||||
exit(2)
|
exit(2)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
|
Loading…
Add table
Reference in a new issue