Add 5g-test target to run gnbsim

Change-Id: I260b0ba8a2de372c793797c2907e80f0bc3f96cd
diff --git a/5g-core-values.yaml b/5g-core-values.yaml
index 5c09d90..0695c6e 100644
--- a/5g-core-values.yaml
+++ b/5g-core-values.yaml
@@ -48,8 +48,8 @@
             addr: webui
             port: 5000
           subscribers:
-          - ueId-start: 2089300007487
-            ueId-end: 2089300007501
+          - ueId-start: 208930100007487
+            ueId-end: 208930100007501
             plmnId: 20893
             opc: "981d464c7c52eb6e5036234984ad0bcf"
             op: ""
@@ -58,21 +58,21 @@
           device-groups:
           - name:  "5g-gnbsim-user"
             imsis:
-              - "2089300007487"
-              - "2089300007488"
-              - "2089300007489"
-              - "2089300007490"
-              - "2089300007491"
-              - "2089300007492"
-              - "2089300007493"
-              - "2089300007494"
-              - "2089300007495"
-              - "2089300007496"
-              - "2089300007497"
-              - "2089300007498"
-              - "2089300007499"
-              - "2089300007500"
-              - "2089300007501"
+              - "208930100007487"
+              - "208930100007488"
+              - "208930100007489"
+              - "208930100007490"
+              - "208930100007491"
+              - "208930100007492"
+              - "208930100007493"
+              - "208930100007494"
+              - "208930100007495"
+              - "208930100007496"
+              - "208930100007497"
+              - "208930100007498"
+              - "208930100007499"
+              - "208930100007500"
+              - "208930100007501"
             ip-domain-name: "pool1"
             ip-domain-expanded:
               dnn: internet
diff --git a/Makefile b/Makefile
index 4a2f024..a89f2c6 100644
--- a/Makefile
+++ b/Makefile
@@ -321,6 +321,18 @@
 	ping -I oip1 google.com -c 3
 	@echo "Finished to test"
 
+5g-test: | $(M)/5g-core
+	@echo "Test: Registration + UE initiated PDU Session Establishment + User Data packets"
+	@sleep 5
+	@rm -f /tmp/gnbsim.out
+	kubectl -n omec exec gnbsim-0 -- ./gnbsim 2>&1 | tee /tmp/gnbsim.out
+	@echo ""
+	@echo "Test summary:"
+	@grep "Result: " /tmp/gnbsim.out
+	@[ "$$(grep -c "Result: PASS" /tmp/gnbsim.out)" == "5" ] \
+		&& echo "*** TEST PASSED ***" \
+		|| (echo "*** TEST FAILED ***" && exit 1)
+
 reset-test:
 	kubectl delete namespace omec || true
 	kubectl delete po router || true
diff --git a/ransim-values.yaml b/ransim-values.yaml
index 00bb745..c3e3cfa 100644
--- a/ransim-values.yaml
+++ b/ransim-values.yaml
@@ -4,3 +4,80 @@
 
 resources:
   enabled: false
+
+config:
+  gnbsim:
+    yamlCfgFiles:
+      gnb.conf: |
+        info:
+          version: 1.0.0
+          description: gNodeB sim initial configuration
+        configuration:
+          gnbs: # pool of gNodeBs
+            gnb1:
+              n2IpAddr: # gNB N2 interface IP address used to connect to AMF
+              n2Port: 9487 # gNB N2 Port used to connect to AMF
+              n3IpAddr: 192.168.251.5 # gNB N3 interface IP address used to connect to UPF
+              n3Port: 2152 # gNB N3 Port used to connect to UPF
+              name: gnb1 # gNB name that uniquely identify a gNB within application
+              globalRanId:
+                plmnId:
+                  mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
+                  mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
+                gNbId:
+                  bitLength: 24
+                  gNBValue: 000102 # gNB identifier (3 bytes hex string, range: 000000~FFFFFF)
+              supportedTaList:
+              - tac: 000001 # Tracking Area Code (3 bytes hex string, range: 000000~FFFFFF)
+                broadcastPlmnList:
+                  - plmnId:
+                      mcc: 208
+                      mnc: 93
+                    taiSliceSupportList:
+                        - sst: 1 # Slice/Service Type (uinteger, range: 0~255)
+                          sd: 010203 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
+              defaultAmf:
+                hostName: amf # Host name of AMF
+                ipAddr: # AMF IP address
+                port: 38412 # AMF port
+
+          profiles: # profile information
+            - profileType: register # profile type
+              profileName: profile1 # uniqely identifies a profile within application
+              enable: false # Set true to execute the profile, false otherwise.
+              gnbName: gnb1 # gNB to be used for this profile
+              startImsi: 208930100007487 #First IMSI. Subsequent values will be used if ueCount is mo    re than 1
+              ueCount: 5 # Number of UEs for for which the profile will be executed
+              plmnId: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>
+                mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
+                mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
+            - profileType: pdusessest
+              profileName: profile2
+              enable: true
+              gnbName: gnb1
+              startImsi: 208930100007492
+              ueCount: 5
+              plmnId:
+                mcc: 208
+                mnc: 93
+              dataPktCount: 5 # Number of UL user data packets to be transmitted. Common for all UEs
+            - profileType: anrelease
+              profileName: profile3
+              enable: false
+              gnbName: gnb1
+              startImsi: 208930100007497
+              ueCount: 5
+              plmnId:
+                mcc: 208
+                mnc: 93
+            - profileType: deregister
+              profileName: profile4
+              enable: false
+              gnbName: gnb1
+              startImsi: 208930100007497
+              ueCount: 5
+              plmnId:
+                mcc: 208
+                mnc: 93
+        logger:
+          logLevel: info # how detailed the log will be, values: trace, debug, info, warn, error, fatal, panic
diff --git a/roc-5g-models-v4.json b/roc-5g-models-v4.json
index 1ca3e3f..4363931 100644
--- a/roc-5g-models-v4.json
+++ b/roc-5g-models-v4.json
@@ -68,8 +68,8 @@
                     "id": "aiab-device-group",
                     "imsis": [
                         {
-                            "imsi-range-from": 2089300007487,
-                            "imsi-range-to": 2089300007488,
+                            "imsi-range-from": 208930100007487,
+                            "imsi-range-to": 208930100007501,
                             "imsi-id": "aiab-imsis",
                             "display-name": "Valid IMSIs"                        }
                     ],