diff --git a/tests/system/python/api/test_statistics.py b/tests/system/python/api/test_statistics.py index 17baf5a6c9..f529400eab 100644 --- a/tests/system/python/api/test_statistics.py +++ b/tests/system/python/api/test_statistics.py @@ -122,7 +122,7 @@ def test_statistics_history_with_params(self, fledge_url, request_params, keys): assert 1 == len(jdoc['statistics']) assert Counter(keys) == Counter(jdoc['statistics'][0].keys()) - def test_statistics_history_with_service_enabled(self, start_south_coap, fledge_url, wait_time): + def test_statistics_history_with_service_enabled(self, start_south_coap, update_stat_collection, fledge_url, wait_time): # Allow CoAP listener to start time.sleep(wait_time) diff --git a/tests/system/python/conftest.py b/tests/system/python/conftest.py index 62c4c37edb..a622d67976 100644 --- a/tests/system/python/conftest.py +++ b/tests/system/python/conftest.py @@ -215,6 +215,25 @@ def clone_make_install(): return _add_fledge_north + +@pytest.fixture +def update_stat_collection(fledge_url, wait_time): + """Update the Statistics Collection of all south service to per asset & service""" + + # Wait for the south service and advanced category to be created + time.sleep(wait_time) + service_response_list = list() + response = utils.get_request(fledge_url, "/fledge/south") + + for service in response["services"]: + put_url = "/fledge/category/{}Advanced".format(service["name"]) + payload = {"statistics": "per asset & service"} + res = utils.put_request(fledge_url, quote(put_url), payload) + service_response_list.append(res) + + return service_response_list + + @pytest.fixture def add_service(): def _add_service(fledge_url, service, service_branch, retries, installation_type = "make", service_name = "svc@123", diff --git a/tests/system/python/e2e/test_e2e_coap_PI.py b/tests/system/python/e2e/test_e2e_coap_PI.py index bfc70cf069..302f084def 100644 --- a/tests/system/python/e2e/test_e2e_coap_PI.py +++ b/tests/system/python/e2e/test_e2e_coap_PI.py @@ -106,7 +106,7 @@ def start_south_north(reset_and_start_fledge, add_south, start_north_pi_server_c class TestE2E_CoAP_PI: - def test_end_to_end(self, start_south_north, read_data_from_pi, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, + def test_end_to_end(self, start_south_north, update_stat_collection, read_data_from_pi, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface, asset_name=ASSET_NAME): """ Test that data is inserted in Fledge and sent to PI start_south_north: Fixture that starts Fledge with south and north instance diff --git a/tests/system/python/e2e/test_e2e_csv_PI.py b/tests/system/python/e2e/test_e2e_csv_PI.py index 98f8fcf3bb..04321ccd7f 100644 --- a/tests/system/python/e2e/test_e2e_csv_PI.py +++ b/tests/system/python/e2e/test_e2e_csv_PI.py @@ -104,7 +104,7 @@ def start_south_north(reset_and_start_fledge, add_south, start_north_pi_server_c _data_str[_head] = tmp_list south_plugin = "playback" - add_south(south_plugin, south_branch, fledge_url, config=south_config) + add_south(south_plugin, south_branch, fledge_url, config=south_config, start_service=False) start_north_pi_server_c(fledge_url, pi_host, pi_port, pi_token) yield start_south_north @@ -131,8 +131,8 @@ def _verify_egress(read_data_from_pi, pi_host, pi_admin, pi_passwd, pi_db, wait_ class TestE2E_CSV_PI: - def test_e2e_csv_pi(self, start_south_north, read_data_from_pi, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, - wait_time, retries, skip_verify_north_interface, asset_name="end_to_end_csv"): + def test_e2e_csv_pi(self, start_south_north, update_stat_collection, read_data_from_pi, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, + enable_schedule, wait_time, retries, skip_verify_north_interface, asset_name="end_to_end_csv"): """ Test that data is inserted in Fledge and sent to PI start_south_north: Fixture that starts Fledge with south and north instance read_data_from_pi: Fixture to read data from PI @@ -143,6 +143,7 @@ def test_e2e_csv_pi(self, start_south_north, read_data_from_pi, fledge_url, pi_h data received from PI is same as data sent""" conn = http.client.HTTPConnection(fledge_url) + enable_schedule(fledge_url, "play") # Time to wait until north schedule runs time.sleep(wait_time * math.ceil(15/wait_time) + 15) diff --git a/tests/system/python/e2e/test_e2e_csv_multi_filter_pi.py b/tests/system/python/e2e/test_e2e_csv_multi_filter_pi.py index 48dbf9cba7..102e906cc1 100644 --- a/tests/system/python/e2e/test_e2e_csv_multi_filter_pi.py +++ b/tests/system/python/e2e/test_e2e_csv_multi_filter_pi.py @@ -125,10 +125,6 @@ def start_south_north(self, reset_and_start_fledge, add_south, enable_schedule, filter_cfg_meta = {"enable": "true"} add_filter("metadata", filter_branch, "fmeta", filter_cfg_meta, fledge_url, SVC_NAME) - # Since playback plugin reads all csv data at once, we cant keep it in enable mode before filter add - # enable service when all filters all applied - enable_schedule(fledge_url, SVC_NAME) - start_north_pi_server_c(fledge_url, pi_host, pi_port, pi_token) yield self.start_south_north @@ -140,8 +136,8 @@ def start_south_north(self, reset_and_start_fledge, add_south, enable_schedule, remove_data_file(csv_file_path) - def test_end_to_end(self, start_south_north, disable_schedule, fledge_url, read_data_from_pi, pi_host, pi_admin, - pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface): + def test_end_to_end(self, start_south_north, update_stat_collection, disable_schedule, fledge_url, read_data_from_pi, pi_host, pi_admin, + enable_schedule, pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface): """ Test that data is inserted in Fledge using playback south plugin & Delta, RMS, Rate, Scale, Asset & Metadata filters, and sent to PI start_south_north: Fixture that starts Fledge with south service, add filter and north instance @@ -151,6 +147,10 @@ def test_end_to_end(self, start_south_north, disable_schedule, fledge_url, read_ on endpoint GET /fledge/asset/ with applied data processing filter value data received from PI is same as data sent""" + # Since playback plugin reads all csv data at once, we cant keep it in enable mode before filter add + # enable service when all filters all applied + enable_schedule(fledge_url, SVC_NAME) + # Time to wait until north schedule runs time.sleep(wait_time * math.ceil(15/wait_time) + 15) conn = http.client.HTTPConnection(fledge_url) diff --git a/tests/system/python/e2e/test_e2e_expr_pi.py b/tests/system/python/e2e/test_e2e_expr_pi.py index f4ba453340..78b072874d 100644 --- a/tests/system/python/e2e/test_e2e_expr_pi.py +++ b/tests/system/python/e2e/test_e2e_expr_pi.py @@ -97,7 +97,7 @@ def start_south_north(self, reset_and_start_fledge, add_south, enable_schedule, remove_directories("/tmp/fledge-south-{}".format(SOUTH_PLUGIN.lower())) remove_directories("/tmp/fledge-filter-{}".format(filter_plugin)) - def test_end_to_end(self, start_south_north, disable_schedule, fledge_url, read_data_from_pi, pi_host, pi_admin, + def test_end_to_end(self, start_south_north, update_stat_collection, disable_schedule, fledge_url, read_data_from_pi, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface): """ Test that data is inserted in Fledge using expression south plugin & metadata filter, and sent to PI start_south_north: Fixture that starts Fledge with south service, add filter and north instance diff --git a/tests/system/python/e2e/test_e2e_filter_fft_threshold.py b/tests/system/python/e2e/test_e2e_filter_fft_threshold.py index 0040005035..ab7d9bf765 100644 --- a/tests/system/python/e2e/test_e2e_filter_fft_threshold.py +++ b/tests/system/python/e2e/test_e2e_filter_fft_threshold.py @@ -106,10 +106,6 @@ def start_south_north(self, reset_and_start_fledge, add_south, enable_schedule, filter_cfg_fft = {"asset": ASSET, "lowPass": "10", "highPass": "30", "enable": "true"} add_filter("fft", filter_branch, "FFT Filter", filter_cfg_fft, fledge_url, SVC_NAME) - # Since playback plugin reads all csv data at once, we cant keep it in enable mode before filter add - # enable service when all filters all applied - enable_schedule(fledge_url, SVC_NAME) - start_north_pi_server_c(fledge_url, pi_host, pi_port, pi_token, taskname=NORTH_TASK_NAME, start_task=False) @@ -128,8 +124,8 @@ def start_south_north(self, reset_and_start_fledge, add_south, enable_schedule, remove_data_file(csv_dest) - def test_end_to_end(self, start_south_north, disable_schedule, fledge_url, read_data_from_pi, pi_host, pi_admin, - pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface): + def test_end_to_end(self, start_south_north, update_stat_collection, disable_schedule, fledge_url, read_data_from_pi, pi_host, pi_admin, + enable_schedule, pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface): """ Test that data is inserted in Fledge using playback south plugin & FFT filter, and sent to PI after passing through threshold filter start_south_north: Fixture that starts Fledge with south service, add filter and north instance @@ -139,6 +135,10 @@ def test_end_to_end(self, start_south_north, disable_schedule, fledge_url, read_ on endpoint GET /fledge/asset/ with applied data processing filter value data received from PI is same as data sent""" + # Since playback plugin reads all csv data at once, we cant keep it in enable mode before filter add + # enable service when all filters all applied + enable_schedule(fledge_url, SVC_NAME) + # Time to wait until north schedule runs time.sleep(wait_time * math.ceil(15/wait_time) + 15) conn = http.client.HTTPConnection(fledge_url) diff --git a/tests/system/python/e2e/test_e2e_kafka.py b/tests/system/python/e2e/test_e2e_kafka.py index 23362ed566..a0df9a49ab 100644 --- a/tests/system/python/e2e/test_e2e_kafka.py +++ b/tests/system/python/e2e/test_e2e_kafka.py @@ -83,7 +83,7 @@ def _configure_and_start_north_kafka(self, north_branch, fledge_url, host, port, "schedule_type": 3, "schedule_day": 0, "schedule_time": 0, - "schedule_repeat": 0, + "schedule_repeat": 5, "schedule_enabled": "true", "config": {"topic": {"value": topic}, "brokers": {"value": "{}:{}".format(host, port)}} @@ -118,7 +118,7 @@ def start_south_north(self, reset_and_start_fledge, add_south, remove_data_file, remove_directories("/tmp/fledge-south-{}".format(SOUTH_PLUGIN_NAME)) remove_directories("/tmp/fledge-north-{}".format(NORTH_PLUGIN_NAME.lower())) - def test_end_to_end(self, start_south_north, fledge_url, wait_time, kafka_host, kafka_rest_port, kafka_topic, + def test_end_to_end(self, start_south_north, update_stat_collection, fledge_url, wait_time, kafka_host, kafka_rest_port, kafka_topic, skip_verify_north_interface): """ Test that data is inserted in Fledge and sent to Kafka start_south_north: Fixture that starts Fledge with south and north instance diff --git a/tests/system/python/e2e/test_e2e_modbus_c_pi.py b/tests/system/python/e2e/test_e2e_modbus_c_pi.py index 89991de4d6..a81afbbec4 100644 --- a/tests/system/python/e2e/test_e2e_modbus_c_pi.py +++ b/tests/system/python/e2e/test_e2e_modbus_c_pi.py @@ -99,7 +99,7 @@ def start_south_north(self, reset_and_start_fledge, add_south, remove_directorie remove_directories("/tmp/fledge-south-{}".format(SOUTH_PLUGIN.lower())) - def test_end_to_end(self, start_south_north, enable_schedule, disable_schedule, fledge_url, read_data_from_pi, + def test_end_to_end(self, start_south_north, update_stat_collection, enable_schedule, disable_schedule, fledge_url, read_data_from_pi, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface, modbus_host, modbus_port): """ Test that data is inserted in Fledge using modbus-c south plugin and sent to PI diff --git a/tests/system/python/e2e/test_e2e_pi_scaleset.py b/tests/system/python/e2e/test_e2e_pi_scaleset.py index bf97e9105d..7d68f01a74 100644 --- a/tests/system/python/e2e/test_e2e_pi_scaleset.py +++ b/tests/system/python/e2e/test_e2e_pi_scaleset.py @@ -121,7 +121,7 @@ def start_south_north_with_filter(self, reset_and_start_fledge, add_south, south remove_directories("/tmp/fledge-south-{}".format(ASSET_NAME.lower())) remove_directories("/tmp/fledge-filter-{}".format(FILTER_PLUGIN)) - def test_end_to_end(self, start_south_north_with_filter, read_data_from_pi, fledge_url, pi_host, pi_admin, + def test_end_to_end(self, start_south_north_with_filter, update_stat_collection, read_data_from_pi, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface): subprocess.run(["cd $FLEDGE_ROOT/extras/python; python3 -m fogbench -t ../../data/template.json -p http; cd -"] diff --git a/tests/system/python/e2e/test_e2e_vary_asset_http_pi.py b/tests/system/python/e2e/test_e2e_vary_asset_http_pi.py index 8267cf3515..67fcb52c35 100644 --- a/tests/system/python/e2e/test_e2e_vary_asset_http_pi.py +++ b/tests/system/python/e2e/test_e2e_vary_asset_http_pi.py @@ -120,7 +120,7 @@ def start_south_north(self, reset_and_start_fledge, add_south, start_north_pi_se # Cleanup code that runs after the caller test is over remove_directories("/tmp/fledge-south-{}".format(south_plugin)) - def test_end_to_end(self, start_south_north, read_data_from_pi, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, + def test_end_to_end(self, start_south_north, update_stat_collection, read_data_from_pi, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, skip_verify_north_interface): """ Test that data is inserted in Fledge and sent to PI start_south_north: Fixture that starts Fledge with south and north instance diff --git a/tests/system/python/packages/test_eds.py b/tests/system/python/packages/test_eds.py index 6790f4a7a4..7beeea72f3 100644 --- a/tests/system/python/packages/test_eds.py +++ b/tests/system/python/packages/test_eds.py @@ -171,7 +171,7 @@ def verify_eds_egress_asset_tracking(fledge_url): class TestEDS: - def test_eds(self, check_eds_installed, reset_eds, remove_and_add_pkgs, reset_fledge, start_south_north, fledge_url, + def test_eds(self, check_eds_installed, reset_eds, remove_and_add_pkgs, reset_fledge, start_south_north, update_stat_collection, fledge_url, wait_time): time.sleep(wait_time * 4) diff --git a/tests/system/python/packages/test_north_azure.py b/tests/system/python/packages/test_north_azure.py index 38bc668e31..6ca97ac10c 100644 --- a/tests/system/python/packages/test_north_azure.py +++ b/tests/system/python/packages/test_north_azure.py @@ -218,7 +218,7 @@ def add_expression_filter(add_filter, fledge_url, NORTH_PLUGIN_NAME): class TestNorthAzureIoTHubDevicePlugin: - def test_send(self, clean_setup_fledge_packages, reset_fledge, add_south_north_service, fledge_url, enable_schedule, + def test_send(self, clean_setup_fledge_packages, reset_fledge, add_south_north_service, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, wait_time, retries, skip_verify_north_interface, azure_storage_account_url, azure_storage_account_key, azure_storage_container): @@ -260,7 +260,7 @@ def test_send(self, clean_setup_fledge_packages, reset_fledge, add_south_north_s _verify_egress(azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, ASSET) - def test_mqtt_over_websocket_reconfig(self, reset_fledge, add_south_north_service, fledge_url, enable_schedule, disable_schedule, + def test_mqtt_over_websocket_reconfig(self, reset_fledge, add_south_north_service, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, skip_verify_north_interface): @@ -306,7 +306,7 @@ def test_mqtt_over_websocket_reconfig(self, reset_fledge, add_south_north_servic _verify_egress(azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, ASSET) - def test_disable_enable(self, reset_fledge, add_south_north_service, fledge_url, enable_schedule, disable_schedule, + def test_disable_enable(self, reset_fledge, add_south_north_service, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, skip_verify_north_interface): @@ -349,7 +349,7 @@ def test_disable_enable(self, reset_fledge, add_south_north_service, fledge_url, _verify_egress(azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, ASSET) - def test_send_with_filter(self, reset_fledge, add_south_north_service, fledge_url, enable_schedule, disable_schedule, + def test_send_with_filter(self, reset_fledge, add_south_north_service, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, skip_verify_north_interface, add_filter): @@ -407,7 +407,7 @@ def test_send_with_filter(self, reset_fledge, add_south_north_service, fledge_ur class TestNorthAzureIoTHubDevicePluginTask: - def test_send_as_a_task(self, reset_fledge, add_south_north_task, fledge_url, enable_schedule, disable_schedule, + def test_send_as_a_task(self, reset_fledge, add_south_north_task, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, skip_verify_north_interface): @@ -448,7 +448,7 @@ def test_send_as_a_task(self, reset_fledge, add_south_north_task, fledge_url, en _verify_egress(azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, ASSET) - def test_mqtt_over_websocket_reconfig_task(self, reset_fledge, add_south_north_task, fledge_url, enable_schedule, disable_schedule, + def test_mqtt_over_websocket_reconfig_task(self, reset_fledge, add_south_north_task, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, skip_verify_north_interface): @@ -495,7 +495,7 @@ def test_mqtt_over_websocket_reconfig_task(self, reset_fledge, add_south_north_t _verify_egress(azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, ASSET) - def test_disable_enable_task(self, reset_fledge, add_south_north_task, fledge_url, enable_schedule, disable_schedule, + def test_disable_enable_task(self, reset_fledge, add_south_north_task, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, skip_verify_north_interface): @@ -536,7 +536,7 @@ def test_disable_enable_task(self, reset_fledge, add_south_north_task, fledge_ur _verify_egress(azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, ASSET) - def test_send_with_filter_task(self, reset_fledge, add_south_north_task, fledge_url, enable_schedule, disable_schedule, + def test_send_with_filter_task(self, reset_fledge, add_south_north_task, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, azure_storage_account_url, azure_storage_account_key, azure_storage_container, wait_time, retries, skip_verify_north_interface, add_filter): @@ -595,7 +595,7 @@ def test_send_with_filter_task(self, reset_fledge, add_south_north_task, fledge_ class TestNorthAzureIoTHubDevicePluginInvalidConfig: - def test_invalid_connstr(self, reset_fledge, add_south, add_north, fledge_url, enable_schedule, disable_schedule, wait_time, retries): + def test_invalid_connstr(self, reset_fledge, add_south, add_north, update_stat_collection, fledge_url, enable_schedule, disable_schedule, wait_time, retries): """ Test that checks connection string of north azure plugin is invalid or not. @@ -618,7 +618,7 @@ def test_invalid_connstr(self, reset_fledge, add_south, add_north, fledge_url, e # Update Asset name ASSET = "test9_FOGL-7352_system" config_south(fledge_url, ASSET) - + update_stat_collection( fledge_url, wait_time) # Enable South Service for 10 Seonds enable_schedule(fledge_url, SOUTH_SERVICE_NAME) time.sleep(wait_time) @@ -630,7 +630,7 @@ def test_invalid_connstr(self, reset_fledge, add_south, add_north, fledge_url, e verify_north_stats_on_invalid_config(fledge_url) - def test_invalid_connstr_sharedkey(self, reset_fledge, add_south, add_north, fledge_url, enable_schedule, disable_schedule, + def test_invalid_connstr_sharedkey(self, reset_fledge, add_south, add_north, update_stat_collection, fledge_url, enable_schedule, disable_schedule, wait_time, retries, azure_host, azure_device, azure_key): """ Test that checks shared key passed to connection string of north azure plugin is invalid or not. @@ -657,7 +657,7 @@ def test_invalid_connstr_sharedkey(self, reset_fledge, add_south, add_north, fle # Update Asset name ASSET = "test10_FOGL-7352_system" config_south(fledge_url, ASSET) - + update_stat_collection(fledge_url, wait_time) # Enable South Service for 10 Seonds enable_schedule(fledge_url, SOUTH_SERVICE_NAME) time.sleep(wait_time) @@ -671,7 +671,7 @@ def test_invalid_connstr_sharedkey(self, reset_fledge, add_south, add_north, fle class TestNorthAzureIoTHubDevicePluginLongRun: - def test_send_long_run(self, clean_setup_fledge_packages, reset_fledge, add_south_north_service, fledge_url, enable_schedule, + def test_send_long_run(self, clean_setup_fledge_packages, reset_fledge, add_south_north_service, update_stat_collection, fledge_url, enable_schedule, disable_schedule, azure_host, azure_device, azure_key, wait_time, retries, skip_verify_north_interface, azure_storage_account_url, azure_storage_account_key, azure_storage_container, run_time): diff --git a/tests/system/python/packages/test_omf_naming_scheme.py b/tests/system/python/packages/test_omf_naming_scheme.py index 2a46ff6a11..ad86e802f2 100644 --- a/tests/system/python/packages/test_omf_naming_scheme.py +++ b/tests/system/python/packages/test_omf_naming_scheme.py @@ -167,7 +167,7 @@ def _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_d class TestOMFNamingScheme: def test_omf_with_concise_naming(self, clean_setup_fledge_packages, reset_fledge, start_south, - start_north_task_omf_web_api, + start_north_task_omf_web_api, update_stat_collection, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): """ Test OMF with concise naming scheme. @@ -208,7 +208,7 @@ def test_omf_with_concise_naming(self, clean_setup_fledge_packages, reset_fledge _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, recorded_datapoint, pi_asset_name) - def test_omf_with_type_suffix_naming(self, reset_fledge, start_south, start_north_task_omf_web_api, + def test_omf_with_type_suffix_naming(self, reset_fledge, start_south, start_north_task_omf_web_api, update_stat_collection, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): """ Test OMF with concise naming scheme. @@ -250,7 +250,7 @@ def test_omf_with_type_suffix_naming(self, reset_fledge, start_south, start_nort _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, recorded_datapoint, pi_asset_name) - def test_omf_with_attribute_hash_naming(self, reset_fledge, start_south, start_north_task_omf_web_api, + def test_omf_with_attribute_hash_naming(self, reset_fledge, start_south, start_north_task_omf_web_api, update_stat_collection, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): """ Test OMF with concise naming scheme. @@ -292,7 +292,7 @@ def test_omf_with_attribute_hash_naming(self, reset_fledge, start_south, start_n _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, recorded_datapoint, pi_asset_name) - def test_omf_with_backward_compatibility_naming(self, reset_fledge, start_south, start_north_task_omf_web_api, + def test_omf_with_backward_compatibility_naming(self, reset_fledge, start_south, start_north_task_omf_web_api, update_stat_collection, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): """ Test OMF with concise naming scheme. diff --git a/tests/system/python/packages/test_omf_north_service.py b/tests/system/python/packages/test_omf_north_service.py index f62e0ce042..55c97071a4 100644 --- a/tests/system/python/packages/test_omf_north_service.py +++ b/tests/system/python/packages/test_omf_north_service.py @@ -179,7 +179,7 @@ def _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_d class TestOMFNorthService: - def test_omf_service_with_restart(self, clean_setup_fledge_packages, reset_fledge, start_south_north, + def test_omf_service_with_restart(self, clean_setup_fledge_packages, reset_fledge, start_south_north, update_stat_collection, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): """ Test OMF as a North service before and after restarting fledge. @@ -227,7 +227,7 @@ def test_omf_service_with_restart(self, clean_setup_fledge_packages, reset_fledg _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, south_asset_name) - def test_omf_service_with_enable_disable(self, reset_fledge, start_south_north, read_data_from_pi_web_api, + def test_omf_service_with_enable_disable(self, reset_fledge, start_south_north, update_stat_collection, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): @@ -279,8 +279,8 @@ def test_omf_service_with_enable_disable(self, reset_fledge, start_south_north, _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, south_asset_name) - def test_omf_service_with_delete_add(self, reset_fledge, start_south_north, read_data_from_pi_web_api, - start_north_omf_as_a_service, + def test_omf_service_with_delete_add(self, reset_fledge, start_south_north, update_stat_collection, + read_data_from_pi_web_api, start_north_omf_as_a_service, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): """ Test OMF as a North service by deleting and adding north service. @@ -331,8 +331,8 @@ def test_omf_service_with_delete_add(self, reset_fledge, start_south_north, read _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, south_asset_name) - def test_omf_service_with_reconfig(self, reset_fledge, start_south_north, read_data_from_pi_web_api, - skip_verify_north_interface, fledge_url, + def test_omf_service_with_reconfig(self, reset_fledge, start_south_north, update_stat_collection, + read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): """ Test OMF as a North service by reconfiguring it. reset_fledge: Fixture to reset fledge @@ -397,7 +397,7 @@ def test_omf_service_with_reconfig(self, reset_fledge, start_south_north, read_d class TestOMFNorthServicewithFilters: - def test_omf_service_with_filter(self, reset_fledge, start_south_north, add_configure_filter, + def test_omf_service_with_filter(self, reset_fledge, start_south_north, update_stat_collection, add_configure_filter, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): @@ -438,7 +438,7 @@ def test_omf_service_with_filter(self, reset_fledge, start_south_north, add_conf _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, south_asset_name) - def test_omf_service_with_disable_enable_filter(self, reset_fledge, start_south_north, add_configure_filter, + def test_omf_service_with_disable_enable_filter(self, reset_fledge, start_south_north, update_stat_collection, add_configure_filter, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): @@ -491,7 +491,7 @@ def test_omf_service_with_disable_enable_filter(self, reset_fledge, start_south_ _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, south_asset_name) - def test_omf_service_with_filter_reconfig(self, reset_fledge, start_south_north, add_configure_filter, + def test_omf_service_with_filter_reconfig(self, reset_fledge, start_south_north, update_stat_collection, add_configure_filter, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): @@ -539,7 +539,7 @@ def test_omf_service_with_filter_reconfig(self, reset_fledge, start_south_north, _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, south_asset_name) - def test_omf_service_with_delete_add(self, reset_fledge, start_south_north, add_configure_filter, add_filter, + def test_omf_service_with_delete_add(self, reset_fledge, start_south_north, update_stat_collection, add_configure_filter, add_filter, read_data_from_pi_web_api, start_north_omf_as_a_service, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): @@ -600,7 +600,7 @@ def test_omf_service_with_delete_add(self, reset_fledge, start_south_north, add_ _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, south_asset_name) - def test_omf_service_with_delete_add_filter(self, reset_fledge, start_south_north, add_configure_filter, add_filter, + def test_omf_service_with_delete_add_filter(self, reset_fledge, start_south_north, update_stat_collection, add_configure_filter, add_filter, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): @@ -658,7 +658,7 @@ def test_omf_service_with_delete_add_filter(self, reset_fledge, start_south_nort _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, south_asset_name) - def test_omf_service_with_filter_reorder(self, reset_fledge, start_south_north, add_configure_filter, add_filter, + def test_omf_service_with_filter_reorder(self, reset_fledge, start_south_north, update_stat_collection, add_configure_filter, add_filter, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db): diff --git a/tests/system/python/packages/test_pi_webapi.py b/tests/system/python/packages/test_pi_webapi.py index a4180a8298..f89f301b83 100644 --- a/tests/system/python/packages/test_pi_webapi.py +++ b/tests/system/python/packages/test_pi_webapi.py @@ -164,9 +164,9 @@ def start_south_north(add_south, start_north_task_omf_web_api, remove_data_file, class TestPackagesCoAP_PI_WebAPI: - def test_omf_task(self, clean_setup_fledge_packages, reset_fledge, start_south_north, read_data_from_pi_web_api, - fledge_url, pi_host, pi_admin, pi_passwd, pi_db, fogbench_host, fogbench_port, - wait_time, retries, skip_verify_north_interface, asset_name=ASSET): + def test_omf_task(self, clean_setup_fledge_packages, reset_fledge, start_south_north, update_stat_collection, + read_data_from_pi_web_api, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, fogbench_host, + fogbench_port, wait_time, retries, skip_verify_north_interface, asset_name=ASSET): """ Test that data is inserted in Fledge and sent to PI start_south_north: Fixture that add south and north instance read_data_from_pi: Fixture to read data from PI @@ -196,7 +196,7 @@ def test_omf_task(self, clean_setup_fledge_packages, reset_fledge, start_south_n _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, asset_name) - def test_omf_task_with_reconfig(self, reset_fledge, start_south_north, read_data_from_pi_web_api, + def test_omf_task_with_reconfig(self, reset_fledge, start_south_north, update_stat_collection, read_data_from_pi_web_api, skip_verify_north_interface, fledge_url, fogbench_host, fogbench_port, wait_time, retries, pi_host, pi_port, pi_admin, pi_passwd, pi_db, asset_name=ASSET): diff --git a/tests/system/python/packages/test_pi_webapi_linked_data_type.py b/tests/system/python/packages/test_pi_webapi_linked_data_type.py index 46f19a937e..ec7ff17134 100644 --- a/tests/system/python/packages/test_pi_webapi_linked_data_type.py +++ b/tests/system/python/packages/test_pi_webapi_linked_data_type.py @@ -208,8 +208,7 @@ def start_south_north(add_south, start_north_task_omf_web_api, add_filter, remov service_name=NORTH_INSTANCE_NAME, default_af_location=AF_HIERARCHY_LEVEL) class Test_linked_data_PIWebAPI: - # @pytest.mark.skip(reason="no way of currently testing this") - def test_linked_data(self, clean_setup_fledge_packages, reset_fledge, start_south_north, fledge_url, + def test_linked_data(self, clean_setup_fledge_packages, reset_fledge, start_south_north, update_stat_collection, fledge_url, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, pi_port, enable_schedule, disable_schedule, verify_hierarchy_and_get_datapoints_from_pi_web_api, clear_pi_system_through_pi_web_api, skip_verify_north_interface, asset_name=ASSET): @@ -252,7 +251,7 @@ def test_linked_data(self, clean_setup_fledge_packages, reset_fledge, start_sout verify_data_between_fledge_and_piwebapi(fledge_url, pi_host, pi_admin, pi_passwd, pi_db, AF_HIERARCHY_LEVEL, ASSET, SOUTH_PLUGINS_LIST, verify_hierarchy_and_get_datapoints_from_pi_web_api, wait_time) # @pytest.mark.skip(reason="no way of currently testing this") - def test_linked_data_with_filter(self, reset_fledge, start_south_north, fledge_url, pi_host, pi_admin, pi_passwd, add_filter, pi_db, wait_time, + def test_linked_data_with_filter(self, reset_fledge, start_south_north, update_stat_collection, fledge_url, pi_host, pi_admin, pi_passwd, add_filter, pi_db, wait_time, retries, pi_port, enable_schedule, disable_schedule, verify_hierarchy_and_get_datapoints_from_pi_web_api, clear_pi_system_through_pi_web_api, skip_verify_north_interface, asset_name=ASSET): @@ -295,7 +294,7 @@ def test_linked_data_with_filter(self, reset_fledge, start_south_north, fledge_u verify_data_between_fledge_and_piwebapi(fledge_url, pi_host, pi_admin, pi_passwd, pi_db, AF_HIERARCHY_LEVEL, ASSET, ASSET_DICT[ASSET], verify_hierarchy_and_get_datapoints_from_pi_web_api, wait_time) # @pytest.mark.skip(reason="no way of currently testing this") - def test_linked_data_with_onoff_filter(self, reset_fledge, start_south_north, fledge_url, pi_host, pi_admin, pi_passwd, add_filter, pi_db, wait_time, + def test_linked_data_with_onoff_filter(self, reset_fledge, start_south_north, update_stat_collection, fledge_url, pi_host, pi_admin, pi_passwd, add_filter, pi_db, wait_time, retries, pi_port, enable_schedule, disable_schedule, verify_hierarchy_and_get_datapoints_from_pi_web_api, clear_pi_system_through_pi_web_api, skip_verify_north_interface, asset_name=ASSET): diff --git a/tests/system/python/packages/test_statistics_history_notification_rule.py b/tests/system/python/packages/test_statistics_history_notification_rule.py index 83619eb3d2..e7dca40e35 100644 --- a/tests/system/python/packages/test_statistics_history_notification_rule.py +++ b/tests/system/python/packages/test_statistics_history_notification_rule.py @@ -144,7 +144,7 @@ def _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_d class TestStatisticsHistoryBasedNotificationRuleOnIngress: - def test_stats_readings_south(self, clean_setup_fledge_packages, reset_fledge, start_south, start_notification, fledge_url, + def test_stats_readings_south(self, clean_setup_fledge_packages, reset_fledge, start_south, update_stat_collection, start_notification, fledge_url, skip_verify_north_interface, wait_time, retries): """ Test NTFSN triggered or not with source as statistics history and name as READINGS in threshold rule. clean_setup_fledge_packages: Fixture to remove and install latest fledge packages diff --git a/tests/system/python/pair/test_c_north_service_pair.py b/tests/system/python/pair/test_c_north_service_pair.py index 8f1cf5ddb5..1d4810890b 100644 --- a/tests/system/python/pair/test_c_north_service_pair.py +++ b/tests/system/python/pair/test_c_north_service_pair.py @@ -44,6 +44,22 @@ AF_HIERARCHY_LEVEL = "Cservicepair/Cservicepairlvl1/Cservicepairlvl2" +def update_stat_collection_remote(fledge_url, wait_time): + """Update the Statistics Collection of all south service to per asset & service""" + + # Wait for the south service to be created + time.sleep(wait_time) + service_response_list = list() + response = utils.get_request(fledge_url, "/fledge/south") + + for service in response["services"]: + put_url = "/fledge/category/{}Advanced".format(service["name"]) + payload = {"statistics": "per asset & service"} + res = utils.put_request(fledge_url, urllib.parse.quote(put_url), payload) + service_response_list.append(res) + + return service_response_list + @pytest.fixture def reset_fledge_local(wait_time): try: @@ -121,7 +137,7 @@ def clean_install_fledge_packages_remote(remote_user, remote_ip, key_path, remot @pytest.fixture def setup_remote(reset_fledge_remote, remote_user, remote_ip, start_north_omf_as_a_service, - pi_host, pi_port, pi_admin, pi_passwd, + pi_host, pi_port, pi_admin, pi_passwd, wait_time, clear_pi_system_through_pi_web_api, pi_db): """Fixture that setups remote machine reset_fledge_remote: Fixture that kills fledge, reset database and starts fledge again on a remote @@ -155,6 +171,8 @@ def setup_remote(reset_fledge_remote, remote_user, remote_ip, start_north_omf_as r = r.read().decode() retval = json.loads(r) assert remote_south_service_name == retval["name"] + + update_stat_collection_remote(fledge_url, wait_time) # Configure pi north plugin on remote machine global remote_north_schedule_id @@ -273,7 +291,7 @@ def _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_d class TestCNorthService: def test_north_C_service_with_restart(self, clean_setup_fledge_packages, clean_install_fledge_packages_remote, - setup_local, setup_remote, skip_verify_north_interface, fledge_url, + setup_local, setup_remote, update_stat_collection, skip_verify_north_interface, fledge_url, wait_time, retries, remote_ip, read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db): """ Test C plugin as a North service before and after restarting fledge. @@ -338,7 +356,7 @@ def test_north_C_service_with_restart(self, clean_setup_fledge_packages, clean_i _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, remote_south_asset_name) - def test_north_C_service_with_enable_disable(self, setup_local, setup_remote, read_data_from_pi_web_api, + def test_north_C_service_with_enable_disable(self, setup_local, setup_remote, update_stat_collection, read_data_from_pi_web_api, remote_ip, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, @@ -757,4 +775,4 @@ def test_north_C_service_with_filter_reorder(self, setup_local, setup_remote, re assert old_ping_result['dataSent'] < new_ping_result['dataSent'] assert old_ping_result_remote['dataSent'] < new_ping_result_remote['dataSent'] _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, - remote_south_asset_name) + remote_south_asset_name) \ No newline at end of file diff --git a/tests/system/python/pair/test_e2e_fledge_pair.py b/tests/system/python/pair/test_e2e_fledge_pair.py index 4d9e2cf41e..067352330b 100644 --- a/tests/system/python/pair/test_e2e_fledge_pair.py +++ b/tests/system/python/pair/test_e2e_fledge_pair.py @@ -18,7 +18,7 @@ import pytest from collections import Counter import utils - +from urllib.parse import quote __author__ = "Vaibhav Singhal" __copyright__ = "Copyright (c) 2019 Dianomic Systems" @@ -36,6 +36,22 @@ class TestE2eFogPairPi: + def update_stat_collection_remote(self, fledge_url, wait_time): + """Update the Statistics Collection of all south service to per asset & service""" + + # Wait for the south service to be created + time.sleep(wait_time) + service_response_list = list() + response = utils.get_request(fledge_url, "/fledge/south") + + for service in response["services"]: + put_url = "/fledge/category/{}Advanced".format(service["name"]) + payload = {"statistics": "per asset & service"} + res = utils.put_request(fledge_url, quote(put_url), payload) + service_response_list.append(res) + + return service_response_list + def get_asset_list(self, fledge_url): _connection = http.client.HTTPConnection(fledge_url) _connection.request("GET", '/fledge/asset') @@ -95,7 +111,7 @@ def reset_and_start_fledge_remote(self, storage_plugin, remote_user, remote_ip, @pytest.fixture def start_south_north_remote(self, reset_and_start_fledge_remote, use_pip_cache, remote_user, - key_path, remote_fledge_path, remote_ip, south_branch, + key_path, remote_fledge_path, remote_ip, south_branch, wait_time, start_north_pi_server_c, pi_host, pi_port, pi_token, clear_pi_system_through_pi_web_api, pi_admin, pi_passwd, pi_db): """Fixture that starts south and north plugins on remote machine @@ -151,6 +167,8 @@ def start_south_north_remote(self, reset_and_start_fledge_remote, use_pip_cache, r = r.read().decode() retval = json.loads(r) assert south_service == retval["name"] + + self.update_stat_collection_remote(fledge_url, wait_time) # Configure pi north plugin on remote machine start_north_pi_server_c(fledge_url, pi_host, pi_port, pi_token) @@ -241,10 +259,8 @@ def start_south_north_local(self, reset_and_start_fledge, add_south, enable_sche "defaultAction": "exclude"}, "enable": "true"} add_filter("asset", filter_branch, "fasset", filter_cfg_asset, fledge_url, "NorthReadingsToHTTP") - # Enable all south and north schedules - enable_schedule(fledge_url, "fogpair_playbk") - enable_schedule(fledge_url, "fogpair_expr") - enable_schedule(fledge_url, "fogpair_sine") + + # Enable north schedule enable_schedule(fledge_url, "NorthReadingsToHTTP") yield self.start_south_north_local @@ -281,8 +297,8 @@ def _verify_egress(self, read_data_from_pi, pi_host, pi_admin, pi_passwd, pi_db, assert Counter(data_from_pi[CSV_HEADERS][-len(expected_read_values):]) == Counter(expected_read_values) - def test_end_to_end(self, start_south_north_remote, start_south_north_local, - read_data_from_pi, retries, pi_host, pi_admin, pi_passwd, pi_db, + def test_end_to_end(self, start_south_north_remote, start_south_north_local, update_stat_collection, + read_data_from_pi, retries, pi_host, pi_admin, pi_passwd, pi_db, enable_schedule, fledge_url, remote_ip, wait_time, skip_verify_north_interface): """ Test that data is inserted in Fledge (local instance) using playback south plugin, sinusoid south plugin and expression south plugin and sent to http north (filter only playback data), @@ -304,8 +320,13 @@ def test_end_to_end(self, start_south_north_remote, start_south_north_local, on endpoint GET /fledge/asset/ with applied data processing filter value data received from PI is same as data sent""" + # Enable all south schedules + enable_schedule(fledge_url, "fogpair_playbk") + enable_schedule(fledge_url, "fogpair_expr") + enable_schedule(fledge_url, "fogpair_sine") + # Wait for data to be sent to Fledge instance 2 and then to PI - time.sleep(wait_time * 3) + time.sleep(wait_time * 4) # Fledge Instance 1 (Local) verification expected_asset_list = ["Expression", "fogpair_playback", "sinusoid"] @@ -363,4 +384,4 @@ def test_end_to_end(self, start_south_north_remote, start_south_north_local, if not skip_verify_north_interface: self._verify_egress(read_data_from_pi, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, - expected_read_values) + expected_read_values) \ No newline at end of file diff --git a/tests/system/python/pair/test_pyton_north_service_pair.py b/tests/system/python/pair/test_pyton_north_service_pair.py index 818372fef6..307736dfb2 100644 --- a/tests/system/python/pair/test_pyton_north_service_pair.py +++ b/tests/system/python/pair/test_pyton_north_service_pair.py @@ -44,6 +44,22 @@ AF_HIERARCHY_LEVEL = "pythonnorthservicepair/pythonnorthservicepairlvl2/pythonnorthservicepairlvl3" +def update_stat_collection_remote(fledge_url, wait_time): + """Update the Statistics Collection of all south service to per asset & service""" + + # Wait for the south service to be created + time.sleep(wait_time) + service_response_list = list() + response = utils.get_request(fledge_url, "/fledge/south") + + for service in response["services"]: + put_url = "/fledge/category/{}Advanced".format(service["name"]) + payload = {"statistics": "per asset & service"} + res = utils.put_request(fledge_url, urllib.parse.quote(put_url), payload) + service_response_list.append(res) + + return service_response_list + @pytest.fixture def reset_fledge_local(wait_time): try: @@ -122,7 +138,7 @@ def clean_install_fledge_packages_remote(remote_user, remote_ip, key_path, remot @pytest.fixture def setup_remote(reset_fledge_remote, remote_user, remote_ip, start_north_omf_as_a_service, - pi_host, pi_port, pi_admin, pi_passwd, + pi_host, pi_port, pi_admin, pi_passwd, wait_time, clear_pi_system_through_pi_web_api, pi_db): """Fixture that setups remote machine reset_fledge_remote: Fixture that kills fledge, reset database and starts fledge again on a remote @@ -156,6 +172,8 @@ def setup_remote(reset_fledge_remote, remote_user, remote_ip, start_north_omf_as r = r.read().decode() retval = json.loads(r) assert remote_south_service_name == retval["name"] + + update_stat_collection_remote(fledge_url, wait_time) # Configure pi north plugin on remote machine global remote_north_schedule_id @@ -274,7 +292,7 @@ def _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_d class TestPythonNorthService: def test_north_python_service_with_restart(self, clean_setup_fledge_packages, clean_install_fledge_packages_remote, - setup_local, setup_remote, skip_verify_north_interface, fledge_url, + setup_local, setup_remote, update_stat_collection, skip_verify_north_interface, fledge_url, wait_time, retries, remote_ip, read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db): """ Test python plugin as a North service before and after restarting fledge. @@ -339,8 +357,8 @@ def test_north_python_service_with_restart(self, clean_setup_fledge_packages, cl _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, remote_south_asset_name) - def test_north_python_service_with_enable_disable(self, setup_local, setup_remote, read_data_from_pi_web_api, - remote_ip, + def test_north_python_service_with_enable_disable(self, setup_local, setup_remote, update_stat_collection, read_data_from_pi_web_api, + remote_ip, skip_verify_north_interface, fledge_url, wait_time, retries, pi_host, pi_admin, pi_passwd, pi_db): @@ -759,4 +777,4 @@ def test_north_python_service_with_filter_reorder(self, setup_local, setup_remot assert old_ping_result['dataSent'] < new_ping_result['dataSent'] assert old_ping_result_remote['dataSent'] < new_ping_result_remote['dataSent'] _verify_egress(read_data_from_pi_web_api, pi_host, pi_admin, pi_passwd, pi_db, wait_time, retries, - remote_south_asset_name) + remote_south_asset_name) \ No newline at end of file diff --git a/tests/system/python/smoke/test_smoke.py b/tests/system/python/smoke/test_smoke.py index eb2c0a3a4b..fd689b64c6 100644 --- a/tests/system/python/smoke/test_smoke.py +++ b/tests/system/python/smoke/test_smoke.py @@ -91,8 +91,8 @@ def test_smoke(start_south_coap, fledge_url, wait_time, asset_name="smoke"): assert 0 == ping_response["dataSent"] actual_stats_map = get_statistics_map(fledge_url) - assert 1 == actual_stats_map[asset_name.upper()] assert 1 == actual_stats_map['READINGS'] + assert asset_name.upper() not in actual_stats_map conn.request("GET", '/fledge/asset') r = conn.getresponse()