Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uss_qualifier] Switch default ASTM NETRID to v22a and reorganize CI tests #119

Merged
merged 13 commits into from
Jul 12, 2023
6 changes: 4 additions & 2 deletions .github/workflows/CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Steps:

Steps:

* test_docker_fully_mocked.sh
* test_docker_fully_mocked.sh with following configurations:
1. U-Space (configurations.dev.uspace)
2. ASTM NETRID v19 (configurations.dev.netrid_v19)

### prober tests (`make test` in monitoring/prober)
### prober tests (`make test` in monitoring/prober)
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,20 @@ jobs:
run: |
cd monitoring/mock_uss
make test
- name: uss_qualifier tests
- name: uss_qualifier tests - U-Space Test Suite
run: |
cd monitoring/uss_qualifier
make test
env:
RID_VERSION: F3411-22a
CONFIG_NAME: configurations.dev.local_test
- name: uss_qualifier tests - ASTM NetRID F3411-19 Test Suite
run: |
cd monitoring/uss_qualifier
make test
env:
RID_VERSION: F3411-19
CONFIG_NAME: configurations.dev.netrid_v19
- name: prober tests
run: |
cd monitoring/prober
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ collect-local-logs:
-docker logs atproxy > logs/atproxy.log 2>&1
-docker logs mock_uss_scdsc > logs/mock_uss_scdsc.log 2>&1
-docker logs mock_uss_ridsp > logs/mock_uss_ridsp.log 2>&1
-docker logs mock_uss_ridsp_v22a > logs/mock_uss_ridsp_v22a.log 2>&1
-docker logs mock_uss_riddp > logs/mock_uss_riddp.log 2>&1
-docker logs mock_uss_riddp_v22a > logs/mock_uss_riddp_v22a.log 2>&1
-docker logs mock_uss_geoawareness > logs/mock_uss_geoawareness.log 2>&1
-docker logs mock_uss_tracer > logs/mock_uss_tracer.log 2>&1
-docker logs mock_uss_tracer_v22a > logs/mock_uss_tracer_v22a.log 2>&1
-docker logs mock_uss_atproxy_client > logs/mock_uss_atproxy_client.log 2>&1

.PHONY: stop-locally
Expand Down
14 changes: 9 additions & 5 deletions monitoring/mock_uss/run_locally_riddp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,32 @@ if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then
fi

AUTH="DummyOAuth(http://host.docker.internal:8085/token,uss1)"
DSS="http://host.docker.internal:8082"
DSS=${MOCK_USS_DSS_URL:-"http://host.docker.internal:8082"}
RID_VERSION=${MOCK_USS_RID_VERSION:-"F3411-22a"}
PUBLIC_KEY="/var/test-certs/auth2.pem"
AUD=${MOCK_USS_TOKEN_AUDIENCE:-localhost,host.docker.internal}
container_name="mock_uss_riddp"
CONTAINER_NAME=${MOCK_CONTAINER_NAME:-"mock_uss_riddp"}

PORT=8073
PORT=${PORT:-8073}
BASE_URL="http://${MOCK_USS_TOKEN_AUDIENCE:-host.docker.internal}:${PORT}"

if [ "$CI" == "true" ]; then
docker_args="--add-host host.docker.internal:host-gateway" # Required to reach other containers in Ubuntu (used for Github Actions)
else
docker_args="-it"
fi

docker container rm -f ${container_name} || echo "No pre-existing ${container_name} container to remove"
docker container rm -f "${CONTAINER_NAME}" || echo "No pre-existing ${CONTAINER_NAME} container to remove"

# shellcheck disable=SC2086
docker run ${docker_args} --name ${container_name} \
docker run ${docker_args} --name "${CONTAINER_NAME}" \
-e MOCK_USS_AUTH_SPEC="${AUTH}" \
-e MOCK_USS_DSS_URL="${DSS}" \
-e MOCK_USS_BASE_URL="${BASE_URL}" \
-e MOCK_USS_PUBLIC_KEY="${PUBLIC_KEY}" \
-e MOCK_USS_TOKEN_AUDIENCE="${AUD}" \
-e MOCK_USS_SERVICES="riddp" \
-e MOCK_USS_RID_VERSION="${RID_VERSION}" \
-p ${PORT}:5000 \
-v "${SCRIPT_DIR}/../../build/test-certs:/var/test-certs:ro" \
"$@" \
Expand Down
11 changes: 11 additions & 0 deletions monitoring/mock_uss/run_locally_riddp_v19.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then
"${SCRIPT_DIR}/../build.sh" || exit 1
fi

MOCK_CONTAINER_NAME="mock_uss_riddp_v19" \
MOCK_USS_RID_VERSION="F3411-19" \
PORT=8083 \
"${SCRIPT_DIR}/run_locally_riddp.sh" "$@"
12 changes: 7 additions & 5 deletions monitoring/mock_uss/run_locally_ridsp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then
fi

AUTH="DummyOAuth(http://host.docker.internal:8085/token,uss1)"
DSS="http://host.docker.internal:8082"
DSS=${MOCK_USS_DSS_URL:-"http://host.docker.internal:8082"}
RID_VERSION=${MOCK_USS_RID_VERSION:-"F3411-22a"}
PUBLIC_KEY="/var/test-certs/auth2.pem"
AUD=${MOCK_USS_TOKEN_AUDIENCE:-localhost,host.docker.internal}
container_name="mock_uss_ridsp"
CONTAINER_NAME=${MOCK_CONTAINER_NAME:-"mock_uss_ridsp"}

PORT=8071
PORT=${PORT:-8071}
BASE_URL="http://${MOCK_USS_TOKEN_AUDIENCE:-host.docker.internal}:${PORT}"

if [ "$CI" == "true" ]; then
Expand All @@ -20,16 +21,17 @@ else
docker_args="-it"
fi

docker container rm -f ${container_name} || echo "No pre-existing ${container_name} container to remove"
docker container rm -f "${CONTAINER_NAME}" || echo "No pre-existing ${CONTAINER_NAME} container to remove"

# shellcheck disable=SC2086
docker run ${docker_args} --name ${container_name} \
docker run ${docker_args} --name "${CONTAINER_NAME}" \
-e MOCK_USS_AUTH_SPEC="${AUTH}" \
-e MOCK_USS_DSS_URL="${DSS}" \
-e MOCK_USS_PUBLIC_KEY="${PUBLIC_KEY}" \
-e MOCK_USS_TOKEN_AUDIENCE="${AUD}" \
-e MOCK_USS_BASE_URL="${BASE_URL}" \
-e MOCK_USS_SERVICES="ridsp" \
-e MOCK_USS_RID_VERSION="${RID_VERSION}" \
-p ${PORT}:5000 \
-v "${SCRIPT_DIR}/../../build/test-certs:/var/test-certs:ro" \
"$@" \
Expand Down
11 changes: 11 additions & 0 deletions monitoring/mock_uss/run_locally_ridsp_v19.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then
"${SCRIPT_DIR}/../build.sh" || exit 1
fi

MOCK_CONTAINER_NAME="mock_uss_ridsp_v19" \
MOCK_USS_RID_VERSION="F3411-19" \
PORT=8081 \
"${SCRIPT_DIR}/run_locally_ridsp.sh" "$@"
8 changes: 4 additions & 4 deletions monitoring/mock_uss/run_locally_scdsc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ AUTH="DummyOAuth(http://host.docker.internal:8085/token,uss1)"
DSS="http://host.docker.internal:8082"
PUBLIC_KEY="/var/test-certs/auth2.pem"
AUD=${MOCK_USS_TOKEN_AUDIENCE:-localhost,host.docker.internal}
container_name="mock_uss_scdsc"
CONTAINER_NAME=${CONTAINER_NAME:-"mock_uss_scdsc${PORT}"}

PORT=8074
PORT=${PORT:-8074}
BASE_URL="http://${MOCK_USS_TOKEN_AUDIENCE:-host.docker.internal}:${PORT}"

if [ "$CI" == "true" ]; then
Expand All @@ -20,10 +20,10 @@ else
docker_args="-it"
fi

docker container rm -f ${container_name} || echo "No pre-existing ${container_name} container to remove"
docker container rm -f "${CONTAINER_NAME}" || echo "No pre-existing ${CONTAINER_NAME} container to remove"

# shellcheck disable=SC2086
docker run ${docker_args} --name ${container_name} \
docker run ${docker_args} --name "${CONTAINER_NAME}" \
-e MOCK_USS_AUTH_SPEC="${AUTH}" \
-e MOCK_USS_DSS_URL="${DSS}" \
-e MOCK_USS_PUBLIC_KEY="${PUBLIC_KEY}" \
Expand Down
2 changes: 1 addition & 1 deletion monitoring/mock_uss/run_locally_tracer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DSS=${MOCK_USS_DSS_URL:-"http://host.docker.internal:8082"}
PUBLIC_KEY="/var/test-certs/auth2.pem"
AUD=${MOCK_USS_TOKEN_AUDIENCE:-localhost,host.docker.internal}

RID_VERSION=${MOCK_USS_RID_VERSION:-"F3411-19"}
RID_VERSION=${MOCK_USS_RID_VERSION:-"F3411-22a"}
CONTAINER_NAME=${MOCK_CONTAINER_NAME:-"mock_uss_tracer"}

BASE_URL="http://${MOCK_USS_TOKEN_AUDIENCE:-host.docker.internal}:${PORT}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then
"${SCRIPT_DIR}/../build.sh" || exit 1
fi

MOCK_CONTAINER_NAME="mock_uss_tracer_v22a" \
MOCK_USS_RID_VERSION="F3411-22a" \
MOCK_CONTAINER_NAME="mock_uss_tracer_v19" \
MOCK_USS_RID_VERSION="F3411-19" \
MOCK_USS_DSS_URL="http://host.docker.internal:8082" \
PORT=8088 \
"${SCRIPT_DIR}/run_locally_tracer.sh" "$@"
18 changes: 12 additions & 6 deletions monitoring/mock_uss/start_all_local_mocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ else
fi
cd "${BASEDIR}/../.." || exit 1

RID_VERSION=${RID_VERSION:-"F3411-22a"}
RID_EXT=""
if [ "$RID_VERSION" = "F3411-19" ]; then
RID_EXT="_v19"
fi

monitoring/mock_uss/run_locally_scdsc.sh -d
export DO_NOT_BUILD_MONITORING=true
monitoring/mock_uss/run_locally_ridsp.sh -d
monitoring/mock_uss/run_locally_riddp.sh -d
monitoring/mock_uss/run_locally_ridsp${RID_EXT}.sh -d
monitoring/mock_uss/run_locally_riddp${RID_EXT}.sh -d
monitoring/mock_uss/run_locally_geoawareness.sh -d
monitoring/mock_uss/run_locally_atproxy_client.sh -d
monitoring/mock_uss/run_locally_tracer.sh -d
monitoring/mock_uss/run_locally_tracer${RID_EXT}.sh -d
monitoring/mock_uss/wait_for_mock_uss.sh mock_uss_scdsc
monitoring/mock_uss/wait_for_mock_uss.sh mock_uss_ridsp
monitoring/mock_uss/wait_for_mock_uss.sh mock_uss_riddp
monitoring/mock_uss/wait_for_mock_uss.sh mock_uss_ridsp${RID_EXT}
monitoring/mock_uss/wait_for_mock_uss.sh mock_uss_riddp${RID_EXT}
monitoring/mock_uss/wait_for_mock_uss.sh mock_uss_geoawareness
monitoring/mock_uss/wait_for_mock_uss.sh mock_uss_tracer
monitoring/mock_uss/wait_for_mock_uss.sh mock_uss_tracer${RID_EXT}
8 changes: 7 additions & 1 deletion monitoring/mock_uss/stop_all_local_mocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ else
fi
cd "${BASEDIR}/../.." || exit 1

docker container rm -f mock_uss_scdsc mock_uss_ridsp mock_uss_riddp mock_uss_geoawareness mock_uss_atproxy_client mock_uss_tracer
RID_VERSION=${RID_VERSION:-"F3411-22a"}
RID_EXT=""
if [ "$RID_VERSION" = "F3411-19" ]; then
RID_EXT="_v19"
fi

docker container rm -f mock_uss_scdsc mock_uss_ridsp${RID_EXT} mock_uss_riddp${RID_EXT} mock_uss_geoawareness mock_uss_atproxy_client mock_uss_tracer${RID_EXT}
barroco marked this conversation as resolved.
Show resolved Hide resolved
33 changes: 31 additions & 2 deletions monitoring/uss_qualifier/configurations/dev/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,38 @@ common:
environment_variable_containing_auth_spec: AUTH_SPEC

net_rid:
netrid_service_providers:
netrid_service_providers_v19:
resource_type: resources.netrid.NetRIDServiceProviders
dependencies:
auth_adapter: utm_auth
specification:
service_providers:
- participant_id: uss1
injection_base_url: http://host.docker.internal:8071/ridsp/injection
netrid_observers:
netrid_service_providers_v22a:
resource_type: resources.netrid.NetRIDServiceProviders
dependencies:
auth_adapter: utm_auth
specification:
service_providers:
- participant_id: uss1
injection_base_url: http://host.docker.internal:8081/ridsp/injection
netrid_observers_v19:
resource_type: resources.netrid.NetRIDObserversResource
dependencies:
auth_adapter: utm_auth
specification:
observers:
- participant_id: uss2
observation_base_url: http://host.docker.internal:8073/riddp/observation
netrid_observers_v22a:
resource_type: resources.netrid.NetRIDObserversResource
dependencies:
auth_adapter: utm_auth
specification:
observers:
- participant_id: uss2
observation_base_url: http://host.docker.internal:8083/riddp/observation
netrid_dss_instances_v19:
resource_type: resources.astm.f3411.DSSInstancesResource
dependencies:
Expand All @@ -35,6 +51,18 @@ net_rid:
- participant_id: uss2
rid_version: F3411-19
base_url: http://host.docker.internal:8082
netrid_dss_instances_v22a:
resource_type: resources.astm.f3411.DSSInstancesResource
dependencies:
auth_adapter: utm_auth
specification:
dss_instances:
- participant_id: uss1
rid_version: F3411-22a
base_url: http://host.docker.internal:8082/rid/v2/
- participant_id: uss2
rid_version: F3411-22a
base_url: http://host.docker.internal:8082/rid/v2/

f3548:
flight_planners:
Expand All @@ -49,6 +77,7 @@ f3548:
# uss2 uses atproxy, with requests being fulfilled by mock_uss with atproxy_client functionality enabled
- participant_id: uss2
injection_base_url: http://host.docker.internal:8075/scd

dss:
resource_type: resources.astm.f3548.v21.DSSInstanceResource
dependencies:
Expand Down
6 changes: 3 additions & 3 deletions monitoring/uss_qualifier/configurations/dev/local_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"adjacent_circular_storage_config": "adjacent_circular_storage_config",
"kml_flights_data": "kml_flights_data",
"kml_storage_config": "kml_storage_config",
"service_providers": "netrid_service_providers",
"observers": "netrid_observers",
"service_providers": "netrid_service_providers_v22a",
"observers": "netrid_observers_v22a",
"evaluation_configuration": "netrid_observation_evaluation_configuration",
"flight_planners": "flight_planners",
"conflicting_flights": "conflicting_flights",
"priority_preemption_flights": "priority_preemption_flights",
"invalid_flight_intents": "invalid_flight_intents",
"invalid_flight_auth_flights": "invalid_flight_auth_flights",
"dss": "dss",
"netrid_dss_instances_v19": "netrid_dss_instances_v19"
"netrid_dss_instances_v22a": "netrid_dss_instances_v22a"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ v1:
dss_instances:
- participant_id: uss1
rid_version: F3411-19
base_url: http://host.docker.internal:8082/rid/v2
base_url: http://host.docker.internal:8082
action:
test_suite:
suite_type: suites.astm.netrid.f3411_19
Expand Down
4 changes: 2 additions & 2 deletions monitoring/uss_qualifier/configurations/dev/netrid_v22a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ v1:
specification:
service_providers:
- participant_id: uss1
injection_base_url: http://host.docker.internal:8071/ridsp/injection
injection_base_url: http://host.docker.internal:8081/ridsp/injection # USS mock ridsp_v22a
observers:
resource_type: resources.netrid.NetRIDObserversResource
dependencies:
auth_adapter: utm_auth
specification:
observers:
- participant_id: uss2
observation_base_url: http://host.docker.internal:8073/riddp/observation
observation_base_url: http://host.docker.internal:8083/riddp/observation # USS mock riddp_v22a
observation_evaluation_configuration:
resource_type: resources.netrid.EvaluationConfigurationResource
specification: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"adjacent_circular_storage_config": "adjacent_circular_storage_config",
"kml_flights_data": "kml_flights_data",
"kml_storage_config": "kml_storage_config",
"service_providers": "netrid_service_providers",
"observers": "netrid_observers",
"service_providers": "netrid_service_providers_v22a",
"observers": "netrid_observers_v22a",
"evaluation_configuration": "netrid_observation_evaluation_configuration",
"flight_planners": "flight_planners",
"conflicting_flights": "conflicting_flights",
"priority_preemption_flights": "priority_preemption_flights",
"invalid_flight_auth_flights": "invalid_flight_auth_flights",
"dss": "dss",
"netrid_dss_instances_v19": "netrid_dss_instances_v19"
"netrid_dss_instances_v22a": "netrid_dss_instances_v22a"
}
}
}
Expand All @@ -41,14 +41,14 @@
},
{
"name": "Service Provider role",
"requirement_set": "astm.f3411.v19.service_provider",
"requirement_set": "astm.f3411.v22a.service_provider",
"participants": [
"uss1"
]
},
{
"name": "Display Provider role",
"requirement_set": "astm.f3411.v19.service_provider",
"requirement_set": "astm.f3411.v22a.service_provider",
"participants": [
"uss2"
]
Expand Down
Loading