Commit 2531c40a authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in AtsGeoNetworking: Some tests cases were missing

parent e6963d54
......@@ -59,12 +59,12 @@ pcap_layer::pcap_layer(const std::string& p_type, const std::string& param)
bpf_u_int32 net, mask; // ip address and subnet mask
if (pcap_lookupnet(nic.c_str(), &net, &mask, error_buffer) != 0) {
loggers::get_instance().error("pcap_layer::pcap_layer: Failed to fetch newtork address for device %s", nic.c_str());
}else{
} else {
loggers::get_instance().log("pcap_layer::pcap_layer: Device %s Network address: %d", nic.c_str(), net);
}
}
// Open the device in promiscuous mode
_device = pcap_open_live(nic.c_str(), 65535, 1, 100, error_buffer); // TODO Replace hard coded values by pcap_layer::<constants>
_device = pcap_open_live(nic.c_str(), 65535/*64*1024*/, 1, 100, error_buffer); // TODO Replace hard coded values by pcap_layer::<constants>
if (_device == NULL) {
loggers::get_instance().error("pcap_layer::pcap_layer: Failed to open device %s", nic.c_str());
return;
......@@ -73,7 +73,7 @@ pcap_layer::pcap_layer(const std::string& p_type, const std::string& param)
if (pcap_setnonblock(_device, 1, error_buffer) != 0) {
loggers::get_instance().error("pcap_layer::pcap_layer: Failed to set blocking mode: %s", error_buffer);
}
// Retrieve the device file handler
// Retrieve the device file handler
_pcap_h = pcap_get_selectable_fd(_device);
if (_pcap_h == -1) {
loggers::get_instance().error("pcap_layer::pcap_layer: Failed to get device handler");
......@@ -85,14 +85,14 @@ pcap_layer::pcap_layer(const std::string& p_type, const std::string& param)
it = _params.find(params::mac_src);
if (it != _params.end()) { // Use online capture
mac_src = it->second;
} else{
// detect MAC address of NIC
} else {
// Detect MAC address of NIC
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
nic.copy(ifr.ifr_name, sizeof(ifr.ifr_name));
if (ioctl(_pcap_h, SIOCGIFHWADDR, &ifr) == -1) {
loggers::get_instance().error("pcap_layer::pcap_layer: Failed to get device MAC address");
}else{
} else {
char buf[13];
*_bin2hex(buf, sizeof(buf), ifr.ifr_hwaddr.sa_data, 6) = 0;
mac_src = buf;
......
......@@ -18,7 +18,8 @@ USER etsi
RUN cd ${HOME} \
&& export PATH=$HOME/bin:$PATH \
&& ls ${HOME}/etc/init.d/*.sh | while read S; do /bin/bash -c "$S" || exit 1; done
&& ls ${HOME}/etc/init.d/*.sh | while read S; do /bin/bash -c "$S" || exit 1; done \
&& rm -fr ${HOME}/etc
CMD ["/bin/bash"]
......
......@@ -5,8 +5,8 @@
set -e
set -vx
# Temporary: Remove STF525 image
docker image rm --force stf525_its
# Temporary: Remove TTF002 image
docker image rm --force ttf002_its
#check and build stfubuntu image
if [ -z `docker images -q stfubuntu` ]; then
......
......@@ -14,9 +14,6 @@ export PATH=$PATH:$TTCN3_DIR/bin
mkdir -p "$SRC_DIR"
cd "$SRC_DIR/.." || exit 1
echo "export TTCN3_DIR=$TTCN3_DIR" >> $HOME/.bashrc
echo "export PATH=\$PATH:\$TTCN3_DIR/bin" >> $HOME/.bashrc
# Install titan core
git clone --progress "$TITAN_REPO" || exit 1
......@@ -32,6 +29,14 @@ EOF
make && make install || exit 1
# To be compiant with build_ttcn3.bash
# TODO Refactor build_ttcn3.bash & devenv.bash
mv ${TTCN3_DIR} ${SRC_DIR}
export TTCN3_DIR=${SRC_DIR}/Install
echo "export TTCN3_DIR=$TTCN3_DIR" >> $HOME/.bashrc
echo "export PATH=\$PATH:\$TTCN3_DIR/bin" >> $HOME/.bashrc
# Install other repos
cd $SRC_DIR/.. || exit 1
cat ${HOME}/etc/titan_repos.txt | grep -v -e '^\s*#' -e 'titan\.core' | while read REPO; do
......@@ -42,4 +47,4 @@ cat ${HOME}/etc/titan_repos.txt | grep -v -e '^\s*#' -e 'titan\.core' | while re
fi
done
exit 0
cd $HOME
......@@ -20,5 +20,3 @@ if wget --progress=dot:mega 'https://www.eclipse.org/downloads/download.php?file
fi
cd ${HOME}
exit 0
#!/bin/bash
#set -e
set -vx
echo -e "*****************************\n* Install ioppytest-utils\n*****************************\n"
cd ${HOME}/frameworks
git clone https://github.com/fsismondi/ioppytest-utils ./ioppytest-utils
cd ./ioppytest-utils
pip3 install -r ./requirements.txt
cd ${HOME}
exit 0
#!/bin/bash
# Copyright ETSI 2018
# Copyright ETSI 2018-2020
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -e
......
......@@ -22,7 +22,7 @@ SRC_ITS_PATH=${HOME}/dev/TTF0002_Its
if [ "${PATH_DEV_ITS}" == "" ]
then
PATH_DEV_ITS=`pwd`/../etsi_its
PATH_DEV_ITS=${HOME}/dev/etsi_its
fi
echo ${PATH_DEV_ITS}
......
/**
* @author ETSI / STF405 / STF449 / STF484
* @version $Url$
* @version $URL$
* $Id$
* @desc Test Control file for GeoNetworking
* @copyright ETSI Copyright Notification
......@@ -172,8 +172,8 @@ module ItsGeoNetworking_TestControl {
}
if(PICS_GN_LS_FWD) {
execute(TC_GEONW_PON_LOS_BV_10());
execute(TC_GEONW_PON_LOS_BV_11());
execute(TC_GEONW_PON_LOS_BV_10());
execute(TC_GEONW_PON_LOS_BV_11());
}
if(PICS_GN_LS_REQ_SRC) {
......@@ -229,19 +229,19 @@ module ItsGeoNetworking_TestControl {
}
if(PICS_GN_GUC_SRC) {
execute(TC_GEONW_PON_FPB_BV_12_01());
execute(TC_GEONW_PON_FPB_BV_12_01());
}
if(PICS_GN_GAC_SRC) {
execute(TC_GEONW_PON_FPB_BV_12_02());
execute(TC_GEONW_PON_FPB_BV_12_02());
}
if(PICS_GN_GBC_SRC) {
execute(TC_GEONW_PON_FPB_BV_12_03());
execute(TC_GEONW_PON_FPB_BV_12_03());
}
if(PICS_GN_TSB_SRC) {
execute(TC_GEONW_PON_FPB_BV_12_04());
execute(TC_GEONW_PON_FPB_BV_12_04());
}
/* PON/GNA */
......@@ -264,166 +264,214 @@ module ItsGeoNetworking_TestControl {
}
/* PON/GUC */
if(PICS_GN_GUC) {
if(PICS_GN_GUC_SRC) {
if ((PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GUC_BV_01());
if(PICS_GN_GUC_FWD) {
execute(TC_GEONW_PON_GUC_ALL_BV_03());
execute(TC_GEONW_PON_GUC_ALL_BO_04());
execute(TC_GEONW_PON_GUC_ALL_BV_06());
}
if (PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_cbf) {
execute(TC_GEONW_PON_GUC_BV_11());
if(PICS_GN_GUC_DST) {
execute(TC_GEONW_PON_GUC_ALL_BV_05());
execute(TC_GEONW_PON_GUC_ALL_BO_08());
}
}
if(PICS_GN_GUC_FWD) {
if ((PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GUC_BV_02());
if((PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_unspecified)) {
if(PICS_GN_GUC_SRC) {
execute(TC_GEONW_PON_GUC_GRD_BV_01());
}
if(PICS_GN_GUC_FWD) {
execute(TC_GEONW_PON_GUC_GRD_BV_02());
execute(TC_GEONW_PON_GUC_GRD_BO_07());
}
}
execute(TC_GEONW_PON_GUC_BV_03());
execute(TC_GEONW_PON_GUC_BO_04());
if(PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf) {
if (PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_cbf) {
execute(TC_GEONW_PON_GUC_BV_06());
execute(TC_GEONW_PON_GUC_BV_07());
execute(TC_GEONW_PON_GUC_BV_08());
execute(TC_GEONW_PON_GUC_BV_10());
}
if(PICS_GN_GUC_SRC) {
execute(TC_GEONW_PON_GUC_CBF_BV_01());
}
if ((PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GUC_BO_12());
if(PICS_GN_GUC_FWD) {
execute(TC_GEONW_PON_GUC_CBF_BV_02());
execute(TC_GEONW_PON_GUC_CBF_BV_07());
execute(TC_GEONW_PON_GUC_CBF_BV_20());
execute(TC_GEONW_PON_GUC_CBF_BV_21());
execute(TC_GEONW_PON_GUC_CBF_BV_22());
}
}
}
if(PICS_GN_GUC_DST) {
execute(TC_GEONW_PON_GUC_BV_05());
if ((PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GUC_BO_13());
}
}
/* PON/GBC */
if(PICS_GN_GBC_SRC) {
execute(TC_GEONW_PON_GBC_BV_01());
if ((PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_simple) or (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_unspecified) or (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_advanced)) {
execute(TC_GEONW_PON_GBC_BV_02());
}
if ((PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_simple) or (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GBC_BV_03());
}
if (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_cbf) {
execute(TC_GEONW_PON_GBC_BV_12());
if(PICS_GN_GBC) {
if(PICS_GN_GBC_FWD) {
execute(TC_GEONW_PON_GBC_NONAREA_ALL_BV_03());
execute(TC_GEONW_PON_GBC_NONAREA_ALL_BV_04());
execute(TC_GEONW_PON_GBC_NONAREA_ALL_BV_06());
execute(TC_GEONW_PON_GBC_NONAREA_ALL_BO_09());
execute(TC_GEONW_PON_GBC_NONAREA_ALL_BO_10());
}
if((PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_unspecified)) {
if(PICS_GN_GBC_SRC) {
execute(TC_GEONW_PON_GBC_NONAREA_GRD_BV_01());
}
if(PICS_GN_GBC_FWD) {
execute(TC_GEONW_PON_GBC_NONAREA_GRD_BV_02());
execute(TC_GEONW_PON_GBC_NONAREA_GRD_BO_07());
}
}
}
if(PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf) {
if(PICS_GN_GBC_SRC) {
execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_01());
}
if(PICS_GN_GBC_FWD) {
if ((PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_simple) or (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GBC_BO_04());
}
execute(TC_GEONW_PON_GBC_BV_05());
if ((PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_simple) or (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GBC_BO_06());
if(PICS_GN_GBC_FWD) {
execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_02());
execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_07());
execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_20());
execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_21());
execute(TC_GEONW_PON_GBC_NONAREA_CBF_BV_22());
}
}
if(PICS_GN_GBC_SRC) {
execute(TC_GEONW_PON_GBC_AREA_ALL_BV_01());
}
if(PICS_GN_GBC_FWD) {
execute(TC_GEONW_PON_GBC_AREA_ALL_BV_03());
execute(TC_GEONW_PON_GBC_AREA_ALL_BV_04());
}
execute(TC_GEONW_PON_GBC_BV_07());
execute(TC_GEONW_PON_GBC_BV_08());
execute(TC_GEONW_PON_GBC_BV_11());
execute(TC_GEONW_PON_GBC_BO_19());
execute(TC_GEONW_PON_GBC_BV_20());
execute(TC_GEONW_PON_GBC_BV_21());
}
if(PICS_GN_GBC_DST) {
execute(TC_GEONW_PON_GBC_BV_09());
if ((PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_simple) or (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GBC_BO_10());
if(PICS_GN_GBC_DST) {
execute(TC_GEONW_PON_GBC_AREA_ALL_BV_05());
execute(TC_GEONW_PON_GBC_AREA_ALL_BO_08());
}
if((PICS_GN_AREA_FORWARDING_ALGORITHM == e_simple) or (PICS_GN_AREA_FORWARDING_ALGORITHM == e_unspecified)) {
if(PICS_GN_GBC_FWD) {
execute(TC_GEONW_PON_GBC_AREA_SMP_BV_02());
execute(TC_GEONW_PON_GBC_AREA_SMP_BO_07());
}
}
if(PICS_GN_AREA_FORWARDING_ALGORITHM == e_cbf) {
if(PICS_GN_GBC_FWD) {
execute(TC_GEONW_PON_GBC_AREA_CBF_BV_02());
execute(TC_GEONW_PON_GBC_AREA_CBF_BV_07());
execute(TC_GEONW_PON_GBC_AREA_CBF_BV_21());
execute(TC_GEONW_PON_GBC_AREA_CBF_BV_22());
}
}
if(PICS_GN_AREA_FORWARDING_ALGORITHM == e_advanced) {
if(PICS_GN_GBC_FWD) {
execute(TC_GEONW_PON_GBC_AREA_ADV_BV_21());
execute(TC_GEONW_PON_GBC_AREA_ADV_BV_23());
execute(TC_GEONW_PON_GBC_AREA_ADV_BV_24());
execute(TC_GEONW_PON_GBC_AREA_ADV_BV_25());
execute(TC_GEONW_PON_GBC_AREA_ADV_BV_26());
execute(TC_GEONW_PON_GBC_AREA_ADV_BV_27());
execute(TC_GEONW_PON_GBC_AREA_ADV_BV_28());
execute(TC_GEONW_PON_GBC_AREA_ADV_BV_29());
}
}
}
/* PON/TSB */
if(PICS_GN_TSB_SRC) {
execute(TC_GEONW_PON_TSB_BV_01());
}
if(PICS_GN_TSB_FWD) {
execute(TC_GEONW_PON_TSB_BV_02());
execute(TC_GEONW_PON_TSB_BO_03());
execute(TC_GEONW_PON_TSB_BV_04());
execute(TC_GEONW_PON_TSB_BO_05());
}
if(PICS_GN_TSB_DST) {
execute(TC_GEONW_PON_TSB_BV_06());
execute(TC_GEONW_PON_TSB_BO_07());
}
if(PICS_GN_TSB) {
if(PICS_GN_TSB_SRC) {
execute(TC_GEONW_PON_TSB_BV_01());
}
if(PICS_GN_TSB_FWD) {
execute(TC_GEONW_PON_TSB_BV_02());
execute(TC_GEONW_PON_TSB_BV_03());
execute(TC_GEONW_PON_TSB_BO_04());
execute(TC_GEONW_PON_TSB_BO_07());
}
if(PICS_GN_TSB_DST) {
execute(TC_GEONW_PON_TSB_BV_05());
execute(TC_GEONW_PON_TSB_BO_08());
}
}
/* PON/SHB */
if(PICS_GN_SHB) {
if(PICS_GN_SHB_SRC) {
execute(TC_GEONW_PON_SHB_BV_01());
}
if(PICS_GN_SHB_DST) {
execute(TC_GEONW_PON_SHB_BV_02());
}
if(PICS_GN_SHB_SRC) {
execute(TC_GEONW_PON_SHB_BV_01());
}
if(PICS_GN_SHB_DST) {
execute(TC_GEONW_PON_SHB_BV_05());
}
}
/* PON/GAC */
if(PICS_GN_GAC) {
if(PICS_GN_GAC_SRC) {
execute(TC_GEONW_PON_GAC_BV_01());
if ((PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_simple) or (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_unspecified)) {
execute(TC_GEONW_PON_GAC_BV_02());
}
if (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_cbf) {
execute(TC_GEONW_PON_GAC_BV_13());
if(PICS_GN_GAC_FWD) {
execute(TC_GEONW_PON_GAC_NONAREA_ALL_BV_03());
execute(TC_GEONW_PON_GAC_NONAREA_ALL_BO_04());
execute(TC_GEONW_PON_GAC_NONAREA_ALL_BV_06());
execute(TC_GEONW_PON_GAC_NONAREA_ALL_BO_09());
execute(TC_GEONW_PON_GAC_NONAREA_ALL_BV_10());
}
}
if(PICS_GN_GAC_FWD) {
execute(TC_GEONW_PON_GAC_BV_03());
execute(TC_GEONW_PON_GAC_BV_04());
execute(TC_GEONW_PON_GAC_BO_05());
execute(TC_GEONW_PON_GAC_BV_06());
execute(TC_GEONW_PON_GAC_BO_07());
execute(TC_GEONW_PON_GAC_BO_11());
}
if((PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_greedy) or (PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_unspecified)) {
if(PICS_GN_GAC_SRC) {
execute(TC_GEONW_PON_GAC_NONAREA_GRD_BV_01());
}
if(PICS_GN_GAC_DST) {
execute(TC_GEONW_PON_GAC_BV_08());
execute(TC_GEONW_PON_GAC_BO_09());
execute(TC_GEONW_PON_GAC_BV_10());
}
if(PICS_GN_GAC_FWD) {
execute(TC_GEONW_PON_GAC_NONAREA_GRD_BV_02());
execute(TC_GEONW_PON_GAC_NONAREA_GRD_BO_07());
}
}
/* PON/BCA */
if(PICS_GN_NON_AREA_FORWARDING_ALGORITHM == e_cbf) {
if(PICS_GN_GBC_FWD) {
if (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_cbf) {
execute(TC_GEONW_PON_BCA_BV_01());
execute(TC_GEONW_PON_BCA_BV_02());
execute(TC_GEONW_PON_BCA_BV_03());
execute(TC_GEONW_PON_BCA_BO_04());
execute(TC_GEONW_PON_BCA_BV_05());
execute(TC_GEONW_PON_BCA_BV_06());
execute(TC_GEONW_PON_BCA_BV_07());
execute(TC_GEONW_PON_BCA_BV_08());
if(PICS_GN_GAC_SRC) {
execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_01());
}
if(PICS_GN_GAC_FWD) {
execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_02());
execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_07());
execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_20());
execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_21());
execute(TC_GEONW_PON_GAC_NONAREA_CBF_BV_22());
}
}
if(PICS_GN_GAC_SRC) {
execute(TC_GEONW_PON_GAC_AREA_ALL_BV_01());
}
}
/* PON/BAA */
if(PICS_GN_GAC_FWD) {
execute(TC_GEONW_PON_GAC_AREA_ALL_BV_02());
}
if(PICS_GN_GBC_FWD) {
if (PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_advanced) {
execute(TC_GEONW_PON_BAA_BV_01());
execute(TC_GEONW_PON_BAA_BV_02());
execute(TC_GEONW_PON_BAA_BV_03());
execute(TC_GEONW_PON_BAA_BV_04());
execute(TC_GEONW_PON_BAA_BV_05());
execute(TC_GEONW_PON_BAA_BV_06());
execute(TC_GEONW_PON_BAA_BV_07());
execute(TC_GEONW_PON_BAA_BO_08());
execute(TC_GEONW_PON_BAA_BV_09());
execute(TC_GEONW_PON_BAA_BV_10());
execute(TC_GEONW_PON_BAA_BV_11());
if(PICS_GN_GAC_DST) {
execute(TC_GEONW_PON_GAC_AREA_ALL_BV_05());
execute(TC_GEONW_PON_GAC_AREA_ALL_BO_08());
}
}
......@@ -443,4 +491,4 @@ module ItsGeoNetworking_TestControl {
}
} // end ItsGeoNetworking_TestControl
} // End of module ItsGeoNetworking_TestControl
Subproject commit be2e85fb3d600a9dff37b163ef8943722589f192
Subproject commit 26b8f58bf5d2d4a09b9e63061a6d871a927f8985
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment