Skip to content
Snippets Groups Projects
Commit b4248cae authored by Shayan Hajipour's avatar Shayan Hajipour
Browse files

debug: camara ofc25 e2e test

- target files' path fixed
- app_name hardcoded
- json content of responses extracted
- target-full-ietf-slice.json moved to src/tests/of25/data
- descriptor validation in test_onboarding phase deactivated
- tfs_runtime_env_vars.sh mounted in ofc25's docker container
- slice component deployment added to deploy_specs.sh
- components' client directory added to the image
- new requirements added to the requirements.in of ofc25
parent 6123804a
No related branches found
No related tags found
1 merge request!321Resolve: "(CTTC) CAMARA Demo Integration tests"
......@@ -91,11 +91,15 @@ end2end_test ofc25:
# Run end-to-end test: onboard scenario
- >
docker run -t --rm --name ${TEST_NAME} --network=host
--volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
--volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
$CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-onboarding.sh
# Run end-to-end test: configure service TFS
- >
docker run -t --rm --name ${TEST_NAME} --network=host
--volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
--volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
$CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-e2e-ietf-slice-operations.sh
after_script:
......
......@@ -58,6 +58,19 @@ RUN python3 -m pip install -r requirements.txt
# Add component files into working directory
WORKDIR /var/teraflow
COPY src/__init__.py ./__init__.py
COPY src/common/*.py ./common/
COPY src/common/tests/. ./common/tests/
COPY src/common/tools/. ./common/tools/
COPY src/context/__init__.py context/__init__.py
COPY src/context/client/. context/client/
COPY src/device/__init__.py device/__init__.py
COPY src/device/client/. device/client/
COPY src/monitoring/__init__.py monitoring/__init__.py
COPY src/monitoring/client/. monitoring/client/
COPY src/service/__init__.py service/__init__.py
COPY src/service/client/. service/client/
COPY src/slice/__init__.py slice/__init__.py
COPY src/slice/client/. slice/client/
COPY src/tests/*.py ./tests/
COPY src/tests/ofc25/__init__.py ./tests/ofc25/__init__.py
COPY src/tests/ofc25/data/. ./tests/ofc25/data/
......
......@@ -21,7 +21,7 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"
# Set the list of components, separated by spaces, you want to build images for, and deploy.
#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator"
export TFS_COMPONENTS="context device pathcomp service nbi"
export TFS_COMPONENTS="context device pathcomp service slice nbi"
# Uncomment to activate Monitoring (old)
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
......
......@@ -14,3 +14,17 @@
deepdiff==6.7.*
requests==2.27.*
coverage==6.3
grpcio==1.47.*
grpcio-health-checking==1.47.*
grpcio-reflection==1.47.*
grpcio-tools==1.47.*
grpclib==0.4.4
prettytable==3.5.0
prometheus-client==0.13.0
protobuf==3.20.*
pytest==6.2.5
pytest-benchmark==3.4.1
python-dateutil==2.8.2
pytest-depends==1.0.1
......@@ -82,14 +82,12 @@ TARGET_NCE_APP_FLOWS = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"..",
"data",
"slice",
"target-nce-app-flows.json",
)
TARGET_NCE_APPS = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"..",
"data",
"slice",
"target-nce-apps.json",
)
TARGET_FULL_IETF_SLICE = os.path.join(
......@@ -103,7 +101,6 @@ TARGET_FULL_IETF_SLICE = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"..",
"data",
"slice",
"target-full-ietf-slice.json",
)
TARGET_IETF_SLICE_POSTED_SLICES = os.path.join(
......@@ -171,18 +168,18 @@ def test_ietf_slice_creation_removal():
requests.post(URL, headers=HEADERS, json=post_network_slice1)
URL = NCE_APP_DATA_URL
apps_response = requests.get(URL)
apps_response = requests.get(URL).json()
URL = NCE_APP_FLOW_DATA_URL
app_flows_response = requests.get(URL)
app_flows_response = requests.get(URL).json()
URL = AGG_TFS_IETF_SLICE_URL
ietf_slice_services = requests.get(URL)
ietf_slice_services = requests.get(URL).json()
URL = (
AGG_TFS_IETF_SLICE_URL
+ "/slice-service=dummy/connection-groups/connection-group=dummy"
)
ietf_slice_connection_groups = requests.get(URL)
ietf_slice_connection_groups = requests.get(URL).json()
app_name = apps_response["application"][0]["name"]
app_name = "App_Flow_2_1_slice1"
apps_diff = DeepDiff(apps_response[app_name], target_nce_apps[app_name])
app_flows_diff = DeepDiff(
app_flows_response[app_name],
......@@ -211,18 +208,18 @@ def test_ietf_slice_creation_removal():
requests.post(URL, headers=HEADERS, json=post_match_criteria_to_sdp1_in_slice1)
URL = NCE_APP_DATA_URL
apps_response = requests.get(URL)
apps_response = requests.get(URL).json()
URL = NCE_APP_FLOW_DATA_URL
app_flows_response = requests.get(URL)
app_flows_response = requests.get(URL).json()
URL = AGG_TFS_IETF_SLICE_URL
ietf_slice_services = requests.get(URL)
ietf_slice_services = requests.get(URL).json()
URL = (
AGG_TFS_IETF_SLICE_URL
+ "/slice-service=dummy/connection-groups/connection-group=dummy"
)
ietf_slice_connection_groups = requests.get(URL)
ietf_slice_connection_groups = requests.get(URL).json()
app_name = apps_response["application"][0]["name"]
app_name = "App_Flow_3_1_slice1"
apps_diff = DeepDiff(apps_response[app_name], target_nce_apps[app_name])
app_flows_diff = DeepDiff(
app_flows_response[app_name],
......@@ -245,18 +242,18 @@ def test_ietf_slice_creation_removal():
requests.post(URL, headers=HEADERS, json=post_network_slice2)
URL = NCE_APP_DATA_URL
apps_response = requests.get(URL)
apps_response = requests.get(URL).json()
URL = NCE_APP_FLOW_DATA_URL
app_flows_response = requests.get(URL)
app_flows_response = requests.get(URL).json()
URL = AGG_TFS_IETF_SLICE_URL
ietf_slice_services = requests.get(URL)
ietf_slice_services = requests.get(URL).json()
URL = (
AGG_TFS_IETF_SLICE_URL
+ "/slice-service=dummy/connection-groups/connection-group=dummy"
)
ietf_slice_connection_groups = requests.get(URL)
ietf_slice_connection_groups = requests.get(URL).json()
app_name = apps_response["application"][0]["name"]
app_name = "App_Flow_2_1_slice2"
apps_diff = DeepDiff(apps_response[app_name], target_nce_apps[app_name])
app_flows_diff = DeepDiff(
app_flows_response[app_name],
......@@ -267,7 +264,7 @@ def test_ietf_slice_creation_removal():
assert not app_flows_diff
assert len(apps_response) == 3 and len(app_flows_response) == 3
assert len(ietf_slice_connection_groups) == 0
assert len(ietf_slice_connection_groups) == 1
assert len(ietf_slice_services) == 2
slice_diff = DeepDiff(
ietf_slice_services["slice2"], target_ietf_slice_posted_slices[1]
......@@ -285,18 +282,18 @@ def test_ietf_slice_creation_removal():
requests.post(URL, headers=HEADERS, json=post_match_criteria_to_sdp1_in_slice2)
URL = NCE_APP_DATA_URL
apps_response = requests.get(URL)
apps_response = requests.get(URL).json()
URL = NCE_APP_FLOW_DATA_URL
app_flows_response = requests.get(URL)
app_flows_response = requests.get(URL).json()
URL = AGG_TFS_IETF_SLICE_URL
ietf_slice_services = requests.get(URL)
ietf_slice_services = requests.get(URL).json()
URL = (
AGG_TFS_IETF_SLICE_URL
+ "/slice-service=dummy/connection-groups/connection-group=dummy"
)
ietf_slice_connection_groups = requests.get(URL)
ietf_slice_connection_groups = requests.get(URL).json()
app_name = apps_response["application"][0]["name"]
app_name = "App_Flow_3_1_slice2"
apps_diff = DeepDiff(apps_response[app_name], target_nce_apps[app_name])
app_flows_diff = DeepDiff(
app_flows_response[app_name],
......@@ -315,7 +312,7 @@ def test_ietf_slice_creation_removal():
assert not connection_group_diff
# op 5
ietf_slices_full_retrieved = requests.get(BASE_IETF_SLICE_URL)
ietf_slices_full_retrieved = requests.get(BASE_IETF_SLICE_URL).json()
ietf_slice_data = DeepDiff(ietf_slices_full_retrieved, target_full_ietf_slice)
assert not ietf_slice_data
......@@ -334,16 +331,16 @@ def test_ietf_slice_creation_removal():
requests.delete(URL)
URL = NCE_APP_DATA_URL
apps_response = requests.get(URL)
apps_response = requests.get(URL).json()
URL = NCE_APP_FLOW_DATA_URL
app_flows_response = requests.get(URL)
app_flows_response = requests.get(URL).json()
URL = AGG_TFS_IETF_SLICE_URL
ietf_slice_services = requests.get(URL)
ietf_slice_services = requests.get(URL).json()
URL = (
AGG_TFS_IETF_SLICE_URL
+ "/slice-service=dummy/connection-groups/connection-group=dummy"
)
ietf_slice_connection_groups = requests.get(URL)
ietf_slice_connection_groups = requests.get(URL).json()
app_name = "App_Flow_2_1_slice1"
assert app_name not in apps_response
......@@ -373,16 +370,16 @@ def test_ietf_slice_creation_removal():
URL = BASE_IETF_SLICE_URL + "/slice-service=slice1/sdps/sdp=1"
URL = NCE_APP_DATA_URL
apps_response = requests.get(URL)
apps_response = requests.get(URL).json()
URL = NCE_APP_FLOW_DATA_URL
app_flows_response = requests.get(URL)
app_flows_response = requests.get(URL).json()
URL = AGG_TFS_IETF_SLICE_URL
ietf_slice_services = requests.get(URL)
ietf_slice_services = requests.get(URL).json()
URL = (
AGG_TFS_IETF_SLICE_URL
+ "/slice-service=dummy/connection-groups/connection-group=dummy"
)
ietf_slice_connection_groups = requests.get(URL)
ietf_slice_connection_groups = requests.get(URL).json()
requests.delete(URL)
URL = BASE_IETF_SLICE_URL + "/slice-service=slice1"
......@@ -412,16 +409,16 @@ def test_ietf_slice_creation_removal():
requests.delete(URL)
URL = NCE_APP_DATA_URL
apps_response = requests.get(URL)
apps_response = requests.get(URL).json()
URL = NCE_APP_FLOW_DATA_URL
app_flows_response = requests.get(URL)
app_flows_response = requests.get(URL).json()
URL = AGG_TFS_IETF_SLICE_URL
ietf_slice_services = requests.get(URL)
ietf_slice_services = requests.get(URL).json()
URL = (
AGG_TFS_IETF_SLICE_URL
+ "/slice-service=dummy/connection-groups/connection-group=dummy"
)
ietf_slice_connection_groups = requests.get(URL)
ietf_slice_connection_groups = requests.get(URL).json()
app_name = "App_Flow_2_1_slice2"
assert app_name not in apps_response
......@@ -450,16 +447,16 @@ def test_ietf_slice_creation_removal():
requests.delete(URL)
URL = NCE_APP_DATA_URL
apps_response = requests.get(URL)
apps_response = requests.get(URL).json()
URL = NCE_APP_FLOW_DATA_URL
app_flows_response = requests.get(URL)
app_flows_response = requests.get(URL).json()
URL = AGG_TFS_IETF_SLICE_URL
ietf_slice_services = requests.get(URL)
ietf_slice_services = requests.get(URL).json()
URL = (
AGG_TFS_IETF_SLICE_URL
+ "/slice-service=dummy/connection-groups/connection-group=dummy"
)
ietf_slice_connection_groups = requests.get(URL)
ietf_slice_connection_groups = requests.get(URL).json()
URL = BASE_IETF_SLICE_URL + "/slice-service=slice2/sdps/sdp=1"
requests.delete(URL)
......@@ -475,7 +472,7 @@ def test_ietf_slice_creation_removal():
assert len(ietf_slice_services) == 0
# op 10
ietf_slices_full_retrieved = requests.get(BASE_IETF_SLICE_URL)
ietf_slices_full_retrieved = requests.get(BASE_IETF_SLICE_URL).json()
empty_ietf_slices = {"network-slice-services": {"slice-service": []}}
ietf_slice_data = DeepDiff(ietf_slices_full_retrieved, empty_ietf_slices)
assert not ietf_slice_data
......@@ -37,7 +37,7 @@ def test_scenario_onboarding(
descriptors_file=DESCRIPTOR_FILE, context_client=context_client, device_client=device_client)
results = descriptor_loader.process()
check_descriptor_load_results(results, descriptor_loader)
descriptor_loader.validate()
# descriptor_loader.validate()
# Verify the scenario has no services/slices
response = context_client.GetContext(ADMIN_CONTEXT_ID)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment