Skip to content

Commit

Permalink
Fix OAI topology (nephio-project#225)
Browse files Browse the repository at this point in the history
* Adjust OAI network topology

Signed-off-by: Victor Morales <v.morales@samsung.com>

* Add a wait for PFCP session function

Signed-off-by: Victor Morales <v.morales@samsung.com>

---------

Signed-off-by: Victor Morales <v.morales@samsung.com>
  • Loading branch information
electrocucaracha authored and dkosteck committed Aug 15, 2024
1 parent 05fcd04 commit 659a287
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 18 additions & 3 deletions e2e/tests/oai/003.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ source "${LIBDIR}/porch.sh"
# shellcheck source=e2e/lib/_assertions.sh
source "${LIBDIR}/_assertions.sh"

function _wait_for_pfcp_session {
local kubeconfig=$1

info "waiting for PFCP session to be established"
timeout=600
until kubectl logs "$(kubectl get pods -n oai-core --kubeconfig "$kubeconfig" -l workload.nephio.org/oai=upf -o jsonpath='{.items[*].metadata.name}')" -n oai-core -c upf-edge --kubeconfig "$kubeconfig" | grep -q 'Received SX HEARTBEAT REQUEST'; do
if [[ $timeout -lt 0 ]]; then
kubectl logs -l workload.nephio.org/oai=upf -n oai-core -c upf-edge --kubeconfig "$kubeconfig" --tail 50
error "Timed out waiting for PFCP session"
fi
timeout=$((timeout - 5))
sleep 5
done
debug "timeout: $timeout"
}

for nf in nrf udm udr ausf amf smf; do
cat <<EOF | kubectl apply -f -
apiVersion: config.porch.kpt.dev/v1alpha2
Expand Down Expand Up @@ -76,6 +92,5 @@ for nf in nrf udm udr ausf amf smf; do
done
k8s_wait_ready_replicas "deployment" "upf-edge" "$_edge_kubeconfig" "oai-core"

# TODO: Verify PFCP session
#upf_podname=$(kubectl get pods -n oai-core --kubeconfig "$_edge_kubeconfig" -l workload.nephio.org/oai=upf -o jsonpath='{.items[*].metadata.name}')
#kubectl logs "$upf_podname" -n oai-core -c upf-edge --kubeconfig "$_edge_kubeconfig" | grep 'Received SX HEARTBEAT REQUEST' | wc -l
# Check if the PFCP session between UPF and SMF is established
_wait_for_pfcp_session "$_edge_kubeconfig"
4 changes: 2 additions & 2 deletions e2e/tests/oai/network-topo.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
- { nodeName: core, interfaceName: eth1}
- endpoints:
- { nodeName: srl, interfaceName: e1-2}
- { nodeName: regional, interfaceName: eth1}
- { nodeName: edge, interfaceName: eth1}
- endpoints:
- { nodeName: srl, interfaceName: e1-3}
- { nodeName: edge, interfaceName: eth1}
- { nodeName: regional, interfaceName: eth1}

0 comments on commit 659a287

Please sign in to comment.