Open5gs: Compile

From OnnoWiki
Revision as of 08:59, 22 July 2023 by Onnowpurbo (talk | contribs) (→‎Git clone)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sistem Operasi Ubuntu 22.04

Install MongoDB

Import public key

sudo apt update
sudo apt install gnupg
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor

Buat file /etc/apt/sources.list.d/mongodb-org-6.0.list

Di Ubuntu 22.04 (Jammy)

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

Install MongoDB

sudo apt update
sudo apt install -y mongodb-org
sudo systemctl start mongod
sudo systemctl enable mongod

Tip: MongoDB digunakan sebagai database untuk NRF/PCF/UDR dan PCRF/HSS.

Setup TUN device (not persistent)

Buat TUN device dengan nama interface ogstun.

sudo ip tuntap add name ogstun mode tun
sudo ip addr add 10.45.0.1/16 dev ogstun
sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
sudo ip link set ogstun up

Tip: script ini tersedia di $GIT_REPO/misc/netconf.sh yang akan memudahkan kita dapat mengkonfigurasi TUN device:

sudo ./misc/netconf.sh

Install Pendukung

Install Dependency

sudo apt update
sudo apt y install python3-pip python3-setuptools python3-wheel ninja-build build-essential flex bison \
git cmake libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev \
libyaml-dev libnghttp2-dev libmicrohttpd-dev libcurl4-gnutls-dev libnghttp2-dev libtins-dev \
libtalloc-dev meson

Git clone & Compile

Clone source code dari github

rm -Rf /usr/local/src/open5gs
cd /usr/local/src
git clone https://github.com/open5gs/open5gs

Compile menggunakan Meson

cd /usr/local/src/open5gs
meson build --prefix=`pwd`/install
ninja -C build

Test

Cek EPC (4G)

./build/tests/attach/attach

Hasilnya,

s1setup-test        : SUCCESS
simple-test         : SUCCESS
guti-test           : SUCCESS
auth-test           : SUCCESS
idle-test           : SUCCESS
emm-status-test     : SUCCESS
ue-context-test     : SUCCESS
reset-test          : SUCCESS
issues-test         : SUCCESS
All tests passed.

Cek Core (5G)

./build/tests/registration/registration

Hasilnya,

simple-test         : SUCCESS
guti-test           : SUCCESS
auth-test           : SUCCESS
ecc-test            : SUCCESS
idle-test           : SUCCESS
dereg-test          : SUCCESS
paging-test         : SUCCESS
identity-test       : SUCCESS
gmm-status-test     : SUCCESS
ue-context-test     : SUCCESS
reset-test          : SUCCESS
multi-ue-test       : SUCCESS
All tests passed.

Lakukan Full Test

cd build
meson test -v

Pastikan tidak ada Error,

ninja: Entering directory `/usr/local/src/open5gs/build'
ninja: no work to do.
 1/13 open5gs:unit / core        RUNNING       
>>> MALLOC_PERTURB_=59 /usr/local/src/open5gs/build/tests/core/core
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
list-test           : SUCCESS
pool-test           : SUCCESS
strings-test        : SUCCESS
time-test           : SUCCESS
conv-test           : SUCCESS
log-test            : SUCCESS
....
....
....
12/13 open5gs:app / handover     OK             13.56s

13/13 open5gs:epc / non3gpp      RUNNING       
>>> MALLOC_PERTURB_=75 /usr/local/src/open5gs/build/tests/non3gpp/non3gpp
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
epdg-test           : SUCCESS
All tests passed.
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
13/13 open5gs:epc / non3gpp      OK              7.63s

Ok:                 13  
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   
Full log written to /usr/local/src/open5gs/build/meson-logs/testlog.txt

Pastikan tidak ada yang Fail.

Install Open5gs

cd /usr/local/src/open5gs/build
ninja install
cd ../

Pranala Menarik