Finished tests, ready to merge

This commit is contained in:
DomySh
2022-08-03 11:09:27 +00:00
parent 3716205847
commit cd3dd2627f
8 changed files with 62 additions and 64 deletions

View File

@@ -46,10 +46,6 @@ Initiially the project was based only on regex filters, and also now the main fu
# TODO: # TODO:
## Until merge of dev branch to main
- Fix/Improve Benchmark && Benchmark readme
## Next points ## Next points
- Create hijacking port to proxy - Create hijacking port to proxy

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

BIN
docs/FiregexInternals.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

View File

@@ -6,79 +6,82 @@ Tests are a quick and dirty way to check if your modification to the backend cod
# Running all the tests # Running all the tests
If you are working on the same machine firegex is running on, you can just run run_tests.sh If you are working on the same machine firegex is running on, you can just run run_tests.sh
$ ./run_tests.sh ```bash
$ ./run_tests.sh
```
It will automatically perform a general API test, Netfilter and Proxy Regex test. It will automatically perform a general API test, Netfilter and Proxy Regex test.
You can also run tests manually: You can also run tests manually:
$ ./api_test.py -h ```bash
usage: api_test.py [-h] [--address ADDRESS] --password PASSWORD $ ./api_test.py -h
usage: api_test.py [-h] [--address ADDRESS] --password PASSWORD
$ ./nf_test.py -h $ ./nf_test.py -h
usage: nf_test.py [-h] [--address ADDRESS] --password PASSWORD [--service_name SERVICE_NAME] [--port PORT] usage: nf_test.py [-h] [--address ADDRESS] --password PASSWORD [--service_name SERVICE_NAME] [--port PORT]
[--ipv6] [--proto {tcp,udp}] [--ipv6] [--proto {tcp,udp}]
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
--address ADDRESS, -a ADDRESS --address ADDRESS, -a ADDRESS
Address of firegex backend Address of firegex backend
--password PASSWORD, -p PASSWORD --password PASSWORD, -p PASSWORD
Firegex password Firegex password
--service_name SERVICE_NAME, -n SERVICE_NAME --service_name SERVICE_NAME, -n SERVICE_NAME
Name of the test service Name of the test service
--port PORT, -P PORT Port of the test service --port PORT, -P PORT Port of the test service
--ipv6, -6 Test Ipv6 --ipv6, -6 Test Ipv6
--proto {tcp,udp}, -m {tcp,udp} --proto {tcp,udp}, -m {tcp,udp}
Select the protocol Select the protocol
$ ./px_test.py -h $ ./px_test.py -h
usage: px_test.py [-h] [--address ADDRESS] --password PASSWORD [--service_name SERVICE_NAME] [--port PORT] usage: px_test.py [-h] [--address ADDRESS] --password PASSWORD [--service_name SERVICE_NAME] [--port PORT]
optional arguments:
-h, --help show this help message and exit
--address ADDRESS, -a ADDRESS
Address of firegex backend
--password PASSWORD, -p PASSWORD
Firegex password
--service_name SERVICE_NAME, -n SERVICE_NAME
Name of the test service
--port PORT, -P PORT Port of the test service
optional arguments:
-h, --help show this help message and exit
--address ADDRESS, -a ADDRESS
Address of firegex backend
--password PASSWORD, -p PASSWORD
Firegex password
--service_name SERVICE_NAME, -n SERVICE_NAME
Name of the test service
--port PORT, -P PORT Port of the test service
```
# Running a Benchmark # Running a Benchmark
./benchmark.py ```bash
options: ./benchmark.py
-h, --help show this help message and exit options:
--address ADDRESS, -a ADDRESS -h, --help show this help message and exit
Address of firegex backend --address ADDRESS, -a ADDRESS
--port PORT, -P PORT Port of the Benchmark service Address of firegex backend
--internal-port INTERNAL_PORT, -I INTERNAL_PORT --port PORT, -P PORT Port of the Benchmark service
Internal port of the Benchmark service --internal-port INTERNAL_PORT, -I INTERNAL_PORT
--service-name SERVICE_NAME, -n SERVICE_NAME Internal port of the Benchmark service
Name of the Benchmark service --service-name SERVICE_NAME, -n SERVICE_NAME
--password PASSWORD, -p PASSWORD Name of the Benchmark service
Firegex password --password PASSWORD, -p PASSWORD
--num-of-regexes NUM_OF_REGEXES, -r NUM_OF_REGEXES Firegex password
Number of regexes to benchmark with --num-of-regexes NUM_OF_REGEXES, -r NUM_OF_REGEXES
--duration DURATION, -d DURATION Number of regexes to benchmark with
Duration of the Benchmark in seconds --duration DURATION, -d DURATION
--output-file OUTPUT_FILE, -o OUTPUT_FILE Duration of the Benchmark in seconds
Output results csv file --output-file OUTPUT_FILE, -o OUTPUT_FILE
--num-of-streams NUM_OF_STREAMS, -s NUM_OF_STREAMS Output results csv file
Output results csv file --num-of-streams NUM_OF_STREAMS, -s NUM_OF_STREAMS
--mode {netfilter,proxy}, -m {netfilter,proxy} Output results csv file
Type of filtering --mode {netfilter,proxy}, -m {netfilter,proxy}
Type of filtering
```
Benchmarks let you evaluate the performance of the filters. You can run one by typing in a shell ```test.py -p FIREGEX_PASSWORD -r NUM_OF_REGEX -d BENCHMARK_DURATION -m proxy``` to benchmark the Proxy based regex filter, or ``` -m netfilter ``` to benchmark the Netfilter based regex filtering. Benchmarks let you evaluate the performance of the filters. You can run one by typing in a shell ```test.py -p FIREGEX_PASSWORD -r NUM_OF_REGEX -d BENCHMARK_DURATION -m proxy``` to benchmark the Proxy based regex filter, or ``` -m netfilter ``` to benchmark the Netfilter based regex filtering.
It uses iperf3 to benchmark the throughput in MB/s of the server, both with filters, without filters, and for each new added regex. It will automatically add a new random regex untill it has reached NUM_OF_REGEX specified in the arguments. It uses iperf3 to benchmark the throughput in MB/s of the server, both with filters, without filters, and for each new added regex. It will automatically add a new random regex untill it has reached NUM_OF_REGEX specified in the arguments.
You will find a new benchmark.csv file containg the results. You will find a new benchmark.csv file containg the results.
# Firegex Performance Results # Firegex Performance Results
TODO: Update with new graphs
The test was performed on: The test was performed on:
- AMD Ryzen 7 3700X (16 thread) @ 3.600GHz - Bedrock Linux 0.7.27 Poki x86_64
- RAM Speed: 3200 MT/s (Dual Channel) - Intel i5-7200U (4) @ 3.100GHz
- Kernel: 5.18.5-arch1-1 - 8GB RAM DDR4 2133 MT/s
Command: `python3 benchmark.py -r 100 -d 1 -s 50` Command: `./benchmark.py -p testpassword -r 50 -d 1 -s 60`
![Firegex Benchmark](/docs/FiregexBenchmark.png) ![Firegex Benchmark](results/Benchmark-chart.png)

View File

@@ -1 +0,0 @@
,nik,nik-deb,03.08.2022 12:06,file:///home/nik/.config/libreoffice/4;

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.