From 82986d0a86606d37d5789d343f71b709fc97e256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Thu, 7 Sep 2023 17:04:09 -0400 Subject: [PATCH 1/2] Add use of monitoring/uss_qualifier for DSS probing --- .gitignore | 3 +- build/dev/probe_locally.sh | 46 ++++++++++++++- build/dev/probe_locally_configuration.yaml | 67 ++++++++++++++++++++++ 3 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 build/dev/probe_locally_configuration.yaml diff --git a/.gitignore b/.gitignore index 9268591f8..026e2665e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ coverage.xml .pytest_cache/ e2e_test_result test_result +build/dev/probe_locally_output # Translations *.mo @@ -128,4 +129,4 @@ test/e2e_test_result go # vscode files -.vscode \ No newline at end of file +.vscode diff --git a/build/dev/probe_locally.sh b/build/dev/probe_locally.sh index aaa239135..28543930b 100755 --- a/build/dev/probe_locally.sh +++ b/build/dev/probe_locally.sh @@ -35,6 +35,7 @@ RESULTFILE="$(pwd)/e2e_test_result" touch "${RESULTFILE}" cat /dev/null > "${RESULTFILE}" +echo "========== Running legacy DSS prober ==========" if ! docker run --link "$OAUTH_CONTAINER":oauth \ --link "$CORE_SERVICE_CONTAINER":core-service \ --network dss_sandbox-default \ @@ -53,7 +54,7 @@ if ! docker run --link "$OAUTH_CONTAINER":oauth \ --scd-api-version 1.0.0; then if [ "$CI" == "true" ]; then - echo "=== END OF TEST RESULTS ===" + echo "=== END OF LEGACY PROBER TEST RESULTS ===" echo "Dumping core-service logs" docker logs "$CORE_SERVICE_CONTAINER" fi @@ -62,3 +63,46 @@ if ! docker run --link "$OAUTH_CONTAINER":oauth \ else echo "Prober succeeded." fi + +# TODO: ugly non-optimized way of getting the code we need +git clone --recurse-submodules --branch uq_dss_probing git@github.com:Orbitalize/monitoring.git monitoring-repo-tmp +pushd monitoring-repo-tmp +make build-monitoring +popd +rm -rf monitoring-repo-tmp + +USS_QUALIFIER_CONF="$(pwd)/build/dev/probe_locally_configuration.yaml" +OUTPUT_DIR="$(pwd)/build/dev/probe_locally_output" +mkdir -p "$OUTPUT_DIR" + +start_time=$(date +%Y-%m-%dT%H:%M:%S) +echo "========== Running uss_qualifier for DSS probing ==========" +# shellcheck disable=SC2086 +docker run --name dss_probing \ + --rm \ + --link "$OAUTH_CONTAINER":oauth \ + --link "$CORE_SERVICE_CONTAINER":core-service \ + --network dss_sandbox-default \ + -u "$(id -u):$(id -g)" \ + -e PYTHONBUFFERED=1 \ + -e AUTH_SPEC='DummyOAuth(http://oauth:8085/token,sub=fake_uss)' \ + -e USS_QUALIFIER_STOP_FAST=true \ + -v "${OUTPUT_DIR}:/app/monitoring/uss_qualifier/output" \ + -v "${USS_QUALIFIER_CONF}:/app/monitoring/uss_qualifier/configurations/dev/dss_probing.yaml" \ + -w /app/monitoring/uss_qualifier \ + interuss/monitoring \ + python main.py --config configurations.dev.dss_probing + +# Set return code according to whether the test run was fully successful +successful=$(jq '.report | .[] | .successful' "${OUTPUT_DIR}/report_dss_probing.json") +if echo "${successful}" | grep -iqF true; then + echo "Full success indicated by DSS probing" +else + echo "Could not establish that the DSS probing passed" + if [ "$CI" == "true" ]; then + echo "=== END OF USS QUALIFIER TEST RESULTS ===" + echo "Dumping core-service logs" + docker logs "$CORE_SERVICE_CONTAINER" + fi + exit 1 +fi diff --git a/build/dev/probe_locally_configuration.yaml b/build/dev/probe_locally_configuration.yaml new file mode 100644 index 000000000..e7c09684f --- /dev/null +++ b/build/dev/probe_locally_configuration.yaml @@ -0,0 +1,67 @@ +# This is the configuration for the USS qualifier tool that probes the DSS, replacing the legacy prober tool. +v1: + test_run: + non_baseline_inputs: + - v1.test_run.resources.resource_declarations.utm_auth + - v1.test_run.resources.resource_declarations.netrid_dss_instance_v19 + - v1.test_run.resources.resource_declarations.netrid_dss_instance_v22a + resources: + resource_declarations: + utm_auth: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.communications.AuthAdapterResource + specification: + environment_variable_containing_auth_spec: AUTH_SPEC + id_generator: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.interuss.IDGeneratorResource + dependencies: + auth_adapter: utm_auth + specification: + whoami_audience: localhost + whoami_scope: rid.display_provider + isa: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.netrid.ServiceAreaResource + specification: + base_url: https://uss_qualifier.test.utm/dummy_base_url + footprint: + lat_min: 37.1853 + lng_min: -80.6140 + lat_max: 37.2148 + lng_max: -80.5440 + altitude_min: 0 + altitude_max: 3048 + netrid_dss_instance_v19: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.astm.f3411.DSSInstanceResource + dependencies: + auth_adapter: utm_auth + specification: + participant_id: uss1 + rid_version: F3411-19 + base_url: http://core-service:8082 + has_private_address: true + netrid_dss_instance_v22a: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.astm.f3411.DSSInstanceResource + dependencies: + auth_adapter: utm_auth + specification: + participant_id: uss1 + rid_version: F3411-22a + base_url: http://core-service:8082/rid/v2 + has_private_address: true + action: + test_suite: + suite_type: suites.interuss.dss_probing + resources: + netrid_dss_instance_v19: netrid_dss_instance_v19 + netrid_dss_instance_v22a: netrid_dss_instance_v22a + id_generator: id_generator + isa: isa + artifacts: + tested_roles: + report_path: output/tested_roles_dss_probing + report: + report_path: output/report_dss_probing.json From 46e0a49bbed0cbd7a3ec50cbcb71cb2189413255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Thu, 7 Sep 2023 17:09:14 -0400 Subject: [PATCH 2/2] remove unused variable --- build/dev/probe_locally.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build/dev/probe_locally.sh b/build/dev/probe_locally.sh index 28543930b..d44d9cc43 100755 --- a/build/dev/probe_locally.sh +++ b/build/dev/probe_locally.sh @@ -75,7 +75,6 @@ USS_QUALIFIER_CONF="$(pwd)/build/dev/probe_locally_configuration.yaml" OUTPUT_DIR="$(pwd)/build/dev/probe_locally_output" mkdir -p "$OUTPUT_DIR" -start_time=$(date +%Y-%m-%dT%H:%M:%S) echo "========== Running uss_qualifier for DSS probing ==========" # shellcheck disable=SC2086 docker run --name dss_probing \