Skip to content

Commit

Permalink
chore(testing):[#358] Update test data policy structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-jhartmann committed Apr 22, 2024
1 parent 9d98a84 commit e077c71
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion local/testing/testdata/CX_Testdata_v.1.7.0_PartType.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@type": "PolicyDefinitionRequestDto",
"@id": "id-3.1-trace",
"policy": {
"@type": "Policy",
"@type": "odrl:Set",
"odrl:permission": [
{
"odrl:action": "USE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
"@type": "PolicyDefinitionRequestDto",
"@id": "id-3.0-not-accepted",
"policy": {
"@type": "Policy",
"@type": "odrl:Set",
"odrl:permission": [
{
"odrl:action": "USE",
"odrl:constraint": {
"@type": "AtomicConstraint",
"odrl:or": [
{
"@type": "Constraint",
"odrl:leftOperand": "PURPOSE",
"odrl:operator": {
"@id": "odrl:eq"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@type": "PolicyDefinitionRequestDto",
"@id": "id-3.1-trace",
"policy": {
"@type": "Policy",
"@type": "odrl:Set",
"odrl:permission": [
{
"odrl:action": "USE",
Expand Down
2 changes: 1 addition & 1 deletion local/testing/testdata/ESS_Testdata_v2.0.0-AsPlanned.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@type": "PolicyDefinitionRequestDto",
"@id": "id-3.1-trace",
"policy": {
"@type": "Policy",
"@type": "odrl:Set",
"odrl:permission": [
{
"odrl:action": "USE",
Expand Down
24 changes: 23 additions & 1 deletion local/testing/testdata/transform-and-upload.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#!/usr/bin/python

# #############################################################################
# Copyright (c) 2022,2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# Copyright (c) 2021,2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://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, 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.
#
# SPDX-License-Identifier: Apache-2.0
# #############################################################################

import argparse
import json
import math
Expand Down Expand Up @@ -219,6 +239,8 @@ def print_response(response_):
print(response_)
if response_.status_code > 205:
print(response_.text)
if response_.status_code in [404, 401] or response_.status_code >= 500:
raise Exception("Failed to call service")


def check_url_args(submodel_server_upload_urls_, submodel_server_urls_, edc_upload_urls_, edc_urls_, dataplane_urls_):
Expand Down Expand Up @@ -642,7 +664,7 @@ def search_for_asset_in_catalog(edc_catalog_path_, edc_upload_url_, edc_url_, he
if is_aas3:
endpoint_address = f"{dataplane_url}{dataplane_public_path}/{submodel_identification}"
if is_ess and tmp_data["bpnl"] in bpnl_fail:
endpoint_address = f"http://idonotexist/{dataplane_public_path}/{submodel_identification}"
endpoint_address = f"http://idonotexist/{dataplane_public_path}/data/{submodel_identification}"
descriptor = create_submodel_descriptor_3_0(submodel_name, submodel_identification, semantic_id,
endpoint_address,
edc_asset_id,
Expand Down

0 comments on commit e077c71

Please sign in to comment.