Skip to content

Commit

Permalink
Merge pull request #9 from jain-ashish-sam/main
Browse files Browse the repository at this point in the history
Refactoring Code
  • Loading branch information
nephio-prow[bot] authored Jul 5, 2024
2 parents 5932877 + 01f802c commit 29ff3ce
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions internal/controller/resources_du.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,17 @@ func (resource DuResources) GetService() []*corev1.Service {
},
}

// O1-Telent Service
// Telent Service
service2 := &corev1.Service{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1",
Kind: "Service",
},
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"app.kubernetes.io/name": "oai-gnb-du-o1-telnet-lb",
"app.kubernetes.io/name": "oai-gnb-du-telnet-lb",
},
Name: "oai-gnb-du-o1-telnet-lb",
Name: "oai-gnb-du-telnet-lb",
},
Spec: corev1.ServiceSpec{
Selector: map[string]string{
Expand Down
14 changes: 7 additions & 7 deletions internal/controller/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
)

var (
// O1-Telnet
configurationTemplateForCuCpO1Telnet = template.Must(template.New("RanCuCpConfigurationO1").Parse(configurationTemplateSourceForCuCpO1Telnet))
configurationTemplateForCuUpO1Telnet = template.Must(template.New("RanCuUpConfigurationO1").Parse(configurationTemplateSourceForCuUpO1Telnet))
configurationTemplateForDuO1Telnet = template.Must(template.New("RanDuConfigurationO1").Parse(configurationTemplateSourceForDuO1Telnet))
// Telnet
configurationTemplateForCuCpTelnet = template.Must(template.New("RanCuCpConfigurationTelnet").Parse(configurationTemplateSourceForCuCpTelnet))
configurationTemplateForCuUpTelnet = template.Must(template.New("RanCuUpConfigurationTelnet").Parse(configurationTemplateSourceForCuUpTelnet))
configurationTemplateForDuTelnet = template.Must(template.New("RanDuConfigurationTelnet").Parse(configurationTemplateSourceForDuTelnet))
)

type configurationTemplateValuesForCuCp struct {
Expand Down Expand Up @@ -84,7 +84,7 @@ type configurationTemplateValuesForDu struct {
func renderConfigurationTemplateForCuCp(values configurationTemplateValuesForCuCp) (string, error) {
var buffer bytes.Buffer

if err := configurationTemplateForCuCpO1Telnet.Execute(&buffer, values); err == nil {
if err := configurationTemplateForCuCpTelnet.Execute(&buffer, values); err == nil {
return buffer.String(), nil
} else {
return "", err
Expand All @@ -94,7 +94,7 @@ func renderConfigurationTemplateForCuCp(values configurationTemplateValuesForCuC
func renderConfigurationTemplateForCuUp(values configurationTemplateValuesForCuUp) (string, error) {
var buffer bytes.Buffer

if err := configurationTemplateForCuUpO1Telnet.Execute(&buffer, values); err == nil {
if err := configurationTemplateForCuUpTelnet.Execute(&buffer, values); err == nil {
return buffer.String(), nil
} else {
return "", err
Expand All @@ -103,7 +103,7 @@ func renderConfigurationTemplateForCuUp(values configurationTemplateValuesForCuU

func renderConfigurationTemplateForDu(values configurationTemplateValuesForDu) (string, error) {
var buffer bytes.Buffer
if err := configurationTemplateForDuO1Telnet.Execute(&buffer, values); err == nil {
if err := configurationTemplateForDuTelnet.Execute(&buffer, values); err == nil {
return buffer.String(), nil
} else {
return "", err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

package controller

const configurationTemplateSourceForCuCpO1Telnet = `
const configurationTemplateSourceForCuCpTelnet = `
Active_gNBs = ( "oai-cu-cp");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
Expand Down Expand Up @@ -121,7 +121,7 @@ security = {
`

const configurationTemplateSourceForCuUpO1Telnet = `
const configurationTemplateSourceForCuUpTelnet = `
Active_gNBs = ( "oai-cu-up");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
Expand Down Expand Up @@ -215,7 +215,7 @@ security = {
};
`

const configurationTemplateSourceForDuO1Telnet = `
const configurationTemplateSourceForDuTelnet = `
Active_gNBs = ( "du-rfsim");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
Expand Down
20 changes: 10 additions & 10 deletions test-infra/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Local Testing Environment for OAI with O1-Telnet
# Local Testing Environment for OAI with Telnet
Follow the [Installation Guide](https://docs.nephio.org/docs/guides/install-guides/) to install Nephio

Now, we need to follow the [following exercise](https://docs.nephio.org/docs/guides/user-guides/exercise-2-oai/) which we term as Master Excerises.
Expand Down Expand Up @@ -43,11 +43,11 @@ Note: If your repo-name is not 'oai-ran-bp', then update the upstream-repo of pa
### Step-5: Deploy Core and Ran
Follow the steps 3-6 of [Master Excercise](https://docs.nephio.org/docs/guides/user-guides/exercise-2-oai/)

### Step-6: Validate the deployment by ascessing o1-telnet
### Step-6: Validate the deployment by ascessing telnet
```bash
sudo apt update && sudo apt install netcat
O1_IP=$(kubectl get svc oai-gnb-du-o1-telnet-lb -n oai-ran-du --context edge-admin@edge -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo o1 stats | nc -N $O1_IP 9090
TELNET_IP=$(kubectl get svc oai-gnb-du-telnet-lb -n oai-ran-du --context edge-admin@edge -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo o1 stats | nc -N $TELNET_IP 9090
```

### Step-7: Deploy UE (20 MHz):
Expand All @@ -64,12 +64,12 @@ UPF_POD=$(kubectl get pods -n oai-core --context=edge-admin@edge -l workload.nep
UPF_tun0_IP_ADDR=$(kubectl exec -it $UPF_POD -n oai-core -c upf-edge --context edge-admin@edge -- ip -f inet addr show tun0 | sed -En -e 's/.*inet ([0-9.]+).*/\1/p')
kubectl exec -it $UE_POD -n oai-ue --context edge-admin@edge -- ping -c 3 $UPF_tun0_IP_ADDR
```
### Step-8: Bandwidth Reconfigure Procedure (20 Mhz to 40 Mhz) using o1-telnet
### Step-8: Bandwidth Reconfigure Procedure (20 Mhz to 40 Mhz) using telnet
```bash
O1_IP=$(kubectl get svc oai-gnb-du-o1-telnet-lb -n oai-ran-du --context edge-admin@edge -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo o1 stop_modem | nc -N $O1_IP 9090
echo o1 bwconfig 40 | nc -N $O1_IP 9090
echo o1 start_modem | nc -N $O1_IP 9090
echo o1 stats | nc -N $O1_IP 9090
TELNET_IP=$(kubectl get svc oai-gnb-du-telnet-lb -n oai-ran-du --context edge-admin@edge -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo o1 stop_modem | nc -N $TELNET_IP 9090
echo o1 bwconfig 40 | nc -N $TELNET_IP 9090
echo o1 start_modem | nc -N $TELNET_IP 9090
echo o1 stats | nc -N $TELNET_IP 9090
```
After Reconfiguration, Connect the 40 Mhz ue using Step-7 and validate the Bandwidth-reconfiguration using Ping-Test

0 comments on commit 29ff3ce

Please sign in to comment.