Automation scripts
[o-du/l2.git] / build / scripts / start_gnb.sh
1 ################################################################################
2 #   Copyright (c) [2020] [Radisys]                                             #
3 #                                                                              #
4 #   Licensed under the Apache License, Version 2.0 (the "License");            #
5 #   you may not use this file except in compliance with the License.           #
6 #   You may obtain a copy of the License at                                    #
7 #                                                                              #
8 #       http://www.apache.org/licenses/LICENSE-2.0                             #
9 #                                                                              #
10 #   Unless required by applicable law or agreed to in writing, software        #
11 #   distributed under the License is distributed on an "AS IS" BASIS,          #
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
13 #   See the License for the specific language governing permissions and        #
14 #   limitations under the License.                                             #
15 ################################################################################
16 # This script is used to build and execute ODU-High and test stubs
17 #!/bin/bash
18
19 CURRENT_DIR=$PWD
20 ROOT_DIR=$CURRENT_DIR/../../
21
22 echo ""
23 cd $ROOT_DIR/build/odu
24 make clean_all
25 echo "***** Building O-DU Binary *****"
26 make odu MACHINE=BIT64 MODE=FDD
27 echo ""
28 echo "***** Building CU Stub Binary *****"
29 make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
30 echo ""
31 echo "***** Building RIC Stub Binary *****"
32 make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
33
34 echo ""
35 echo "***** Assigning IP addresses *****"
36 INTERFACE=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
37 INTERFACE="$(echo -e "${INTERFACE}" | tr -d '[:space:]')"
38 ifconfig $INTERFACE:ODU "192.168.130.81"
39 ifconfig $INTERFACE:CU_STUB "192.168.130.82"
40 ifconfig $INTERFACE:RIC_STUB "192.168.130.80"
41
42 xterm -hold -e "cd $ROOT_DIR/bin/cu_stub; chmod 777 *; ./start_cu_stub_logging.sh && ./cu_stub" &
43 sleep 2
44 xterm -hold -e "cd $ROOT_DIR/bin/ric_stub; chmod 777 *; ./start_ric_stub_logging.sh && ./ric_stub" &
45 sleep 2
46 xterm -hold -e "cd $ROOT_DIR/bin/odu; chmod 777 *; ./start_du_logging.sh && ./odu" &
47
48 ################################################################################
49 #                              End of file                                     #
50 ################################################################################