Actions - use client labeled self-hosted runners #33
4 errors, 13 pass in 54s
Annotations
Check failure on line 66 in edge/test_pt_example.py
github-actions / mbed-edge-examples-result
test_00_edge_endpoint_registration (edge.test_pt_example.TestPtExample) with error
result.xml [took 32s]
Raw output
failed on setup with "AssertionError: ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
Expected result 204 -> actual response was: 400
Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:04 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c2048c1a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}"
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox'
request = <SubRequest 'callback' for <Function test_00_edge_endpoint_registration>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
@pytest.fixture(scope='function')
def callback(cloud_api, new_temp_test_case_developer_api_key, request, tc_config_data):
"""
Callback channel fixture
"""
> handler = set_callback(cloud_api, new_temp_test_case_developer_api_key, request, tc_config_data)
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox'
request = <SubRequest 'callback' for <Function test_00_edge_endpoint_registration>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
systemtest-library/pelion_systest_lib/fixtures/notification_fixtures.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
systemtest-library/pelion_systest_lib/fixtures/notification_fixtures.py:66: in set_callback
cloud_api.connect.register_callback_url(data, api_key=new_temp_test_case_developer_api_key,
callback_handler_address = 'https://callback-prod.kiiskila.cc'
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
data = {'headers': {'X-Customer': 'test_00_edge_endpoint_registration_EbLGlOUM'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox'
request = <SubRequest 'callback' for <Function test_00_edge_endpoint_registration>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
test_name = 'test_00_edge_endpoint_registration_EbLGlOUM'
systemtest-library/pelion_systest_lib/cloud/libraries/connect.py:35: in register_callback_url
return self.cloud_api.put(api_url, api_key, webhook_data, expected_status_code=expected_status_code)
api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox'
api_url = '/v2/notification/callback'
expected_status_code = 204
self = <pelion_systest_lib.cloud.libraries.connect.ConnectAPI object at 0x7fab8069bdf0>
webhook_data = {'headers': {'X-Customer': 'test_00_edge_endpoint_registration_EbLGlOUM'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
systemtest-library/pelion_systest_lib/cloud/libraries/rest_api/rest_api.py:364: in put
return self._do_request('put', url, request_headers, request_data=request_data,
api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox'
api_url = '/v2/notification/callback'
content_type = None
expected_status_code = 204
key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox'
kwargs = {}
payload = {'headers': {'X-Customer': 'test_00_edge_endpoint_registration_EbLGlOUM'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
request_data = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_00_edge_endpoint_registration_EbLGlOUM"}}'
request_headers = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
self = <pelion_systest_lib.cloud.libraries.rest_api.rest_api.RestAPI object at 0x7fab8069baf0>
url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
systemtest-library/pelion_systest_lib/cloud/libraries/rest_api/rest_api.py:223: in _do_request
assert_status(r, inspect.stack()[1][3].upper(), expected_status_code, api_url)
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
api_url_stats = {'https://api.us-east-1.mbedcloud.com/v2/notification/callback': 1, 'https://api.us-east-1.mbedcloud.com/v3/api-keys': 1, 'https://api.us-east-1.mbedcloud.com/v3/policy-groups': 1}
certificate = None
expected_status_code = 204
files = None
http_code_pack = '4XX'
kwargs = {}
log_head = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
logged_payload = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_00_edge_endpoint_registration_EbLGlOUM"}}'
method = 'put'
r = <Response [400]>
request_data = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_00_edge_endpoint_registration_EbLGlOUM"}}'
request_headers = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1c38b2a8153e11f7000000000ABJssRGGOiNjxejKf9Wq1rK8q7NT3Pox', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
self = <pelion_systest_lib.cloud.libraries.rest_api.rest_api.RestAPI object at 0x7fab8069baf0>
status_codes = {'2XX': 2, '4XX': 1}
time_end = 1707213964.829369
time_start = 1707213964.2206948
timeout = 10
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [400]>, func = 'PUT', expected_resp = 204
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
def assert_status(response, func, expected_resp, api_url=''):
"""
Function for asserting response and creating proper msg on fail situation
:param response: Rest API response
:param func: Calling function
:param expected_resp: Expected response or list of expected responses
:param api_url: Called rest API url
"""
if _assert_status(expected_resp, response) is False:
error_msg = 'ERROR: "{}" {} failed!\n' \
'Expected result {} -> actual response was: {}\n\n' \
'Response body: {}\n' \
'Response headers: {}'.format(func,
api_url,
expected_resp,
response.status_code,
response.text,
response.headers)
log.error(error_msg)
> assert False, error_msg
E AssertionError: ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
E Expected result 204 -> actual response was: 400
E
E Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
E Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:04 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c2048c1a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
error_msg = 'ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!\nExpected result 204 -> actual resp...Content-Length,Content-Disposition\', \'Strict-Transport-Security\': \'max-age=10886400; includeSubDomains; preload\'}'
expected_resp = 204
func = 'PUT'
response = <Response [400]>
systemtest-library/pelion_systest_lib/tools/utils.py:107: AssertionError
--------------------------------- Captured Log ---------------------------------
10:05:32.877 INFO Using account and api key defined in config json prod-edge-core-config.json
10:05:32.877 INFO Cloud API object initialized for https://api.us-east-1.mbedcloud.com and account id 0158778f9f1002420a014c1100000000
10:05:32.883 INFO Executing local command: kubectl config use-context edge-k8s
10:05:33.034 INFO stdout Switched to context "edge-k8s".
10:05:33.035 INFO stderr
10:05:33.040 INFO Executing command: curl -s -S localhost:8080/status
10:05:33.078 INFO stdout: {"account-id":"0158778f9f1002420a014c1100000000","edge-version":"0.21.0-HEAD-df99b7d62295a883ade4c33602c4388207297b99-","endpoint-name":"018d7de0108a1ae716814c8b00000000","internal-id":"018d7de0108a1ae716814c8b00000000","lwm2m-server-uri":"coaps://tcp-lwm2m.us-east-1.mbedcloud.com:5684?aid=0158778f9f1002420a014c1100000000&iep=018d7de0108a1ae716814c8b00000000","status":"connected"}
10:05:33.079 INFO stderr:
10:05:33.081 INFO Executing command: curl -s -S localhost:8080/status
10:05:33.130 INFO stdout: {"account-id":"0158778f9f1002420a014c1100000000","edge-version":"0.21.0-HEAD-df99b7d62295a883ade4c33602c4388207297b99-","endpoint-name":"018d7de0108a1ae716814c8b00000000","internal-id":"018d7de0108a1ae716814c8b00000000","lwm2m-server-uri":"coaps://tcp-lwm2m.us-east-1.mbedcloud.com:5684?aid=0158778f9f1002420a014c1100000000&iep=018d7de0108a1ae716814c8b00000000","status":"connected"}
10:05:33.132 INFO stderr:
10:05:33.133 INFO Executing command: curl -s -S localhost:8080/status
10:05:33.182 INFO stdout: {"account-id":"0158778f9f1002420a014c1100000000","edge-version":"0.21.0-HEAD-df99b7d62295a883ade4c33602c4388207297b99-","endpoint-name":"018d7de0108a1ae716814c8b00000000","internal-id":"018d7de0108a1ae716814c8b00000000","lwm2m-server-uri":"coaps://tcp-lwm2m.us-east-1.mbedcloud.com:5684?aid=0158778f9f1002420a014c1100000000&iep=018d7de0108a1ae716814c8b00000000","status":"connected"}
10:05:33.183 INFO stderr:
10:05:33.184 INFO Edge is successfully connected
10:05:33.186 INFO Sleep for 30 second(s)
10:06:03.218 INFO Creating new developer api key for test case
10:06:03.547 INFO GET https://api.us-east-1.mbedcloud.com/v3/policy-groups - Response: 200 - X-Request-ID: 000065c2048b1a84c58c44e800000000
10:06:04.206 INFO POST https://api.us-east-1.mbedcloud.com/v3/api-keys - Response: 201 - X-Request-ID: 000065c2048cfac4b192ea3600000000
10:06:04.217 INFO Created new developer api key for test case, id: 018d7de1c38b2a8153e11f7000000000
10:06:04.219 INFO Register and open web callback notification channel for test_00_edge_endpoint_registration_EbLGlOUM
10:06:04.830 INFO PUT https://api.us-east-1.mbedcloud.com/v2/notification/callback - Response: 400 - X-Request-ID: 000065c2048c1a84c58c44e800000000
10:06:04.838 ERROR ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
Expected result 204 -> actual response was: 400
Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:04 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c2048c1a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}
10:06:04.950 INFO Cleaning out the generated test case developer api key, id: 018d7de1c38b2a8153e11f7000000000
10:06:05.207 INFO DELETE https://api.us-east-1.mbedcloud.com/v3/api-keys/018d7de1c38b2a8153e11f7000000000 - Response: 204 - X-Request-ID: 000065c2048dfac4b192ea3600000000
--------------------------------- Captured Out ---------------------------------
--------------------------------- Captured Err ---------------------------------
Check failure on line 153 in edge/test_pt_example.py
github-actions / mbed-edge-examples-result
test_05_reset_pt_example_cpu_temperature_min_max_value (edge.test_pt_example.TestPtExample) with error
result.xml [took 1s]
Raw output
failed on setup with "AssertionError: ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
Expected result 204 -> actual response was: 400
Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:14 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204961a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}"
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ'
request = <SubRequest 'callback' for <Function test_05_reset_pt_example_cpu_temperature_min_max_value>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
@pytest.fixture(scope='function')
def callback(cloud_api, new_temp_test_case_developer_api_key, request, tc_config_data):
"""
Callback channel fixture
"""
> handler = set_callback(cloud_api, new_temp_test_case_developer_api_key, request, tc_config_data)
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ'
request = <SubRequest 'callback' for <Function test_05_reset_pt_example_cpu_temperature_min_max_value>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
systemtest-library/pelion_systest_lib/fixtures/notification_fixtures.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
systemtest-library/pelion_systest_lib/fixtures/notification_fixtures.py:66: in set_callback
cloud_api.connect.register_callback_url(data, api_key=new_temp_test_case_developer_api_key,
callback_handler_address = 'https://callback-prod.kiiskila.cc'
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
data = {'headers': {'X-Customer': 'test_05_reset_pt_example_cpu_temperature_min_max_value_QQmBVGpJ'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ'
request = <SubRequest 'callback' for <Function test_05_reset_pt_example_cpu_temperature_min_max_value>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
test_name = 'test_05_reset_pt_example_cpu_temperature_min_max_value_QQmBVGpJ'
systemtest-library/pelion_systest_lib/cloud/libraries/connect.py:35: in register_callback_url
return self.cloud_api.put(api_url, api_key, webhook_data, expected_status_code=expected_status_code)
api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ'
api_url = '/v2/notification/callback'
expected_status_code = 204
self = <pelion_systest_lib.cloud.libraries.connect.ConnectAPI object at 0x7fab8069bdf0>
webhook_data = {'headers': {'X-Customer': 'test_05_reset_pt_example_cpu_temperature_min_max_value_QQmBVGpJ'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
systemtest-library/pelion_systest_lib/cloud/libraries/rest_api/rest_api.py:364: in put
return self._do_request('put', url, request_headers, request_data=request_data,
api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ'
api_url = '/v2/notification/callback'
content_type = None
expected_status_code = 204
key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ'
kwargs = {}
payload = {'headers': {'X-Customer': 'test_05_reset_pt_example_cpu_temperature_min_max_value_QQmBVGpJ'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
request_data = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_05_reset_pt_example_cpu_temperature_min_max_value_QQmBVGpJ"}}'
request_headers = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
self = <pelion_systest_lib.cloud.libraries.rest_api.rest_api.RestAPI object at 0x7fab8069baf0>
url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
systemtest-library/pelion_systest_lib/cloud/libraries/rest_api/rest_api.py:223: in _do_request
assert_status(r, inspect.stack()[1][3].upper(), expected_status_code, api_url)
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
api_url_stats = {'https://api.us-east-1.mbedcloud.com/v2/notification/callback': 2, 'https://api.us-east-1.mbedcloud.com/v3/api-keys':...edcloud.com/v3/api-keys/018d7de1c38b2a8153e11f7000000000': 1, 'https://api.us-east-1.mbedcloud.com/v3/devices': 1, ...}
certificate = None
expected_status_code = 204
files = None
http_code_pack = '4XX'
kwargs = {}
log_head = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
logged_payload = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_05_reset_pt_example_cpu_temperature_min_max_value_QQmBVGpJ"}}'
method = 'put'
r = <Response [400]>
request_data = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_05_reset_pt_example_cpu_temperature_min_max_value_QQmBVGpJ"}}'
request_headers = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1eaa32a8153e11f7000000000LS7IwL1BA8nmYnj6FKqSZhea9xardqWZ', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
self = <pelion_systest_lib.cloud.libraries.rest_api.rest_api.RestAPI object at 0x7fab8069baf0>
status_codes = {'2XX': 33, '4XX': 2}
time_end = 1707213974.5837417
time_start = 1707213974.2277038
timeout = 10
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [400]>, func = 'PUT', expected_resp = 204
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
def assert_status(response, func, expected_resp, api_url=''):
"""
Function for asserting response and creating proper msg on fail situation
:param response: Rest API response
:param func: Calling function
:param expected_resp: Expected response or list of expected responses
:param api_url: Called rest API url
"""
if _assert_status(expected_resp, response) is False:
error_msg = 'ERROR: "{}" {} failed!\n' \
'Expected result {} -> actual response was: {}\n\n' \
'Response body: {}\n' \
'Response headers: {}'.format(func,
api_url,
expected_resp,
response.status_code,
response.text,
response.headers)
log.error(error_msg)
> assert False, error_msg
E AssertionError: ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
E Expected result 204 -> actual response was: 400
E
E Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
E Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:14 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204961a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
error_msg = 'ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!\nExpected result 204 -> actual resp...Content-Length,Content-Disposition\', \'Strict-Transport-Security\': \'max-age=10886400; includeSubDomains; preload\'}'
expected_resp = 204
func = 'PUT'
response = <Response [400]>
systemtest-library/pelion_systest_lib/tools/utils.py:107: AssertionError
--------------------------------- Captured Log ---------------------------------
10:06:13.601 INFO Creating new developer api key for test case
10:06:13.905 INFO GET https://api.us-east-1.mbedcloud.com/v3/policy-groups - Response: 200 - X-Request-ID: 000065c20495fac4b192ea3600000002
10:06:14.214 INFO POST https://api.us-east-1.mbedcloud.com/v3/api-keys - Response: 201 - X-Request-ID: 000065c20496fac4b192ea3600000000
10:06:14.224 INFO Created new developer api key for test case, id: 018d7de1eaa32a8153e11f7000000000
10:06:14.226 INFO Register and open web callback notification channel for test_05_reset_pt_example_cpu_temperature_min_max_value_QQmBVGpJ
10:06:14.584 INFO PUT https://api.us-east-1.mbedcloud.com/v2/notification/callback - Response: 400 - X-Request-ID: 000065c204961a84c58c44e800000000
10:06:14.591 ERROR ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
Expected result 204 -> actual response was: 400
Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:14 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204961a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}
10:06:14.688 INFO Cleaning out the generated test case developer api key, id: 018d7de1eaa32a8153e11f7000000000
10:06:14.984 INFO DELETE https://api.us-east-1.mbedcloud.com/v3/api-keys/018d7de1eaa32a8153e11f7000000000 - Response: 204 - X-Request-ID: 000065c20496fac4b192ea3600000002
--------------------------------- Captured Out ---------------------------------
--------------------------------- Captured Err ---------------------------------
Check failure on line 171 in edge/test_pt_example.py
github-actions / mbed-edge-examples-result
test_06_read_pt_example_cpu_temperature_min_max_value (edge.test_pt_example.TestPtExample) with error
result.xml [took 1s]
Raw output
failed on setup with "AssertionError: ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
Expected result 204 -> actual response was: 400
Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:15 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204971a84c58c44e800000001', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}"
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8'
request = <SubRequest 'callback' for <Function test_06_read_pt_example_cpu_temperature_min_max_value>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
@pytest.fixture(scope='function')
def callback(cloud_api, new_temp_test_case_developer_api_key, request, tc_config_data):
"""
Callback channel fixture
"""
> handler = set_callback(cloud_api, new_temp_test_case_developer_api_key, request, tc_config_data)
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8'
request = <SubRequest 'callback' for <Function test_06_read_pt_example_cpu_temperature_min_max_value>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
systemtest-library/pelion_systest_lib/fixtures/notification_fixtures.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
systemtest-library/pelion_systest_lib/fixtures/notification_fixtures.py:66: in set_callback
cloud_api.connect.register_callback_url(data, api_key=new_temp_test_case_developer_api_key,
callback_handler_address = 'https://callback-prod.kiiskila.cc'
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
data = {'headers': {'X-Customer': 'test_06_read_pt_example_cpu_temperature_min_max_value_mbINkrdA'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8'
request = <SubRequest 'callback' for <Function test_06_read_pt_example_cpu_temperature_min_max_value>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
test_name = 'test_06_read_pt_example_cpu_temperature_min_max_value_mbINkrdA'
systemtest-library/pelion_systest_lib/cloud/libraries/connect.py:35: in register_callback_url
return self.cloud_api.put(api_url, api_key, webhook_data, expected_status_code=expected_status_code)
api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8'
api_url = '/v2/notification/callback'
expected_status_code = 204
self = <pelion_systest_lib.cloud.libraries.connect.ConnectAPI object at 0x7fab8069bdf0>
webhook_data = {'headers': {'X-Customer': 'test_06_read_pt_example_cpu_temperature_min_max_value_mbINkrdA'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
systemtest-library/pelion_systest_lib/cloud/libraries/rest_api/rest_api.py:364: in put
return self._do_request('put', url, request_headers, request_data=request_data,
api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8'
api_url = '/v2/notification/callback'
content_type = None
expected_status_code = 204
key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8'
kwargs = {}
payload = {'headers': {'X-Customer': 'test_06_read_pt_example_cpu_temperature_min_max_value_mbINkrdA'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
request_data = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_06_read_pt_example_cpu_temperature_min_max_value_mbINkrdA"}}'
request_headers = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
self = <pelion_systest_lib.cloud.libraries.rest_api.rest_api.RestAPI object at 0x7fab8069baf0>
url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
systemtest-library/pelion_systest_lib/cloud/libraries/rest_api/rest_api.py:223: in _do_request
assert_status(r, inspect.stack()[1][3].upper(), expected_status_code, api_url)
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
api_url_stats = {'https://api.us-east-1.mbedcloud.com/v2/notification/callback': 3, 'https://api.us-east-1.mbedcloud.com/v3/api-keys':...8b2a8153e11f7000000000': 1, 'https://api.us-east-1.mbedcloud.com/v3/api-keys/018d7de1eaa32a8153e11f7000000000': 1, ...}
certificate = None
expected_status_code = 204
files = None
http_code_pack = '4XX'
kwargs = {}
log_head = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
logged_payload = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_06_read_pt_example_cpu_temperature_min_max_value_mbINkrdA"}}'
method = 'put'
r = <Response [400]>
request_data = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_06_read_pt_example_cpu_temperature_min_max_value_mbINkrdA"}}'
request_headers = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f01a2a8153e11f7000000000R4Lw9HaMduhFiJ6ZllADtJFW0BCZZ3D8', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
self = <pelion_systest_lib.cloud.libraries.rest_api.rest_api.RestAPI object at 0x7fab8069baf0>
status_codes = {'2XX': 36, '4XX': 3}
time_end = 1707213975.9920228
time_start = 1707213975.624723
timeout = 10
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [400]>, func = 'PUT', expected_resp = 204
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
def assert_status(response, func, expected_resp, api_url=''):
"""
Function for asserting response and creating proper msg on fail situation
:param response: Rest API response
:param func: Calling function
:param expected_resp: Expected response or list of expected responses
:param api_url: Called rest API url
"""
if _assert_status(expected_resp, response) is False:
error_msg = 'ERROR: "{}" {} failed!\n' \
'Expected result {} -> actual response was: {}\n\n' \
'Response body: {}\n' \
'Response headers: {}'.format(func,
api_url,
expected_resp,
response.status_code,
response.text,
response.headers)
log.error(error_msg)
> assert False, error_msg
E AssertionError: ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
E Expected result 204 -> actual response was: 400
E
E Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
E Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:15 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204971a84c58c44e800000001', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
error_msg = 'ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!\nExpected result 204 -> actual resp...Content-Length,Content-Disposition\', \'Strict-Transport-Security\': \'max-age=10886400; includeSubDomains; preload\'}'
expected_resp = 204
func = 'PUT'
response = <Response [400]>
systemtest-library/pelion_systest_lib/tools/utils.py:107: AssertionError
--------------------------------- Captured Log ---------------------------------
10:06:15.001 INFO Creating new developer api key for test case
10:06:15.302 INFO GET https://api.us-east-1.mbedcloud.com/v3/policy-groups - Response: 200 - X-Request-ID: 000065c204971a84c58c44e800000000
10:06:15.611 INFO POST https://api.us-east-1.mbedcloud.com/v3/api-keys - Response: 201 - X-Request-ID: 000065c20497fac4b192ea3600000000
10:06:15.621 INFO Created new developer api key for test case, id: 018d7de1f01a2a8153e11f7000000000
10:06:15.623 INFO Register and open web callback notification channel for test_06_read_pt_example_cpu_temperature_min_max_value_mbINkrdA
10:06:15.992 INFO PUT https://api.us-east-1.mbedcloud.com/v2/notification/callback - Response: 400 - X-Request-ID: 000065c204971a84c58c44e800000001
10:06:15.999 ERROR ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
Expected result 204 -> actual response was: 400
Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:15 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204971a84c58c44e800000001', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}
10:06:16.098 INFO Cleaning out the generated test case developer api key, id: 018d7de1f01a2a8153e11f7000000000
10:06:16.376 INFO DELETE https://api.us-east-1.mbedcloud.com/v3/api-keys/018d7de1f01a2a8153e11f7000000000 - Response: 204 - X-Request-ID: 000065c204981a84c58c44e800000000
--------------------------------- Captured Out ---------------------------------
--------------------------------- Captured Err ---------------------------------
Check failure on line 193 in edge/test_pt_example.py
github-actions / mbed-edge-examples-result
test_07_read_pt_example_cpu_temperature (edge.test_pt_example.TestPtExample) with error
result.xml [took 11s]
Raw output
failed on setup with "AssertionError: ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
Expected result 204 -> actual response was: 400
Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:17 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204991a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}"
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh'
request = <SubRequest 'callback' for <Function test_07_read_pt_example_cpu_temperature>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
@pytest.fixture(scope='function')
def callback(cloud_api, new_temp_test_case_developer_api_key, request, tc_config_data):
"""
Callback channel fixture
"""
> handler = set_callback(cloud_api, new_temp_test_case_developer_api_key, request, tc_config_data)
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh'
request = <SubRequest 'callback' for <Function test_07_read_pt_example_cpu_temperature>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
systemtest-library/pelion_systest_lib/fixtures/notification_fixtures.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
systemtest-library/pelion_systest_lib/fixtures/notification_fixtures.py:66: in set_callback
cloud_api.connect.register_callback_url(data, api_key=new_temp_test_case_developer_api_key,
callback_handler_address = 'https://callback-prod.kiiskila.cc'
cloud_api = <pelion_systest_lib.cloud.cloud.PelionCloud object at 0x7fab8069bbe0>
data = {'headers': {'X-Customer': 'test_07_read_pt_example_cpu_temperature_FLhDPfLY'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
new_temp_test_case_developer_api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh'
request = <SubRequest 'callback' for <Function test_07_read_pt_example_cpu_temperature>>
tc_config_data = {'account_id': '0158778f9f1002420a014c1100000000', 'api_gw': 'https://api.us-east-1.mbedcloud.com', 'api_key': 'ak_1MD...827b29870c7655b000000001iu6IZYbh3LFn3KqvRqRs6vsLm9UrcDH', 'callback_handler': 'https://callback-prod.kiiskila.cc', ...}
test_name = 'test_07_read_pt_example_cpu_temperature_FLhDPfLY'
systemtest-library/pelion_systest_lib/cloud/libraries/connect.py:35: in register_callback_url
return self.cloud_api.put(api_url, api_key, webhook_data, expected_status_code=expected_status_code)
api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh'
api_url = '/v2/notification/callback'
expected_status_code = 204
self = <pelion_systest_lib.cloud.libraries.connect.ConnectAPI object at 0x7fab8069bdf0>
webhook_data = {'headers': {'X-Customer': 'test_07_read_pt_example_cpu_temperature_FLhDPfLY'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
systemtest-library/pelion_systest_lib/cloud/libraries/rest_api/rest_api.py:364: in put
return self._do_request('put', url, request_headers, request_data=request_data,
api_key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh'
api_url = '/v2/notification/callback'
content_type = None
expected_status_code = 204
key = 'ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh'
kwargs = {}
payload = {'headers': {'X-Customer': 'test_07_read_pt_example_cpu_temperature_FLhDPfLY'}, 'url': 'https://callback-prod.kiiskila.cc/callback'}
request_data = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_07_read_pt_example_cpu_temperature_FLhDPfLY"}}'
request_headers = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
self = <pelion_systest_lib.cloud.libraries.rest_api.rest_api.RestAPI object at 0x7fab8069baf0>
url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
systemtest-library/pelion_systest_lib/cloud/libraries/rest_api/rest_api.py:223: in _do_request
assert_status(r, inspect.stack()[1][3].upper(), expected_status_code, api_url)
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
api_url_stats = {'https://api.us-east-1.mbedcloud.com/v2/notification/callback': 4, 'https://api.us-east-1.mbedcloud.com/v3/api-keys':...8b2a8153e11f7000000000': 1, 'https://api.us-east-1.mbedcloud.com/v3/api-keys/018d7de1eaa32a8153e11f7000000000': 1, ...}
certificate = None
expected_status_code = 204
files = None
http_code_pack = '4XX'
kwargs = {}
log_head = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
logged_payload = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_07_read_pt_example_cpu_temperature_FLhDPfLY"}}'
method = 'put'
r = <Response [400]>
request_data = '{"url": "https://callback-prod.kiiskila.cc/callback", "headers": {"X-Customer": "test_07_read_pt_example_cpu_temperature_FLhDPfLY"}}'
request_headers = {'Authorization': 'Bearer ak_1MDE1ODc3OGY5ZjEwMDI0MjBhMDE0YzExMDAwMDAwMDA018d7de1f5702a8153e11f7000000000gHMSWtbfnGVfWfJLLaGffv0w06EKOhBh', 'Content-type': 'application/json', 'User-Agent': 'edge-examples-ci'}
self = <pelion_systest_lib.cloud.libraries.rest_api.rest_api.RestAPI object at 0x7fab8069baf0>
status_codes = {'2XX': 39, '4XX': 4}
time_end = 1707213977.3312068
time_start = 1707213976.980707
timeout = 10
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [400]>, func = 'PUT', expected_resp = 204
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
def assert_status(response, func, expected_resp, api_url=''):
"""
Function for asserting response and creating proper msg on fail situation
:param response: Rest API response
:param func: Calling function
:param expected_resp: Expected response or list of expected responses
:param api_url: Called rest API url
"""
if _assert_status(expected_resp, response) is False:
error_msg = 'ERROR: "{}" {} failed!\n' \
'Expected result {} -> actual response was: {}\n\n' \
'Response body: {}\n' \
'Response headers: {}'.format(func,
api_url,
expected_resp,
response.status_code,
response.text,
response.headers)
log.error(error_msg)
> assert False, error_msg
E AssertionError: ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
E Expected result 204 -> actual response was: 400
E
E Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
E Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:17 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204991a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}
api_url = 'https://api.us-east-1.mbedcloud.com/v2/notification/callback'
error_msg = 'ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!\nExpected result 204 -> actual resp...Content-Length,Content-Disposition\', \'Strict-Transport-Security\': \'max-age=10886400; includeSubDomains; preload\'}'
expected_resp = 204
func = 'PUT'
response = <Response [400]>
systemtest-library/pelion_systest_lib/tools/utils.py:107: AssertionError
--------------------------------- Captured Log ---------------------------------
10:06:16.394 INFO Creating new developer api key for test case
10:06:16.695 INFO GET https://api.us-east-1.mbedcloud.com/v3/policy-groups - Response: 200 - X-Request-ID: 000065c20498fac4b192ea3600000000
10:06:16.973 INFO POST https://api.us-east-1.mbedcloud.com/v3/api-keys - Response: 201 - X-Request-ID: 000065c204981a84c58c44e800000001
10:06:16.979 INFO Created new developer api key for test case, id: 018d7de1f5702a8153e11f7000000000
10:06:16.979 INFO Register and open web callback notification channel for test_07_read_pt_example_cpu_temperature_FLhDPfLY
10:06:17.332 INFO PUT https://api.us-east-1.mbedcloud.com/v2/notification/callback - Response: 400 - X-Request-ID: 000065c204991a84c58c44e800000000
10:06:17.339 ERROR ERROR: "PUT" https://api.us-east-1.mbedcloud.com/v2/notification/callback failed!
Expected result 204 -> actual response was: 400
Response body: com.pelion.notification.channels.ChannelDataVerifyException: URL_VERIFICATION_FAILED
Response headers: {'Date': 'Tue, 06 Feb 2024 10:06:17 GMT', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Request-ID': '000065c204991a84c58c44e800000000', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload'}
10:06:17.435 INFO Cleaning out the generated test case developer api key, id: 018d7de1f5702a8153e11f7000000000
10:06:17.726 INFO DELETE https://api.us-east-1.mbedcloud.com/v3/api-keys/018d7de1f5702a8153e11f7000000000 - Response: 204 - X-Request-ID: 000065c204991a84c58c44e800000001
10:06:17.737 INFO Sleep for 10 second(s)
10:06:27.750 INFO Total test set running time : 54.5629 s
--------------------------------- Captured Out ---------------------------------
--------------------------------- Captured Err ---------------------------------