AETHER-3345 Add 4g-core and oaisim-standalone targets

Change-Id: Ia4a3f3e6277e3b2ce30ec285abbd1056e963c0eb
diff --git a/Makefile b/Makefile
index 53f1a02..1b3334b 100644
--- a/Makefile
+++ b/Makefile
@@ -156,6 +156,7 @@
 	kubectl delete net-attach-def core-net
 	touch $@
 
+4g-core: | $(M)/omec
 $(M)/omec: | $(M)/helm-ready /opt/cni/bin/simpleovs /opt/cni/bin/static $(M)/fabric
 	kubectl get namespace omec 2> /dev/null || kubectl create namespace omec
 	helm repo update
@@ -201,10 +202,24 @@
 	sudo ip addr add 127.0.0.2/8 dev lo || true
 	touch $@
 
-$(M)/oaisim: | $(M)/ue-image $(M)/omec $(M)/oaisim-lo
-	$(eval mme_iface=$(shell ip -4 route list default | awk -F 'dev' '{ print $$2; exit }' | awk '{ print $$1 }'))
+oaisim-standalone: | $(M)/helm-ready $(M)/ue-image $(M)/oaisim-lo
+	kubectl get namespace omec 2> /dev/null || kubectl create namespace omec
+	kubectl apply -f resources/busybox-sleep.yaml --namespace=omec
+	helm repo update
 	helm upgrade --install $(HELM_GLOBAL_ARGS) --namespace omec oaisim cord/oaisim -f $(OAISIM_VALUES) \
-		--set config.enb.networks.s1_mme.interface=$(mme_iface) \
+		--set images.pullPolicy=IfNotPresent
+	kubectl rollout status -n omec statefulset ue
+	@timeout 60s bash -c \
+	"until ip addr show oip1 | grep -q inet; \
+	do \
+		echo 'Waiting for UE 1 gets IP address'; \
+		sleep 3; \
+	done"
+	touch $(M)/oaisim $(M)/omec $(M)/fabric
+
+
+$(M)/oaisim: | $(M)/ue-image $(M)/omec $(M)/oaisim-lo
+	helm upgrade --install $(HELM_GLOBAL_ARGS) --namespace omec oaisim cord/oaisim -f $(OAISIM_VALUES) \
 		--set images.pullPolicy=IfNotPresent
 	kubectl rollout status -n omec statefulset ue
 	@timeout 60s bash -c \
diff --git a/oaisim-values.yaml b/oaisim-values.yaml
index ecf15b3..f225b5f 100644
--- a/oaisim-values.yaml
+++ b/oaisim-values.yaml
@@ -5,10 +5,12 @@
 config:
   enb:
     mme:
-      address: 127.0.0.1
+      address: 192.168.251.4
     networks:
       s1u:
         interface: enb
+      s1_mme:
+        interface: enb
   plmn:
     mcc: "208"
     mnc: "01"
diff --git a/resources/busybox-sleep.yaml b/resources/busybox-sleep.yaml
new file mode 100644
index 0000000..0e80705
--- /dev/null
+++ b/resources/busybox-sleep.yaml
@@ -0,0 +1,19 @@
+# Copyright 2022-present Open Networking Foundation
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Create a pod with app: mme label so that oaisim will start
+
+apiVersion: v1
+kind: Pod
+metadata:
+  name: busybox-sleep
+  labels:
+    app: mme
+spec:
+  containers:
+  - name: busybox
+    image: busybox
+    args:
+    - sleep
+    - "1000000"