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
b5744fab
Valider
b5744fab
rédigé
3 years ago
par
Samuel de Meester de Ravestein
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
tests: translation french to english
parent
47019c1e
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
tests/advanced_test.sh
+13
-13
13 ajouts, 13 suppressions
tests/advanced_test.sh
tests/run_tests.sh
+1
-1
1 ajout, 1 suppression
tests/run_tests.sh
tests/simple_test.sh
+7
-7
7 ajouts, 7 suppressions
tests/simple_test.sh
avec
21 ajouts
et
21 suppressions
tests/advanced_test.sh
+
13
−
13
Voir le fichier @
b5744fab
...
...
@@ -13,7 +13,7 @@ TEST_OUTPUT_FILES="unwanted_logs/advanced_tests/${BSN_PRE}"
GREEN
=
'\033[0;32m'
NC
=
'\033[0m'
#
i
f the directory does not exist, we create it
#
I
f the directory does not exist, we create it
if
[
!
-d
"unwanted_logs/advanced_tests/"
]
;
then
mkdir
'unwanted_logs/advanced_tests/'
2>/dev/null
fi
...
...
@@ -28,7 +28,7 @@ touch "${TEST_OUTPUT_FILES}/adv_${BSN_PRE}_received_file.${BSN_EXT}" \
./linksimulator/link_sim
-p
65027
-P
65139
-l
70
-d
1500
-e
20
-c
10
-R
\
&>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_link.log &
link_pid
=
$!
#
On
lanc
e l
e receiver
et
capture
sa sortie standard
#
We
la
u
nc
h th
e receiver
and
capture
its output
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
}
\
2>
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_receiver.log &
receiver_pid
=
$!
...
...
@@ -39,25 +39,25 @@ cleanup()
kill
-9
$link_pid
exit
0
}
trap
cleanup SIGINT
# Kill
les process en arrière plan e
n cas
de
^-C
trap
cleanup SIGINT
# Kill
the background procces i
n cas
e of
^-C
#
On démarre l
e transfer
t
#
We start th
e transfer
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
echo
"Crash du sender!"
cat
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_sender.log
err
=
1
#
On enregistre l'
err
eu
r
err
=
1
#
We record the
err
o
r
fi
sleep
5
#
On attend 5 seconde que l
e receiver finis
se
sleep
5
#
We wait 5s for th
e receiver
to
finis
h up
if
kill
-0
$receiver_pid
&> /dev/null
;
then
echo
"
L
e receiver
ne s'est pas arreté à la fin du
transfer
t
!"
echo
"
Th
e receiver
didn't stop at the end of the
transfer!"
kill
-9
$receiver_pid
err
=
1
else
#
On teste la valeur de retour du
receiver
else
#
We check the return value of the
receiver
if
!
wait
$receiver_pid
;
then
echo
"Crash
du
receiver!"
echo
"Crash
of the
receiver!"
cat
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_receiver.log
err
=
1
fi
...
...
@@ -67,13 +67,13 @@ fi
kill
-9
$link_pid
wait
$link_pid
2>/dev/null
#
On
v
é
rif
ie que l
e transfer
t s'est bien déroulé
#
We
v
e
rif
y that th
e transfer
ran through properly
if
[[
"
$(
md5sum
${
FILENAME
}
|
awk
'{print $1}'
)
"
!=
"
$(
md5sum
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_received_file.
${
BSN_EXT
}
|
awk
'{print $1}'
)
"
]]
;
then
echo
"
L
e transfer
t a
corr
ompu le fichier
!"
echo
"
Diff binaire des deux fichiers: (attendu vs produit
)"
echo
"
Th
e transfer corr
upted the file
!"
echo
"
Binary difference between the 2 files: (expected vs actual
)"
diff
-C
9 <
(
od
-Ax
-t
x1z
${
FILENAME
}
)
<
(
od
-Ax
-t
x1z
${
TEST_OUTPUT_FILES
}
/adv_
${
BSN_PRE
}
_received_file.
${
BSN_EXT
}
)
exit
1
else
echo
-e
"
${
GREEN
}
The transfer has succeeded!
${
NC
}
"
exit
${
err
:-
0
}
#
E
n cas
d'erreurs avant, on renvoie le code d'erreur
exit
${
err
:-
0
}
#
I
n cas
e of error, we return the error code
fi
\ No newline at end of file
Ce diff est replié.
Cliquez pour l'agrandir.
tests/run_tests.sh
+
1
−
1
Voir le fichier @
b5744fab
...
...
@@ -25,7 +25,7 @@ echo -e "Finished Simple tests."
if
[
-d
linksimulator/
]
;
then
echo
-e
"
\n
Starting advanced tests ...
\n
"
# Now we ran advnced tests
# Now we ran
the
adv
a
nced tests
for
FILENAME
in
"
$TEST_FILES_DIR
"
/
*
do
FILESIZE
=
$(
stat
-c
%s
"
$FILENAME
"
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
tests/simple_test.sh
+
7
−
7
Voir le fichier @
b5744fab
...
...
@@ -13,7 +13,7 @@ TEST_OUTPUT_FILES="unwanted_logs/simple_tests/${BSNM_PRE}"
GREEN
=
'\033[0;32m'
NC
=
'\033[0m'
#
i
f the directory does not exist, we create it
#
I
f the directory does not exist, we create it
if
[
!
-d
"unwanted_logs/simple_tests/"
]
;
then
mkdir
'unwanted_logs/simple_tests/'
2>/dev/null
fi
...
...
@@ -26,7 +26,7 @@ touch "${TEST_OUTPUT_FILES}/${BSNM_PRE}_received_file.${BSNM_EXT}" \
"
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_receiver.log"
#
On
lanc
e l
e receiver
et
capture
sa sortie standard
#
We
la
u
nc
h th
e receiver
and
capture
its output
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
}
\
2>
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_receiver.log &
receiver_pid
=
$!
...
...
@@ -37,20 +37,20 @@ cleanup()
kill
-9
$link_pid
exit
0
}
trap
cleanup SIGINT
# Kill
les process en arrière plan e
n cas
de
^-C
trap
cleanup SIGINT
# Kill
the background procces i
n cas
e of
^-C
# We start the transfer
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
echo
"The sender crashed!"
cat
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_sender.log
err
=
1
#
On enregistre l'
err
eu
r
err
=
1
#
We record the
err
o
r
fi
sleep
5
#
On attend 5 seconde que l
e receiver finis
se
sleep
5
#
We wait 5s for th
e receiver
to
finis
h up
if
kill
-0
$receiver_pid
&> /dev/null
;
then
echo
"
L
e receiver
ne s'est pas arreté à la fin du
transfer
t
!"
echo
"
Th
e receiver
didn't stop at the end of the
transfer!"
kill
-9
$receiver_pid
err
=
1
else
# We check the return value of the receiver
...
...
@@ -64,7 +64,7 @@ fi
# We check that the transfer ran through properly
if
[[
"
$(
md5sum
${
FILENAME
}
|
awk
'{print $1}'
)
"
!=
"
$(
md5sum
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_received_file.
${
BSNM_EXT
}
|
awk
'{print $1}'
)
"
]]
;
then
echo
"The transfer has corrupted the file!"
echo
"
Diff binaire des deux fichiers: (attendu vs produit
)"
echo
"
Binary difference between the 2 files: (expected vs actual
)"
diff
-C
9 <
(
od
-Ax
-t
x1z
${
FILENAME
}
)
<
(
od
-Ax
-t
x1z
${
TEST_OUTPUT_FILES
}
/
${
BSNM_PRE
}
_received_file.
${
BSNM_EXT
}
)
exit
1
else
...
...
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