From b9e9a8559b51d8a72fd5f7bc9d798828f1427de0 Mon Sep 17 00:00:00 2001 From: sdemeesterde <samuel.demeester@student.uclouvain.be> Date: Sun, 24 Apr 2022 23:51:15 +0200 Subject: [PATCH] added file for the performance tests --- tests/performances_tests.py | 23 +++++++++++++++++++++++ tests/performances_tests.sh | 16 ++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 tests/performances_tests.py create mode 100644 tests/performances_tests.sh diff --git a/tests/performances_tests.py b/tests/performances_tests.py new file mode 100644 index 0000000..92b09e9 --- /dev/null +++ b/tests/performances_tests.py @@ -0,0 +1,23 @@ + +""" +Return a dictionary of the different values found in the receiver stats (.csv) file +""" +def read_receiver_stats(filename): + dictionary = {} + with open(filename, 'r') as f: + for line in f.readlines(): + key, value = line.split(":") + dictionary[key] = int(value) + return dictionary + +""" +Return a dictionary of the different values found in the sender stats (.csv) file +""" +def read_sender_stats(filename): + dictionary = {} + with open(filename, 'r') as f: + for line in f.readlines(): + key, value = line.split(":") + dictionary[key] = int(value) + return dictionary + diff --git a/tests/performances_tests.sh b/tests/performances_tests.sh new file mode 100644 index 0000000..e133718 --- /dev/null +++ b/tests/performances_tests.sh @@ -0,0 +1,16 @@ +#!/bin/bash + + +# File use for the test of performance +file_to_transfer='tests_files/smile.png' + +# Chosen parameters for the test of performance +ERROR_RATE=20 +CUT_RATE=30 +DELAY=0 +JITTER=0 +LOSS_RATE=25 + +if [ ! -d "tests_logs/performance_tests/" ]; then + mkdir 'tests_logs/performance_tests/' +fi -- GitLab