diff --git a/tests/advanced_test.sh b/tests/advanced_test.sh index 2138e327037d0ccf1b5b3a067e772b1bccf36df4..e7e6ae856c0781568f4ccfe52b3a2834d40a41f1 100755 --- a/tests/advanced_test.sh +++ b/tests/advanced_test.sh @@ -27,6 +27,17 @@ MODES=( 'without_FEC' ) +ERROR_RATE=20 +CUT_RATE=30 +DELAY=0 +JITTER=0 +LOSS_RATE=25 + +echo -e "The linksimulator paramateres are: + \t\t-ERROR RATE: ${ERROR_RATE}% \t-DELAY: ${DELAY}ms + \t\t-CUT RATE: ${CUT_RATE}% \t-JITTER: ${JITTER}ms + \t\t-LOSS RATE: ${LOSS_RATE}%\n" + for MODE in "${MODES[@]}"; do mkdir "${TEST_OUTPUT_FILES}/${MODE}/" 2>/dev/null @@ -45,11 +56,12 @@ for MODE in "${MODES[@]}"; do port1=$(comm -23 <(seq 65000 65200 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 1) port2=$(comm -23 <(seq 65000 65200 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 1) - # We first launch the link simulator - ./linksimulator/link_sim -p $port2 -P $port1 -l 25 -d 0 -e 20 -c 30 \ + + ##### Launching the link simulator ##### + ./linksimulator/link_sim -p $port2 -P $port1 -l $LOSS_RATE -d $DELAY -e $ERROR_RATE -c $CUT_RATE -j $JITTER \ &>${DIR}/adv_${BSN_PRE}_link.log & link_pid=$! - # We launch the receiver and capture its output + ##### Launching the receiver and capturinig its output ##### valgrind --leak-check=full --log-file=${DIR}/adv_valgrind_${BSN_PRE}_receiver.log \ ./receiver ::1 $port1 -s ${DIR}/${BSN_PRE}_receiver_stats.csv 1> ${DIR}/adv_${BSN_PRE}_received_file.${BSN_EXT} \ 2> ${DIR}/adv_${BSN_PRE}_receiver.log & receiver_pid=$! diff --git a/tests/run_tests.sh b/tests/run_tests.sh index ca2d764aad0c696d1417f662e54745e3bac11958..cd2aee5490f33d315901edd3646a7c70873bd2ad 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -1,5 +1,8 @@ #!/bin/bash +BROWN='\033[0;33m' +NC='\033[0m' + # Note that this assumes to be called from the Makefile, you may want to adapt it. FILESIZE="" TEST_FILES_DIR=./tests_files/ @@ -19,7 +22,7 @@ fi #for FILENAME in "$TEST_FILES_DIR"/* #do # FILESIZE=$(stat -c%s "$FILENAME") -# echo -e "Sending $FILENAME \t\t [$FILESIZE bytes], \t\t with Valgrind" +# echo -e "${BROWN}Sending \"$FILENAME\" \t[$FILESIZE bytes] with Valgrind${NC}" # ./tests/simple_test.sh $FILENAME # if [ $? -ne 0 ]; then @@ -36,7 +39,7 @@ if [ -d linksimulator/ ]; then for FILENAME in "$TEST_FILES_DIR"/* do FILESIZE=$(stat -c%s "$FILENAME") - echo -e "Sending $FILENAME \t\t [$FILESIZE bytes], \t\t with linksimulator and Valgrind" + echo -e "\n${BROWN}Sending the file \"$FILENAME\" \t[$FILESIZE bytes] with linksimulator and Valgrind${NC}" ./tests/advanced_test.sh $FILENAME if [ $? -ne 0 ]; then