summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Abel <info@abel-ikt.de>2022-04-06 15:31:56 +0200
committerMichael Abel <info@abel-ikt.de>2022-04-06 15:31:56 +0200
commitbc6a3845880191de785e199fc0117918e718e577 (patch)
treebbee6dfabe657a232e47fff50fc91752b2c78147 /tests
parentb54b8cd5c9f5745b842c2703a65c801dd06c5b9d (diff)
Autoformat all python files with black
Command: black .
Diffstat (limited to 'tests')
-rw-r--r--tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py9
-rw-r--r--tests/PySys/environments/environment_az.py3
-rw-r--r--tests/PySys/environments/environment_c8y.py28
-rw-r--r--tests/PySys/environments/environment_roundtrip_c8y.py3
-rw-r--r--tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py4
-rw-r--r--tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py4
-rw-r--r--tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py2
-rw-r--r--tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py4
-rw-r--r--tests/PySys/local_mqtt/local_mqtt_pub_sub/run.py11
-rw-r--r--tests/PySys/local_mqtt/local_mqtt_pub_sub_retain/run.py85
-rw-r--r--tests/PySys/local_mqtt/local_mqtt_pub_sub_with_sudo/run.py1
-rw-r--r--tests/PySys/local_mqtt/local_mqtt_sub_fail/run.py6
-rw-r--r--tests/PySys/log_request_end_to_end/log_request_error_messages/run.py33
-rw-r--r--tests/PySys/log_request_end_to_end/log_request_num_lines/run.py32
-rw-r--r--tests/PySys/log_request_end_to_end/test_log_generator.py14
-rw-r--r--tests/PySys/misc_features/custom_init_system/run.py7
-rw-r--r--tests/PySys/misc_features/invalid_device_id/run.py29
-rw-r--r--tests/PySys/misc_features/mqtt_port_change_connection_works/run.py50
-rw-r--r--tests/PySys/misc_features/mqtt_port_set/run.py4
-rw-r--r--tests/PySys/misc_features/mqtt_port_unset/run.py5
-rw-r--r--tests/PySys/misc_features/valid_device_id/run.py40
-rw-r--r--tests/PySys/monitoring/monitoring_smaller_interval/run.py35
-rw-r--r--tests/PySys/monitoring/monitoring_with_collectd/run.py24
-rw-r--r--tests/PySys/monitoring/monitoring_with_simulated_messages/run.py35
-rw-r--r--tests/PySys/plugin_apama/apama_plugin_install/run.py20
-rw-r--r--tests/PySys/plugin_apama/apama_plugin_mon_support/run.py43
-rw-r--r--tests/PySys/plugin_apama/apama_plugin_remove/run.py3
-rw-r--r--tests/PySys/plugin_apama/apama_plugin_update/run.py12
-rw-r--r--tests/PySys/plugin_apama/environment_apama_plugin.py74
-rw-r--r--tests/PySys/plugin_apt/apt_fail_noarg/run.py3
-rw-r--r--tests/PySys/plugin_apt/apt_install_local_file/run.py35
-rw-r--r--tests/PySys/plugin_apt/apt_install_local_file_fail/run.py24
-rw-r--r--tests/PySys/plugin_apt/apt_install_local_file_with_version/run.py36
-rw-r--r--tests/PySys/plugin_apt/apt_install_local_file_with_version_fail/run.py35
-rw-r--r--tests/PySys/plugin_apt/apt_list_format/run.py5
-rw-r--r--tests/PySys/plugin_apt/apt_sequence_install_with_version/run.py4
-rw-r--r--tests/PySys/plugin_apt/apt_sequence_remove_with_version/run.py4
-rw-r--r--tests/PySys/plugin_apt/apt_sequence_remove_with_version_fail/run.py5
-rw-r--r--tests/PySys/plugin_apt/apt_update_list/run.py9
-rw-r--r--tests/PySys/plugin_apt/environment_apt_plugin.py50
-rw-r--r--tests/PySys/plugin_docker/docker_plugin_finalize/run.py3
-rw-r--r--tests/PySys/plugin_docker/docker_plugin_install/run.py3
-rw-r--r--tests/PySys/plugin_docker/docker_plugin_install_with_version/run.py3
-rw-r--r--tests/PySys/plugin_docker/docker_plugin_remove/run.py3
-rw-r--r--tests/PySys/plugin_docker/docker_plugin_remove_with_version/run.py6
-rw-r--r--tests/PySys/plugin_docker/docker_plugin_update/run.py18
-rw-r--r--tests/PySys/plugin_docker/environment_docker_plugin.py84
-rw-r--r--tests/PySys/smoketests/smoketest_smartrest_400_samples_1Xms/run.py2
-rw-r--r--tests/PySys/smoketests/smoketest_smartrest_400_samples_20ms/run.py2
-rw-r--r--tests/PySys/software_management_end_to_end/environment_sm_management.py29
-rw-r--r--tests/PySys/software_management_end_to_end/sm_apt_install_download_path/run.py32
-rw-r--r--tests/PySys/software_management_end_to_end/sm_apt_install_remove_default/run.py8
-rw-r--r--tests/PySys/software_management_end_to_end/sm_apt_install_remove_multiple/run.py1
-rw-r--r--tests/PySys/software_management_end_to_end/sm_apt_install_remove_multiple_mixed/run.py1
-rw-r--r--tests/PySys/software_management_end_to_end/sm_docker_install_remove_multiple/run.py63
-rw-r--r--tests/PySys/software_management_end_to_end/sm_fake_install_remove/run.py7
-rw-r--r--tests/PySys/software_management_end_to_end/sm_fake_install_remove_multiple/run.py7
-rw-r--r--tests/PySys/software_management_end_to_end/sm_mapper_fail_and_reconnect/run.py8
-rw-r--r--tests/PySys/software_management_end_to_end/sm_mixed_install_remove_multiple/run.py8
-rw-r--r--tests/PySys/tedge/call_tedge_-V/run.py9
-rw-r--r--tests/PySys/tedge/tedge_agent_user_sudo_access/run.py1
-rw-r--r--tests/PySys/tedge/tedge_software_update/run.py23
-rw-r--r--tests/PySys/tedge_agent/agent_init_session/run.py26
-rw-r--r--tests/PySys/tedge_connect/tedge_connect_test_negative/run.py1
-rw-r--r--tests/PySys/tedge_connect/tedge_connect_test_positive/run.py12
-rw-r--r--tests/PySys/tedge_connect/tedge_connect_test_sm_services/run.py8
-rw-r--r--tests/PySys/tedge_connect/tedge_disconnect_test_sm_services/run.py8
-rw-r--r--tests/PySys/tedge_mapper_az/tedge_mapper_az_negative/run.py6
-rw-r--r--tests/PySys/tedge_mapper_az/tedge_mapper_az_with_timestamp/run.py22
-rw-r--r--tests/PySys/tedge_mapper_az/tedge_mapper_az_without_timestamp/run.py18
-rw-r--r--tests/PySys/tedge_mapper_c8y/mapper_awaits_before_reconnect/run.py14
-rw-r--r--tests/PySys/tedge_mapper_c8y/runtime_start_two_mappers/run.py4
-rw-r--r--tests/PySys/tedge_mapper_c8y/sm_tedge_mapper_init_session/run.py10
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_alarms/run.py142
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_child_device_measurement/run.py143
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_negative/run.py5
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_packet_threshold_size/run.py26
-rw-r--r--tests/PySys/tedge_mapper_c8y/tedge_mapper_c8y_positive/run.py37
78 files changed, 1026 insertions, 607 deletions
diff --git a/tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py b/tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py
index 923dad18..63c83548 100644
--- a/tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py
+++ b/tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py
@@ -37,16 +37,16 @@ class ValidateJWTTokenRetrieval(TedgeEnvironment):
stdouterr="resp_jwt",
background=True,
)
-
+
# Publish an empty message on jwt token request topic
req_jwt_token = self.startProcess(
command=self.sudo,
arguments=[self.tedge, "mqtt", "pub", "c8y/s/uat", "''"],
- stdouterr="req_jwt",
+ stdouterr="req_jwt",
)
-
+
time.sleep(1)
-
+
# Kill the subscriber process explicitly with sudo as PySys does
# not have the rights to do it
kill = self.startProcess(
@@ -62,4 +62,3 @@ class ValidateJWTTokenRetrieval(TedgeEnvironment):
def jwt_token_cleanup(self):
# disconnect the test
self.tedge_disconnect_c8y()
-
diff --git a/tests/PySys/environments/environment_az.py b/tests/PySys/environments/environment_az.py
index ed2461ed..ccdc295d 100644
--- a/tests/PySys/environments/environment_az.py
+++ b/tests/PySys/environments/environment_az.py
@@ -26,10 +26,9 @@ class EnvironmentAz(BaseTest):
command=self.systemctl,
arguments=["status", self.tedge_mapper_az],
stdouterr="serv_mapper1",
- expectedExitStatus="==3", # 3: disabled
+ expectedExitStatus="==3", # 3: disabled
)
-
# Connect the bridge
connect = self.startProcess(
command=self.sudo,
diff --git a/tests/PySys/environments/environment_c8y.py b/tests/PySys/environments/environment_c8y.py
index 57b4a801..f709b80e 100644
--- a/tests/PySys/environments/environment_c8y.py
+++ b/tests/PySys/environments/environment_c8y.py
@@ -15,6 +15,7 @@ from environment_tedge import TedgeEnvironment
Environment to manage automated connects and disconnects to c8y
"""
+
class EnvironmentC8y(TedgeEnvironment):
"""
Pysys Environment to manage automated connect and disconnect to c8y
@@ -31,19 +32,28 @@ class EnvironmentC8y(TedgeEnvironment):
super().setup()
if self.project.c8yurl == "":
self.abort(
- FAILED, "Cumulocity tenant URL is not set. Set with the env variable C8YURL")
+ FAILED,
+ "Cumulocity tenant URL is not set. Set with the env variable C8YURL",
+ )
if self.project.tenant == "":
self.abort(
- FAILED, "Cumulocity tenant ID is not set. Set with the env variable C8YTENANT")
+ FAILED,
+ "Cumulocity tenant ID is not set. Set with the env variable C8YTENANT",
+ )
if self.project.c8yusername == "":
self.abort(
- FAILED, "Cumulocity tenant username is not set. Set with the env variable C8YUSERNAME")
+ FAILED,
+ "Cumulocity tenant username is not set. Set with the env variable C8YUSERNAME",
+ )
if self.project.c8ypass == "":
self.abort(
- FAILED, "Cumulocity tenant password is not set. Set with the env variable C8YPASS")
+ FAILED,
+ "Cumulocity tenant password is not set. Set with the env variable C8YPASS",
+ )
if self.project.deviceid == "":
self.abort(
- FAILED, "Device ID is not set. Set with the env variable C8YDEVICEID")
+ FAILED, "Device ID is not set. Set with the env variable C8YDEVICEID"
+ )
self.log.info("EnvironmentC8y Setup")
self.addCleanupFunction(self.myenvcleanup)
@@ -77,7 +87,12 @@ class EnvironmentC8y(TedgeEnvironment):
)
self.cumulocity = Cumulocity(
- self.project.c8yurl, self.project.tenant, self.project.c8yusername, self.project.c8ypass, self.log)
+ self.project.c8yurl,
+ self.project.tenant,
+ self.project.c8yusername,
+ self.project.c8ypass,
+ self.log,
+ )
def execute(self):
self.log.debug("EnvironmentC8y Execute")
@@ -112,4 +127,3 @@ class EnvironmentC8y(TedgeEnvironment):
stdouterr="serv_mapper5",
expectedExitStatus="==3",
)
-
diff --git a/tests/PySys/environments/environment_roundtrip_c8y.py b/tests/PySys/environments/environment_roundtrip_c8y.py
index 78d1e8e0..b96659fd 100644
--- a/tests/PySys/environments/environment_roundtrip_c8y.py
+++ b/tests/PySys/environments/environment_roundtrip_c8y.py
@@ -46,7 +46,7 @@ class Environment_roundtrip_c8y(EnvironmentC8y):
time.sleep(int(self.timeslot))
sub = self.startPython(
- environs={"C8YPASS":self.project.c8ypass},
+ environs={"C8YPASS": self.project.c8ypass},
arguments=[
self.cmd,
"-m",
@@ -79,4 +79,3 @@ class Environment_roundtrip_c8y(EnvironmentC8y):
def myenvroundtripcleanup(self):
self.log.debug("C8y Roundtrip MyCleanup")
-
diff --git a/tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py b/tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py
index 16e9d33c..5bd76d54 100644
--- a/tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py
+++ b/tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py
@@ -17,7 +17,7 @@ class PySysTest(BaseTest):
self.tedge = "/usr/bin/tedge"
self.sudo = "/usr/bin/sudo"
self.systemctl = "/usr/bin/systemctl"
- self.environ = { 'HOME':os.environ.get('HOME')}
+ self.environ = {"HOME": os.environ.get("HOME")}
self.startProcess(
command=self.sudo,
@@ -34,7 +34,7 @@ class PySysTest(BaseTest):
arguments=[self.tedge, "mqtt", "pub", "atopic", "amessage"],
stdouterr="tedge_pub_fail",
expectedExitStatus="==1",
- environs=self.environ
+ environs=self.environ,
)
# validate exit status with the expected status from calling startProcess
diff --git a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py
index ca0f8273..4af53c0a 100644
--- a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py
+++ b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py
@@ -17,7 +17,7 @@ class PySysTest(BaseTest):
self.tedge = "/usr/bin/tedge"
self.sudo = "/usr/bin/sudo"
self.systemctl = "/usr/bin/systemctl"
- self.environ = { 'HOME':os.environ.get('HOME')}
+ self.environ = {"HOME": os.environ.get("HOME")}
self.startProcess(
command=self.sudo,
@@ -34,7 +34,7 @@ class PySysTest(BaseTest):
arguments=["mqtt", "pub", "--qos", "0", "atopic", "amessage"],
stdouterr="tedge_pub_fail",
expectedExitStatus="==1",
- environs=self.environ
+ environs=self.environ,
)
# validate exit status with the expected status from calling startProcess
diff --git a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py
index 4bd9c8ad..48d095b4 100644
--- a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py
+++ b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py
@@ -17,7 +17,7 @@ class PySysTest(BaseTest):
self.tedge = "/usr/bin/tedge"
self.sudo = "/usr/bin/sudo"
self.systemctl = "/usr/bin/systemctl"
- self.environ = { 'HOME':os.environ.get('HOME')}
+ self.environ = {"HOME": os.environ.get("HOME")}
self.startProcess(
command=self.sudo,
diff --git a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py
index 3f76cedd..b249eaaa 100644
--- a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py
+++ b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py
@@ -17,7 +17,7 @@ class PySysTest(BaseTest):
self.tedge = "/usr/bin/tedge"
self.sudo = "/usr/bin/sudo"
self.systemctl = "/usr/bin/systemctl"
- self.environ = { 'HOME':os.environ.get('HOME')}
+ self.environ = {"HOME": os.environ.get("HOME")}
self.startProcess(
command=self.sudo,
@@ -34,7 +34,7 @@ class PySysTest(BaseTest):
arguments=["mqtt", "pub", "--qos", "2", "atopic", "amessage"],
stdouterr="tedge_pub_fail",
expectedExitStatus="==1",
- environs=self.environ
+ environs=self.environ,
)