Commit 0fc74c8b authored by gauthier's avatar gauthier

Bug fixes

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5033 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 76165828
......@@ -50,6 +50,45 @@ test_command_install_package "ip" "iproute"
test_command_install_package "tunctl" "uml-utilities"
test_command_install_lib "/usr/lib/libconfig.so" "libconfig-dev"
#######################################################
# FIND CONFIG FILE
#######################################################
CONFIG_FILE=$THIS_SCRIPT_PATH/CONF/enb.sfr.default.vlan.conf
SEARCHED_CONFIG_FILE=$THIS_SCRIPT_PATH/CONF/enb.sfr."$HOSTNAME".vlan.conf
if [ -f $SEARCHED_CONFIG_FILE ]; then
CONFIG_FILE=$SEARCHED_CONFIG_FILE
echo_warning "config file found is now $CONFIG_FILE"
else
echo_warning "config file $SEARCHED_CONFIG_FILE for host $HOSTNAME not found, trying default: $CONFIG_FILE"
if [ -f $CONFIG_FILE ]; then
echo_success "Default config file found: $CONFIG_FILE"
else
echo_error "Default config file not found, exiting"
exit 1
fi
fi
#######################################################
# SOURCE CONFIG FILE
#######################################################
rm -f /tmp/source.txt
VARIABLES="
ENB_INTERFACE_NAME_FOR_S1_MME\|\
ENB_IPV4_ADDRESS_FOR_S1_MME\|\
ENB_INTERFACE_NAME_FOR_S1U\|\
ENB_IPV4_ADDRESS_FOR_S1U"
VARIABLES=$(echo $VARIABLES | sed -e 's/\\r//g')
VARIABLES=$(echo $VARIABLES | tr -d ' ')
cat $CONFIG_FILE | grep -w "$VARIABLES"| tr -d " " | tr -d ";" > /tmp/source.txt
source /tmp/source.txt
declare ENB_IPV4_NETMASK_FOR_S1_MME=$( echo $ENB_IPV4_ADDRESS_FOR_S1_MME | cut -f2 -d '/')
declare ENB_IPV4_NETMASK_FOR_S1U=$( echo $ENB_IPV4_ADDRESS_FOR_S1U | cut -f2 -d '/')
ENB_IPV4_ADDRESS_FOR_S1_MME=$( echo $ENB_IPV4_ADDRESS_FOR_S1_MME | cut -f1 -d '/')
ENB_IPV4_ADDRESS_FOR_S1U=$( echo $ENB_IPV4_ADDRESS_FOR_S1U | cut -f1 -d '/')
#######################################################
# USIM, NVRAM files
......@@ -76,7 +115,9 @@ fi
# NETWORK TOPOLOGY
##################################################
clean_enb_vlan_network
echo_success "clean_enb_vlan_network Done"
build_enb_vlan_network
echo_success "build_enb_vlan_network Done"
test_enb_vlan_network
##################################################
......@@ -125,23 +166,6 @@ ITTI_LOG_FILE=/tmp/itti_enb.$HOSTNAME.log
rotate_log_file $ITTI_LOG_FILE
#######################################################
# FIND CONFIG FILE
#######################################################
CONFIG_FILE=$THIS_SCRIPT_PATH/CONF/enb.sfr.default_vlan.conf
SEARCHED_CONFIG_FILE=$THIS_SCRIPT_PATH/CONF/enb.sfr."$HOSTNAME"_vlan.conf
if [ -f $SEARCHED_CONFIG_FILE ]; then
CONFIG_FILE=$SEARCHED_CONFIG_FILE
echo_warning "config file found is now $CONFIG_FILE"
else
echo_warning "config file $SEARCHED_CONFIG_FILE for host $HOSTNAME not found, trying default: $CONFIG_FILE"
if [ -f $CONFIG_FILE ]; then
echo_success "Default config file found: $CONFIG_FILE"
else
echo_error "Default config file not found, exiting"
exit 1
fi
fi
gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -u1 -l7 -K $ITTI_LOG_FILE --enb-conf $CONFIG_FILE
......
......@@ -324,6 +324,9 @@ check_for_root_rights() {
}
is_openvswitch_interface() {
if [ "a$1" == "a" ]; then
return 0
fi
if [ "a${1:0:3}" == "aeth" ]; then
return 0;
else
......@@ -339,6 +342,9 @@ is_openvswitch_interface() {
}
is_real_interface() {
if [ "a$1" == "a" ]; then
return 0
fi
IF=`cat /etc/udev/rules.d/70-persistent-net.rules | grep $1 | sed 's/^.*NAME=//' | tr -d '"'`
if [ "$IF" == "$1" ]; then
if [ "a${1:0:3}" == "aeth" ]; then
......@@ -379,7 +385,7 @@ build_enb_vlan_network() {
ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME.1 down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1_MME.1 > /dev/null 2>&1
sync
bash_exec "vconfig add ENB_INTERFACE_NAME_FOR_S1_MME 1"
bash_exec "vconfig add $ENB_INTERFACE_NAME_FOR_S1_MME 1"
sync
bash_exec "ip -4 addr add $ENB_IPV4_ADDRESS_FOR_S1_MME dev $ENB_INTERFACE_NAME_FOR_S1_MME.1"
else
......@@ -391,7 +397,7 @@ build_enb_vlan_network() {
ifconfig $ENB_INTERFACE_NAME_FOR_S1U.2 down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1U.2 > /dev/null 2>&1
sync
bash_exec "vconfig add ENB_INTERFACE_NAME_FOR_S1U 2"
bash_exec "vconfig add $ENB_INTERFACE_NAME_FOR_S1U 2"
sync
bash_exec "ip -4 addr add $ENB_IPV4_ADDRESS_FOR_S1U dev $ENB_INTERFACE_NAME_FOR_S1U".2
sync
......
Markdown is supported
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