forked from nephio-project/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding OAI RAN and UE test deployment scripts (nephio-project#227)
* Changes to add ue and ran deployment scripts * changes to repo register and name corrections * changes to file permissions * Some OAI RAN fixes Signed-off-by: Victor Morales <v.morales@samsung.com> * remove private catalog repository reference * Changes to correct scripts to work on different setups Signed-off-by: josephthaliath <jo.thaliath@samsung.com> * Change repo name in 002-oai-operators.yaml Co-authored-by: Victor Morales <chipahuac@hotmail.com> * Update repo in 004-ran-cucp.yaml Co-authored-by: Victor Morales <chipahuac@hotmail.com> * Update year in 004-ran-cucp.yaml Co-authored-by: Victor Morales <chipahuac@hotmail.com> * year update in 004.sh Co-authored-by: Victor Morales <chipahuac@hotmail.com> * Update repo information in 004.sh Co-authored-by: Victor Morales <chipahuac@hotmail.com> * update year in 005.sh Co-authored-by: Victor Morales <chipahuac@hotmail.com> * Update repo in 005.sh Co-authored-by: Victor Morales <chipahuac@hotmail.com> * changes to deploy ran operator only in regional and edge cluster Signed-off-by: josephthaliath <jo.thaliath@samsung.com> * Corrections to package variant names Signed-off-by: josephthaliath <jo.thaliath@samsung.com> * removing the file added by mistake Signed-off-by: josephthaliath <jo.thaliath@samsung.com> --------- Signed-off-by: Victor Morales <v.morales@samsung.com> Signed-off-by: josephthaliath <jo.thaliath@samsung.com> Co-authored-by: Victor Morales <v.morales@samsung.com> Co-authored-by: Victor Morales <chipahuac@hotmail.com>
- Loading branch information
Showing
5 changed files
with
271 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
# SPDX-license-identifier: Apache-2.0 | ||
############################################################################## | ||
# Copyright (c) 2024 The Nephio Authors. | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Apache License, Version 2.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
############################################################################## | ||
|
||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: PackageVariant | ||
metadata: | ||
name: oai-cucp | ||
spec: | ||
upstream: | ||
repo: catalog-workloads-oai-ran | ||
package: pkg-example-cucp-bp | ||
revision: main | ||
downstream: | ||
repo: regional | ||
package: oai-ran-cucp | ||
annotations: | ||
approval.nephio.org/policy: initial | ||
injectors: | ||
- name: regional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
# SPDX-license-identifier: Apache-2.0 | ||
############################################################################## | ||
# Copyright (c) 2024 The Nephio Authors. | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Apache License, Version 2.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
############################################################################## | ||
|
||
## TEST METADATA | ||
## TEST-NAME: Deploy OAI E1 Split RAN Network Functions | ||
## | ||
|
||
set -o pipefail | ||
set -o errexit | ||
set -o nounset | ||
[[ ${DEBUG:-false} != "true" ]] || set -o xtrace | ||
|
||
# shellcheck source=e2e/defaults.env | ||
source "$E2EDIR/defaults.env" | ||
|
||
# shellcheck source=e2e/lib/k8s.sh | ||
source "${LIBDIR}/k8s.sh" | ||
|
||
# shellcheck source=e2e/lib/kpt.sh | ||
source "${LIBDIR}/kpt.sh" | ||
|
||
function _wait_for_ran { | ||
kubeconfig=$1 | ||
wait_msg=$2 | ||
link_name=$3 | ||
|
||
info "waiting for $link_name link to be established" | ||
timeout=600 | ||
|
||
temp_file=$(mktemp) | ||
kubectl logs "$(kubectl get pods -n oai-ran-cucp --kubeconfig "$kubeconfig" -l app.kubernetes.io/name=oai-gnb-cu-cp -o jsonpath='{.items[*].metadata.name}')" -n oai-ran-cucp -c gnbcucp --kubeconfig "$kubeconfig" > temp_file | ||
while grep -q "$wait_msg" temp_file;status=$?; [[ $status != 0 ]] | ||
do | ||
if [[ $timeout -lt 0 ]]; then | ||
kubectl logs -l app.kubernetes.io/name=oai-gnb-cu-cp -n oai-ran-cucp -c gnbcucp --kubeconfig "$kubeconfig" --tail 50 | ||
error "Timed out waiting for $link_name link to be established" | ||
fi | ||
timeout=$((timeout - 5)) | ||
sleep 5 | ||
kubectl logs "$(kubectl get pods -n oai-ran-cucp --kubeconfig "$kubeconfig" -l app.kubernetes.io/name=oai-gnb-cu-cp -o jsonpath='{.items[*].metadata.name}')" -n oai-ran-cucp -c gnbcucp --kubeconfig "$kubeconfig" > temp_file | ||
done | ||
debug "timeout: $timeout" | ||
rm "${temp_file}" | ||
} | ||
|
||
function _wait_for_n2_link { | ||
_wait_for_ran "$1" "Received NGAP_REGISTER_GNB_CNF: associated AMF" "N2" | ||
} | ||
|
||
function _wait_for_e1_link { | ||
# Connection between CU-CP and CU-UP | ||
_wait_for_ran "$1" "e1ap_send_SETUP_RESPONSE" "E1" | ||
} | ||
|
||
function _wait_for_f1_link { | ||
# Connection between DU and CU-CP | ||
_wait_for_ran "$1" "Cell Configuration ok" "F1" | ||
} | ||
|
||
k8s_apply "$TESTDIR/004-ran-cucp.yaml" | ||
|
||
for nf in du cuup; do | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: PackageVariant | ||
metadata: | ||
name: oai-$nf | ||
spec: | ||
upstream: | ||
repo: catalog-workloads-oai-ran | ||
package: pkg-example-$nf-bp | ||
revision: main | ||
downstream: | ||
repo: edge | ||
package: oai-ran-$nf | ||
annotations: | ||
approval.nephio.org/policy: initial | ||
injectors: | ||
- name: edge | ||
EOF | ||
done | ||
|
||
for nf in du cuup cucp; do | ||
k8s_wait_ready "packagevariant" "oai-$nf" | ||
done | ||
|
||
for nf in du cuup; do | ||
kpt_wait_pkg "edge" "oai-ran-$nf" "nephio" "1800" | ||
done | ||
kpt_wait_pkg "regional" "oai-ran-cucp" "nephio" "1800" | ||
|
||
_regional_kubeconfig="$(k8s_get_capi_kubeconfig "regional")" | ||
_edge_kubeconfig="$(k8s_get_capi_kubeconfig "edge")" | ||
|
||
k8s_wait_ready_replicas "deployment" "oai-gnb-cu-cp" "$_regional_kubeconfig" "oai-ran-cucp" | ||
k8s_wait_ready_replicas "deployment" "oai-gnb-cu-up" "$_edge_kubeconfig" "oai-ran-cuup" | ||
k8s_wait_ready_replicas "deployment" "oai-gnb-du" "$_edge_kubeconfig" "oai-ran-du" | ||
|
||
# Check if the NGAPSetup Request Response is okay between AMF and CU-CP | ||
_wait_for_n2_link "$_regional_kubeconfig" | ||
# Check if the E1Setup Request Response is okay between AMF and CU-CP | ||
_wait_for_e1_link "$_regional_kubeconfig" | ||
# Check if the F1Setup Request Response is okay between AMF and CU-CP | ||
_wait_for_f1_link "$_regional_kubeconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
# SPDX-license-identifier: Apache-2.0 | ||
############################################################################## | ||
# Copyright (c) 2024 The Nephio Authors. | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Apache License, Version 2.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
############################################################################## | ||
|
||
## TEST METADATA | ||
## TEST-NAME: Deploy OAI UE SIM | ||
## | ||
|
||
set -o pipefail | ||
set -o errexit | ||
set -o nounset | ||
[[ ${DEBUG:-false} != "true" ]] || set -o xtrace | ||
|
||
# shellcheck source=e2e/defaults.env | ||
source "$E2EDIR/defaults.env" | ||
|
||
# shellcheck source=e2e/lib/k8s.sh | ||
source "${LIBDIR}/k8s.sh" | ||
|
||
# shellcheck source=e2e/lib/kpt.sh | ||
source "${LIBDIR}/kpt.sh" | ||
|
||
function _wait_for_ue { | ||
local kubeconfig=$1 | ||
local log_msg=$2 | ||
local msg=$3 | ||
|
||
info "waiting for $msg to be finished" | ||
timeout=600 | ||
temp_file=$(mktemp) | ||
kubectl logs "$(kubectl get pods -n oai-ue --kubeconfig "$kubeconfig" -l app.kubernetes.io/name=oai-nr-ue -o jsonpath='{.items[*].metadata.name}')" -n oai-ue -c nr-ue --kubeconfig "$kubeconfig" > temp_file | ||
while grep -q "$log_msg" temp_file;status=$?; [ $status != 0 ] | ||
do | ||
if [[ $timeout -lt 0 ]]; then | ||
kubectl logs -l app.kubernetes.io/name=oai-nr-ue -n oai-ue -c nr-ue --kubeconfig "$kubeconfig" --tail 50 | ||
error "Timed out waiting for $msg" | ||
fi | ||
timeout=$((timeout - 5)) | ||
sleep 5 | ||
kubectl logs "$(kubectl get pods -n oai-ue --kubeconfig "$kubeconfig" -l app.kubernetes.io/name=oai-nr-ue -o jsonpath='{.items[*].metadata.name}')" -n oai-ue -c nr-ue --kubeconfig "$kubeconfig" > temp_file | ||
done | ||
debug "timeout: $timeout" | ||
rm "${temp_file}" | ||
} | ||
|
||
function _wait_for_ue_registration { | ||
_wait_for_ue "$1" "REGISTRATION ACCEPT" "UE Registration" | ||
} | ||
|
||
function _wait_for_ue_pdu_session { | ||
_wait_for_ue "$1" "Interface oaitun_ue1 successfully configured" "PDU session" | ||
} | ||
|
||
cat <<EOF | kubectl apply -f - | ||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: PackageVariant | ||
metadata: | ||
name: oai-ue | ||
spec: | ||
upstream: | ||
repo: catalog-workloads-oai-ran | ||
package: pkg-example-ue-bp | ||
revision: main | ||
downstream: | ||
repo: edge | ||
package: oai-ran-ue | ||
annotations: | ||
approval.nephio.org/policy: initial | ||
injectors: | ||
- name: edge | ||
EOF | ||
|
||
k8s_wait_ready "packagevariant" "oai-ue" | ||
kpt_wait_pkg "edge" "oai-ran-ue" "nephio" "1800" | ||
|
||
_edge_kubeconfig="$(k8s_get_capi_kubeconfig "edge")" | ||
k8s_wait_ready_replicas "deployment" "oai-nr-ue" "$_edge_kubeconfig" "oai-ue" | ||
|
||
# Check if the Registration is finished | ||
_wait_for_ue_registration "$_edge_kubeconfig" | ||
# Check if the PDU Session is setup | ||
_wait_for_ue_pdu_session "$_edge_kubeconfig" |