Skip to content
Extraits de code Groupes Projets
Valider 658b54f3 rédigé par Samuel de Meester de Ravestein's avatar Samuel de Meester de Ravestein
Parcourir les fichiers

better make interop and cleaner sender debugs

parent 6a4b4685
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -39,9 +39,10 @@ This folder contains testing files that we will be sendig between the `receiver`
For the testing we have a specific directory that contains our shell script tests. In order to execute our tests we advise to run the following Makefile command
```
make tests -s
make tests
```
The silent argument `-s` is to silence any Makefile output and only leave the messages of the tests. In order to test the transfer of a file, you have to add a file in the `test_files`. The suite cases will automatically load the fle and transfer using our protocol.
In order to test the transfer of a file, you have to add a file in the `test_files`. The suite cases will automatically load the fle and transfer using our protocol.
We have two types of tests suites. *Simple* and *Advanced* test suites.
......@@ -49,21 +50,7 @@ We have two types of tests suites. *Simple* and *Advanced* test suites.
Simple tests don't use `linksimulator`, however they use `Valgrind` to check memory usage in both the sender and the receiver. After executing the `make [debug]`. One can run a simple test with the following command :
```
./tests/simple_test.sh <path_to_file>
```
The output for each file sent using the simple test is to be found in the `unwanted_logs/`. They respect the following format :
| File in `unwanted_logs/` | Contains |
| :-- | :-- |
| `<file_basename>`_received_file.`<file_extension>` | This is the file received by the `receiver`.|
| `<file_basename>`_receiver.log | Contains the valgrind log of the `receiver`. |
| `<file_basename>`_sender.log | Contains the valgrind log of the `sender`. |
| receiver.log | Contains the output on the stderr of the `receiver`. |
| sender.log | Contains the output on the stderr of the `sender`. |
The stdout prints *Le transfert est réussi!*, upon success else it prints the comparison between the sent file and the received file.
### 4. 2. *Advanced* Test Suites
......
Fichier ajouté
Fichier ajouté
Maldives (DNS)
--- traceroute to 103.110.109.106 (103.110.109.106), 64 hops max ---
1 192.168.1.1 7,455ms 3,066ms 3,234ms
2 10.24.146.9 10,552ms 10,199ms 9,976ms
3 * * *
4 91.183.242.136 89,243ms 12,102ms 12,606ms
5 * * *
6 194.53.172.33 19,592ms 13,820ms 13,911ms
7 184.104.193.137 21,496ms 20,755ms 22,760ms
8 * * *
9 184.105.65.13 286,164ms 204,393ms 409,504ms
10 74.82.51.50 409,893ms 409,093ms 205,535ms
11 202.1.205.242 408,977ms 208,237ms 406,101ms
12 27.114.138.115 409,937ms 409,409ms 410,123ms
13 103.31.84.106 340,534ms 273,360ms *
14 * * *
15 * * *
16 103.110.109.106 289,133ms 410,090ms 229,577ms
--- 103.110.109.106 ping statistics ---
120 packets transmitted, 105 received, 12,5% packet loss, time 119255ms
rtt min/avg/max/mdev = 230.242/352.584/744.943/93.245 ms
......@@ -245,15 +245,15 @@ int checking_timer(sender_state_t *state, int socket_fd)
{
gettimeofday(&time, NULL);
// When the timer is over, we send the packet back
float retransmission = (state->stats->min_rtt > 0 ? 2 * state->stats->min_rtt : 2000);
float retransmission = (state->stats->min_rtt > 0 ? 2 * state->stats->min_rtt : TIMER_LIMIT);
retransmission += (state->stats->avg_rtt - state->stats->min_rtt)/2;
retransmission = (retransmission >= TIMER_LIMIT ? TIMER_LIMIT : retransmission);
if ((time_milliseconds(&time) - time_milliseconds(&state->timers[state->tail])) >= retransmission)
{
DEBUG("The current average rtt %lld ms, retransmitted after %f ms", state->stats->avg_rtt,retransmission);
state->stats->packet_retransmitted++;
pkt_t *pkt = state->buffer[state->tail];
DEBUG("The pkt with seqnum: %d has timeout", pkt_get_seqnum(pkt));
DEBUG("The pkt with seqnum: %d has timeout | Current retransmission delay: %f", pkt_get_seqnum(pkt), retransmission);
if (send_pkt(state, pkt, state->tail, socket_fd) == -1) return -1;
}
}
......
......@@ -9,6 +9,7 @@ GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
echo -e "${BROWN}\n**Warning** there might be some infinite loops if the sender or receiver are not properly working together${NC}"
input_files=(
'tests_files/greeting.txt'
......@@ -21,11 +22,11 @@ modes=(
'with_FEC'
)
ERROR_RATE=10
ERROR_RATE=5
CUT_RATE=5
DELAY=100
JITTER=100
LOSS_RATE=20
LOSS_RATE=15
dir="tests_logs/interop/"
......@@ -54,7 +55,7 @@ for receiver in $receivers; do
"${my_sender}_with_${receiver_name}"
if [ $? -ne 0 ]; then
echo "Tests terminated cause of a failed test"
exit 0
break 2
fi
done
let j++
......@@ -79,7 +80,7 @@ for sender in $senders; do
"${sender_name}_with_${my_receiver}"
if [ $? -ne 0 ]; then
echo "Tests terminated cause of a failed test"
exit 0
break 2
fi
done
let j++
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter