Added more config env to ueransim. set opc by default.

This commit is contained in:
Carlos Giraldo
2021-03-05 09:47:25 +01:00
parent d3f9a2df7d
commit 1b73b15109
6 changed files with 40 additions and 16 deletions

View File

@@ -26,3 +26,7 @@ services:
GNB_HOSTNAME: gnb1
APN: internet
MSISDN: '0000000001'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'

View File

@@ -26,6 +26,9 @@ services:
GNB_HOSTNAME: gnb1
APN: internet
MSISDN: '0000000001'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'
ue2:
build:
context: ../../ueransim/
@@ -41,6 +44,9 @@ services:
GNB_HOSTNAME: gnb1
APN: internet
MSISDN: '0000000002'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'
ue3:
build:
context: ../../ueransim/
@@ -56,6 +62,9 @@ services:
GNB_HOSTNAME: gnb1
APN: internet
MSISDN: '0000000003'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'
ue4:
build:
context: ../../ueransim/
@@ -71,4 +80,7 @@ services:
GNB_HOSTNAME: gnb1
APN: internet
MSISDN: '0000000004'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'

View File

@@ -37,6 +37,9 @@ services:
GNB_HOSTNAME: gnb1
APN: internet
MSISDN: '0000000001'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'
ue2:
build:
context: ../../ueransim/
@@ -52,6 +55,9 @@ services:
GNB_HOSTNAME: gnb1
APN: internet
MSISDN: '0000000002'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'
ue3:
build:
context: ../../ueransim/
@@ -67,6 +73,9 @@ services:
GNB_HOSTNAME: gnb2
APN: internet
MSISDN: '0000000003'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'
ue4:
build:
context: ../../ueransim/
@@ -82,4 +91,7 @@ services:
GNB_HOSTNAME: gnb2
APN: internet
MSISDN: '0000000004'
KEY: '465B5CE8B199B49FAA5F0A2EE238A6BC'
OP_TYPE: OPC
OP: 'E8ED289DEBA952E4283B54E88E6183CA'

View File

@@ -4,15 +4,8 @@ CONTAINER_NAME=open5gs-and-ueransim_mongo_1
IMSI_LIST="001010000000001 001010000000002 001010000000003 001010000000004"
KI=465B5CE8B199B49FAA5F0A2EE238A6BC
OP=E8ED289DEBA952E4283B54E88E6183CA
#OPC=
OPC=E8ED289DEBA952E4283B54E88E6183CA
for IMSI in $IMSI_LIST; do
if [ ! -z "$OPC" ]; then
docker exec $CONTAINER_NAME mongo --eval "db.subscribers.update({\"imsi\" : \"$IMSI\"}, { \$setOnInsert: { \"imsi\" : \"$IMSI\", \"pdn\" : [ { \"apn\" : \"internet\", \"_id\" : new ObjectId(), \"pcc_rule\" : [ ], \"ambr\" : { \"downlink\" : NumberLong(1024000), \"uplink\" : NumberLong(1024000) }, \"qos\" : { \"qci\" : NumberInt(9), \"arp\" : { \"priority_level\" : NumberInt(8), \"pre_emption_vulnerability\" : NumberInt(1), \"pre_emption_capability\" : NumberInt(0) } }, \"type\" : NumberInt(0) } ], \"ambr\" : { \"downlink\" : NumberLong(1024000), \"uplink\" : NumberLong(1024000) }, \"subscribed_rau_tau_timer\" : NumberInt(12), \"network_access_mode\" : NumberInt(2), \"subscriber_status\" : NumberInt(0), \"access_restriction_data\" : NumberInt(32), \"security\" : { \"k\" : \"$KI\", \"amf\" : \"8000\", \"op\" : null, \"opc\" : \"$OPC\" }, \"__v\" : 0 } }, upsert=true);" open5gs
elif [ ! -z "$OP" ]; then
docker exec $CONTAINER_NAME mongo --eval "db.subscribers.update({\"imsi\" : \"$IMSI\"}, { \$setOnInsert: { \"imsi\" : \"$IMSI\", \"pdn\" : [ { \"apn\" : \"internet\", \"_id\" : new ObjectId(), \"pcc_rule\" : [ ], \"ambr\" : { \"downlink\" : NumberLong(1024000), \"uplink\" : NumberLong(1024000) }, \"qos\" : { \"qci\" : NumberInt(9), \"arp\" : { \"priority_level\" : NumberInt(8), \"pre_emption_vulnerability\" : NumberInt(1), \"pre_emption_capability\" : NumberInt(0) } }, \"type\" : NumberInt(0) } ], \"ambr\" : { \"downlink\" : NumberLong(1024000), \"uplink\" : NumberLong(1024000) }, \"subscribed_rau_tau_timer\" : NumberInt(12), \"network_access_mode\" : NumberInt(2), \"subscriber_status\" : NumberInt(0), \"access_restriction_data\" : NumberInt(32), \"security\" : { \"k\" : \"$KI\", \"amf\" : \"8000\", \"opc\" : null, \"op\" : \"$OP\" }, \"__v\" : 0 } }, upsert=true);" open5gs
fi
docker exec $CONTAINER_NAME mongo --eval "db.subscribers.update({\"imsi\" : \"$IMSI\"}, { \$setOnInsert: { \"imsi\" : \"$IMSI\", \"pdn\" : [ { \"apn\" : \"internet\", \"_id\" : new ObjectId(), \"pcc_rule\" : [ ], \"ambr\" : { \"downlink\" : NumberLong(1024000), \"uplink\" : NumberLong(1024000) }, \"qos\" : { \"qci\" : NumberInt(9), \"arp\" : { \"priority_level\" : NumberInt(8), \"pre_emption_vulnerability\" : NumberInt(1), \"pre_emption_capability\" : NumberInt(0) } }, \"type\" : NumberInt(0) } ], \"ambr\" : { \"downlink\" : NumberLong(1024000), \"uplink\" : NumberLong(1024000) }, \"subscribed_rau_tau_timer\" : NumberInt(12), \"network_access_mode\" : NumberInt(2), \"subscriber_status\" : NumberInt(0), \"access_restriction_data\" : NumberInt(32), \"security\" : { \"k\" : \"$KI\", \"amf\" : \"8000\", \"op\" : null, \"opc\" : \"$OPC\" }, \"__v\" : 0 } }, upsert=true);" open5gs
done