-
Notifications
You must be signed in to change notification settings - Fork 0
Tests
PTC Wiki ▸ Tests
PTC provides several testcases that are completely memory-based. In addition to optimizing their execution time and avoid depending on the network, this also avoids the need of elevated permissions to execute the code since raw sockets are no longer required.
The tests can be executed through the run_tests.py script, which in turn should be run using the Python 2.7 interpreter. If no additional arguments are passed, the script will extract every available test inside the test directory and will run them, showing the results through the standard output. It is possible, however, to execute individual test classes. This can be achieved by providing arguments of the form --<identifier>, where <identifier> can take the value of any name matching any of the test files. The following list shows every valid identifier:
-
syn: connection establishment tests. -
fin: connection teardown tests. -
ack: tests involving different acknowledge scenarios. -
data: tests involving data exchange. -
control-block: control block tests. -
retransmission: tests that cover the retransmission mechanism inside the protocol. -
rqueue: tests for the retransmission queue data structure. -
buffer: tests for the buffer data structure. -
seqnum: tests that cover sequence number functionality. -
packet: packet mapping tests (from bytes to packet objects and viceversa).
As an example, this line will run both connection establishment and teardown tests:
$ python run_tests.py --syn --fin