# ============LICENSE_START===============================================
# Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
-# Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
+# Modifications Copyright (C) 2023-2025 OpenInfra Foundation Europe. All rights reserved.
# ========================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
a1pms_api_post_policy_v3 201 NOSERVICE ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json
a1pms_api_post_policy_v3 201 NOSERVICE ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT testdata/STD2/pi_qos2_template.json
+
+ if [ -n "$A1PMS_VALIDATE_INSTANCE_SCHEMA" ] && [ "$A1PMS_VALIDATE_INSTANCE_SCHEMA" = "true" ]; then
+ # Test for schema validation at create - should fail
+ a1pms_api_post_policy_v3 400 NOSERVICE ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT testdata/STD2/pi_qos2_bad_template.json
+ else
+ deviation "TR10 - policy create instance schema validation added after oslo, so not tested here - test combo $interface and $__httpx"
+ fi
+
fi
a1pms_api_put_service 201 "service10" 3600 "$CR_SERVICE_APP_PATH_0/1"
a1pms_api_put_policy_v3 200 5200 testdata/STD2/pi_qos2_template.json
+ if [ -n "$A1PMS_VALIDATE_INSTANCE_SCHEMA" ] && [ "$A1PMS_VALIDATE_INSTANCE_SCHEMA" = "true" ]; then
+ # Test for schema validation at update - should fail
+ a1pms_api_put_policy_v3 400 5200 testdata/STD2/pi_qos2_bad_template.json
+ else
+ deviation "TR10 - policy update instance schema validation added after oslo, so not tested here - test combo $interface and $__httpx"
+ fi
+
if [[ $interface != *"DMAAP"* ]]; then
a1pms_api_put_policy_v3 400 2000 testdata/OSC/pi_bad_template.json
fi
--- /dev/null
+{
+ "scope": {
+ "qosId": "qosXXX",
+ "randomField": "bad"
+ },
+ "qosObjectives": {
+ "priorityLevel": "XXX",
+ "priorityLev": "XXX",
+ "qosId": "qosXXX",
+ "non": "compliant"
+ },
+ "incorrectObject": {
+ "isCompliant": "no"
+ }
+}
\ No newline at end of file
#!/bin/bash
# ============LICENSE_START===============================================
-# Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.
+# Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
# ========================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
A1PMS_FEATURE_LEVEL="NO-DMAAP ADAPTER-CLASS" # Space separated list of features
A1PMS_ADAPTER_CLASS="" # Class name set by override file
A1PMS_ADAPTER_POLICY_NAME="" # Policy name set by override file
+A1PMS_VALIDATE_INSTANCE_SCHEMA="true" # Whether or not to perform schema validation on policy instance objects
ICS_APP_NAME="informationservice" # Name for ICS container
ICS_DISPLAY_NAME="Enrichment Coordinator Service" # Display name for ICS container
A1PMS_ADAPTER_POLICY_TYPE="" # Policy type set by override file
A1PMS_NOSDNC_ADAPTER_CLASS="" # Class name set by override file
A1PMS_SDNC_ADAPTER_CLASS="" # Class name set by override file
+A1PMS_VALIDATE_INSTANCE_SCHEMA="true" # Whether or not to perform schema validation on policy instance objects
ICS_APP_NAME="informationservice" # Name for ICS container
ICS_DISPLAY_NAME="Information Coordinator Service" # Display name for ICS container
################################################################################
# Copyright (c) 2020 Nordix Foundation. #
+# Modifications Copyright (C) 2025 OpenInfra Foundation Europe. #
+# All rights reserved. #
# #
-# Licensed under the Apache License, Version 2.0 (the \"License\"); #
+# Licensed under the Apache License, Version 2.0 (the \"License\"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
-# distributed under the License is distributed on an \"AS IS\" BASIS, #
+# distributed under the License is distributed on an \"AS IS\" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
http.proxy-host: $A1PMS_HTTP_PROXY_CONFIG_HOST_NAME
http.proxy-port: $A1PMS_HTTP_PROXY_CONFIG_PORT
http.proxy-type: HTTP
+ validate-policy-instance-schema: FAIL
auth-token-file: $A1PMS_SIDECAR_JWT_FILE
\ No newline at end of file