Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
project_TRTP
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Conditions générales et politique de confidentialité
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Samuel de Meester de Ravestein
project_TRTP
Validations
e4547a1c
Valider
e4547a1c
rédigé
3 years ago
par
Samuel de Meester de Ravestein
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
we're sure we use unsued port
parent
b5744fab
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
.gitignore
+1
-1
1 ajout, 1 suppression
.gitignore
tests/advanced_test.sh
+8
-3
8 ajouts, 3 suppressions
tests/advanced_test.sh
tests/simple_test.sh
+6
-2
6 ajouts, 2 suppressions
tests/simple_test.sh
avec
15 ajouts
et
6 suppressions
.gitignore
+
1
−
1
Voir le fichier @
e4547a1c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
.vscode/
.vscode/
unwanted_logs/
unwanted_logs/
log_files/
log_files/
feedback_ingi
.zip
*
.zip
linksimulator/
linksimulator/
demo.*
demo.*
interpo/
interpo/
\ No newline at end of file
Ce diff est replié.
Cliquez pour l'agrandir.
tests/advanced_test.sh
+
8
−
3
Voir le fichier @
e4547a1c
...
@@ -24,13 +24,18 @@ touch "${TEST_OUTPUT_FILES}/adv_${BSN_PRE}_received_file.${BSN_EXT}" \
...
@@ -24,13 +24,18 @@ touch "${TEST_OUTPUT_FILES}/adv_${BSN_PRE}_received_file.${BSN_EXT}" \
"
${
TEST_OUTPUT_FILES
}
/adv_valgrind_
${
BSN_PRE
}
_sender.log"
"
${
TEST_OUTPUT_FILES
}
/adv_valgrind_
${
BSN_PRE
}
_sender.log"
# The next 2 lines come from: https://unix.stackexchange.com/questions/55913/whats-the-easiest-way-to-find-an-unused-local-port
# We use this to be sure we're using unused port
port1
=
$(
comm
-23
<
(
seq
49152 65535 |
sort
)
<
(
ss
-Htan
|
awk
'{print $4}'
|
cut
-d
':'
-f2
|
sort
-u
)
|
shuf
|
head
-n
1
)
port2
=
$(
comm
-23
<
(
seq
49152 65535 |
sort
)
<
(
ss
-Htan
|
awk
'{print $4}'
|
cut
-d
':'
-f2
|
sort
-u
)
|
shuf
|
head
-n
1
)
# We first launch the link simulator
# We first launch the link simulator
./linksimulator/link_sim
-p
65027
-P
65139
-l
70
-d
1500
-e
20
-c
10
-R
\
./linksimulator/link_sim
-p
$port2
-P
$port1
-l
70
-d
1500
-e
20
-c
10
-R
\
&>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_link.log &
link_pid
=
$!
&>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_link.log &
link_pid
=
$!
# We launch the receiver and capture its output
# We launch the receiver and capture its output
valgrind
--leak-check
=
full
--log-file
=
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_valgrind_receiver.log
\
valgrind
--leak-check
=
full
--log-file
=
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_valgrind_receiver.log
\
./receiver ::1
65139
1>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_received_file.
${
BSN_EXT
}
\
./receiver ::1
$port1
1>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_received_file.
${
BSN_EXT
}
\
2>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_receiver.log &
receiver_pid
=
$!
2>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_receiver.log &
receiver_pid
=
$!
cleanup
()
cleanup
()
...
@@ -43,7 +48,7 @@ trap cleanup SIGINT # Kill the background procces in case of ^-C
...
@@ -43,7 +48,7 @@ trap cleanup SIGINT # Kill the background procces in case of ^-C
# We start the transfer
# We start the transfer
if
!
valgrind
--leak-check
=
full
--log-file
=
${
TEST_OUTPUT_FILES
}
/adv_valgrind_
${
BSN_PRE
}
_receiver.log
\
if
!
valgrind
--leak-check
=
full
--log-file
=
${
TEST_OUTPUT_FILES
}
/adv_valgrind_
${
BSN_PRE
}
_receiver.log
\
./sender
-f
${
FILENAME
}
::1
65027
2>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_sender.log
;
then
./sender
-f
${
FILENAME
}
::1
$port2
2>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_sender.log
;
then
echo
"Crash du sender!"
echo
"Crash du sender!"
cat
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_sender.log
cat
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_sender.log
err
=
1
# We record the error
err
=
1
# We record the error
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
tests/simple_test.sh
+
6
−
2
Voir le fichier @
e4547a1c
...
@@ -26,9 +26,13 @@ touch "${TEST_OUTPUT_FILES}/${BSNM_PRE}_received_file.${BSNM_EXT}" \
...
@@ -26,9 +26,13 @@ touch "${TEST_OUTPUT_FILES}/${BSNM_PRE}_received_file.${BSNM_EXT}" \
"
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_receiver.log"
"
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_receiver.log"
# The next line come from: https://unix.stackexchange.com/questions/55913/whats-the-easiest-way-to-find-an-unused-local-port
# We use this to be sure we're using unused port
port
=
$(
comm
-23
<
(
seq
49152 65535 |
sort
)
<
(
ss
-Htan
|
awk
'{print $4}'
|
cut
-d
':'
-f2
|
sort
-u
)
|
shuf
|
head
-n
1
)
# We launch the receiver and capture its output
# We launch the receiver and capture its output
valgrind
--leak-check
=
full
--log-file
=
${
TEST_OUTPUT_FILES
}
/valgrind_
${
BSNM_PRE
}
_receiver.log
\
valgrind
--leak-check
=
full
--log-file
=
${
TEST_OUTPUT_FILES
}
/valgrind_
${
BSNM_PRE
}
_receiver.log
\
./receiver ::1
65197
1>
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_received_file.
${
BSNM_EXT
}
\
./receiver ::1
$port
1>
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_received_file.
${
BSNM_EXT
}
\
2>
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_receiver.log &
receiver_pid
=
$!
2>
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_receiver.log &
receiver_pid
=
$!
cleanup
()
cleanup
()
...
@@ -41,7 +45,7 @@ trap cleanup SIGINT # Kill the background procces in case of ^-C
...
@@ -41,7 +45,7 @@ trap cleanup SIGINT # Kill the background procces in case of ^-C
# We start the transfer
# We start the transfer
if
!
valgrind
--leak-check
=
full
--log-file
=
${
TEST_OUTPUT_FILES
}
/valgrind_
${
BSNM_PRE
}
_sender.log
\
if
!
valgrind
--leak-check
=
full
--log-file
=
${
TEST_OUTPUT_FILES
}
/valgrind_
${
BSNM_PRE
}
_sender.log
\
./sender
-f
${
FILENAME
}
::1
65197
2>
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_sender.log
;
then
./sender
-f
${
FILENAME
}
::1
$port
2>
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_sender.log
;
then
echo
"The sender crashed!"
echo
"The sender crashed!"
cat
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_sender.log
cat
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_sender.log
err
=
1
# We record the error
err
=
1
# We record the error
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter