Skip to content

Commit

Permalink
chore: simplify e2e testing setup (#379)
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Belanger <[email protected]>
  • Loading branch information
gruyaume authored Jan 19, 2025
1 parent 52ce16c commit 78fd850
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 77 deletions.
5 changes: 2 additions & 3 deletions k8s/core-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ spec:
annotations:
k8s.v1.cni.cncf.io/networks: |
[
{"name": "n3-net", "interface": "n3"},
{"name": "n6-net", "interface": "n6"}
{"name": "core-n3", "interface": "n3"},
{"name": "core-n6", "interface": "n6"}
]
spec:
initContainers:
Expand All @@ -27,7 +27,6 @@ spec:
- -c
- |
ip route replace default via 192.168.250.1 metric 110
ip route replace 192.168.251.0/24 via 192.168.252.1
sysctl -w net.ipv4.ip_forward=1
securityContext:
privileged: true
Expand Down
4 changes: 2 additions & 2 deletions k8s/core-n3-nad.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: n3-net
name: core-n3
namespace: dev2
spec:
config: '{
"cniVersion": "0.3.1",
"type": "bridge",
"bridge": "access-br",
"bridge": "n3-br",
"ipam": {
"type": "static",
"addresses": [
Expand Down
4 changes: 2 additions & 2 deletions k8s/core-n6-nad.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: n6-net
name: core-n6
namespace: dev2
spec:
config: '{
"cniVersion": "0.3.1",
"type": "bridge",
"bridge": "core-br",
"bridge": "n6-br",
"ipam": {
"type": "static",
"addresses": [
Expand Down
16 changes: 1 addition & 15 deletions k8s/gnbsim-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,11 @@ spec:
k8s.v1.cni.cncf.io/networks: |
[
{
"name": "gnb-net",
"name": "gnb-n3",
"interface": "gnb"
}
]
spec:
initContainers:
- name: init-route
image: busybox:latest
command:
- /bin/sh
- -c
- |
echo "Setting up custom route..."
ip route replace 192.168.252.0/24 via 192.168.251.1
securityContext:
privileged: true
capabilities:
add:
- NET_ADMIN
containers:
- name: gnbsim
image: ghcr.io/canonical/sdcore-gnbsim:1.4.5
Expand Down
18 changes: 0 additions & 18 deletions k8s/gnbsim-gnb-nad.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions k8s/router-ran-nad.yaml → k8s/gnbsim-n3-nad.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: ran-gw
name: gnb-n3
namespace: dev2
spec:
config: '{
"cniVersion": "0.3.1",
"type": "bridge",
"bridge": "ran-br",
"bridge": "n3-br",
"ipam": {
"type": "static",
"addresses": [
{"address": "192.168.251.1/24"}
{"address": "192.168.252.5/24"}
]
},
"capabilities": {"mac": true}
Expand Down
18 changes: 0 additions & 18 deletions k8s/router-access-nad.yaml

This file was deleted.

10 changes: 1 addition & 9 deletions k8s/router-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,8 @@ spec:
k8s.v1.cni.cncf.io/networks: |
[
{
"name": "core-gw",
"name": "router-n6",
"interface": "core"
},
{
"name": "access-gw",
"interface": "access"
},
{
"name": "ran-gw",
"interface": "ran"
}
]
spec:
Expand Down
4 changes: 2 additions & 2 deletions k8s/router-core-nad.yaml → k8s/router-n6-nad.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: core-gw
name: router-n6
namespace: dev2
spec:
config: '{
"cniVersion": "0.3.1",
"type": "bridge",
"bridge": "core-br",
"bridge": "n6-br",
"ipam": {
"type": "static",
"routes": [
Expand Down
8 changes: 3 additions & 5 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ async def test_given_ella_and_gnbsim_deployed_when_start_simulation_then_simulat
):
k8s_client = Kubernetes(namespace=NAMESPACE)
manifests = [
"k8s/router-ran-nad.yaml",
"k8s/router-core-nad.yaml",
"k8s/router-access-nad.yaml",
"k8s/router-n6-nad.yaml",
"k8s/router-deployment.yaml",
"k8s/core-n3-nad.yaml",
"k8s/core-n6-nad.yaml",
Expand All @@ -150,7 +148,7 @@ async def test_given_ella_and_gnbsim_deployed_when_start_simulation_then_simulat
subscriber = configure_ella_core(core_address=core_address)
create_gnbsim_configmap(k8s_client, subscriber)
gnbsim_manifests = [
"k8s/gnbsim-gnb-nad.yaml",
"k8s/gnbsim-n3-nad.yaml",
"k8s/gnbsim-deployment.yaml",
"k8s/gnbsim-service.yaml",
]
Expand Down Expand Up @@ -250,7 +248,7 @@ def create_gnbsim_configmap(k8s_client: Kubernetes, subscriber: Subscriber) -> N
},
},
"n2Port": 9487,
"n3IpAddr": "192.168.251.5",
"n3IpAddr": "192.168.252.5",
"n3Port": 2152,
"name": "gnb1",
"supportedTaList": [
Expand Down

0 comments on commit 78fd850

Please sign in to comment.