summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Abel <75477722+abelikt@users.noreply.github.com>2022-01-18 13:21:24 +0100
committerGitHub <noreply@github.com>2022-01-18 13:21:24 +0100
commit82ff6a80c4fb5320ef4862a362c8bf29a1300256 (patch)
treec4a6acaf3e14d4da07577cd11701b7f91f158bec
parentfe345b80c9a8d38254fd0736cee90eaf5f07b42d (diff)
Several smaller fixes that should improve stability (#754)
* Sudo plugins explicitly * Make the script also run standalone * Exclude analytics to run in the standard runner ... different runner is coming soon * Allow 350s to complete: see CIT-664 * Give the smoketests some time more to execute ... should raise stability * Fail fast and raise an exception instead of waiting * Extend output with hint on how to run * Improve runtime output for analysis
-rwxr-xr-xci/ci_run_all_sm_tests.sh12
-rwxr-xr-xci/ci_run_all_tests.sh2
-rw-r--r--tests/PySys/analytics/publish_sawmill_record_statistics/pysystest.xml2
-rw-r--r--tests/PySys/plugin_apt/apt_prepare/run.py4
-rw-r--r--tests/PySys/smoketests/smoketest_json_400_samples_10ms/run.py2
-rw-r--r--tests/PySys/smoketests/smoketest_smartrest_400_samples_1Xms/run.py2
-rw-r--r--tests/PySys/software_management_end_to_end/environment_sm_management.py3
-rw-r--r--tests/PySys/software_management_end_to_end/sm_docker_install_remove_multiple/run.py3
-rw-r--r--tests/PySys/tedge_connect/tedge_connect_test_positive/run.py6
9 files changed, 28 insertions, 8 deletions
diff --git a/ci/ci_run_all_sm_tests.sh b/ci/ci_run_all_sm_tests.sh
index 8b957712..ab6bee1f 100755
--- a/ci/ci_run_all_sm_tests.sh
+++ b/ci/ci_run_all_sm_tests.sh
@@ -23,7 +23,17 @@ dpkg -s mosquitto-clients
sudo cp plugins/tedge_docker_plugin/tedge_docker_plugin.sh /etc/tedge/sm-plugins/docker
-sudo cp /home/pi/tedge_dummy_plugin/tedge_dummy_plugin /etc/tedge/sm-plugins/fruits
+# Assume that the pi user has a precompiled dummy plugin
+# use a standard path for the others
+if [ $(whoami) == "pi" ];
+ then
+ sudo cp /home/pi/tedge_dummy_plugin/tedge_dummy_plugin /etc/tedge/sm-plugins/fruits
+ else
+ sudo cp $HOME/thin-edge.io/target/release/tedge_dummy_plugin /etc/tedge/sm-plugins/fruits
+fi
+
+sudo chmod +x /etc/tedge/sm-plugins/docker
+sudo chmod +x /etc/tedge/sm-plugins/fruits
sudo tedge config set software.plugin.default apt
diff --git a/ci/ci_run_all_tests.sh b/ci/ci_run_all_tests.sh
index e1253498..836cf571 100755
--- a/ci/ci_run_all_tests.sh
+++ b/ci/ci_run_all_tests.sh
@@ -42,7 +42,7 @@ pip3 install -r tests/requirements.txt
cd tests/PySys/
set +e
-pysys.py run --record -v DEBUG
+pysys.py run --exclude analytics --record -v DEBUG
set -e
deactivate
diff --git a/tests/PySys/analytics/publish_sawmill_record_statistics/pysystest.xml b/tests/PySys/analytics/publish_sawmill_record_statistics/pysystest.xml
index 655b9af5..3173f926 100644
--- a/tests/PySys/analytics/publish_sawmill_record_statistics/pysystest.xml
+++ b/tests/PySys/analytics/publish_sawmill_record_statistics/pysystest.xml
@@ -9,7 +9,7 @@
</description>
<classification>
<groups inherit="true">
- <group></group>
+ <group>analytics</group>
</groups>
<modes inherit="true">
</modes>
diff --git a/tests/PySys/plugin_apt/apt_prepare/run.py b/tests/PySys/plugin_apt/apt_prepare/run.py
index f6b37f34..3f704954 100644
--- a/tests/PySys/plugin_apt/apt_prepare/run.py
+++ b/tests/PySys/plugin_apt/apt_prepare/run.py
@@ -31,8 +31,8 @@ class AptPluginPrepare(AptPlugin):
# make sure that the timestamp has changed
self.assertThat("old != new", old=self.mtime_old, new=self.mtime_new)
# make sure the cache was updated in the last N seconds
- # N=100 : Took 91s to update at mythic beasts
- self.assertThat("(new +100) >= now", new=self.mtime_new, now=self.now)
+ # See also https://cumulocity.atlassian.net/browse/CIT-664
+ self.assertThat("(new +350) >= now", new=self.mtime_new, now=self.now)
def cleanup_prepare(self):
pass
diff --git a/tests/PySys/smoketests/smoketest_json_400_samples_10ms/run.py b/tests/PySys/smoketests/smoketest_json_400_samples_10ms/run.py
index 847cdfa5..4620ea78 100644
--- a/tests/PySys/smoketests/smoketest_json_400_samples_10ms/run.py
+++ b/tests/PySys/smoketests/smoketest_json_400_samples_10ms/run.py
@@ -18,5 +18,5 @@ class SmoketestJson400Samples10ms(Environment_roundtrip_c8y):
super().setup()
self.samples = "400"
self.delay = "10"
- self.timeslot = "15"
+ self.timeslot = "20"
self.style = "JSON"
diff --git a/tests/PySys/smoketests/smoketest_smartrest_400_samples_1Xms/run.py b/tests/PySys/smoketests/smoketest_smartrest_400_samples_1Xms/run.py
index 86d34fad..7f9c4dde 100644
--- a/tests/PySys/smoketests/smoketest_smartrest_400_samples_1Xms/run.py
+++ b/tests/PySys/smoketests/smoketest_smartrest_400_samples_1Xms/run.py
@@ -22,5 +22,5 @@ class SmoketestSmartRest400Samples1Xms(Environment_roundtrip_c8y):
super().setup()
self.samples = "400"
self.delay = "15"
- self.timeslot = "45" # Temporarily increased to run at mythic beasts
+ self.timeslot = "60" # Temporarily increased to run at mythic beasts
self.style = "REST"
diff --git a/tests/PySys/software_management_end_to_end/environment_sm_management.py b/tests/PySys/software_management_end_to_end/environment_sm_management.py
index a5af16f5..55e18819 100644
--- a/tests/PySys/software_management_end_to_end/environment_sm_management.py
+++ b/tests/PySys/software_management_end_to_end/environment_sm_management.py
@@ -356,6 +356,9 @@ class SoftwareManagement(EnvironmentC8y):
# Invalidate the old operation
self.operation_id = None
break
+ elif current_status == "FAILED":
+ self.log.error("Stopping as the operation has failed")
+ raise SystemError("The operation has failed")
else:
diff --git a/tests/PySys/software_management_end_to_end/sm_docker_install_remove_multiple/run.py b/tests/PySys/software_management_end_to_end/sm_docker_install_remove_multiple/run.py
index 96b569df..c1d254c6 100644
--- a/tests/PySys/software_management_end_to_end/sm_docker_install_remove_multiple/run.py
+++ b/tests/PySys/software_management_end_to_end/sm_docker_install_remove_multiple/run.py
@@ -31,7 +31,8 @@ class SMDockerInstallRemove(SoftwareManagement):
if self.dockerplugin != "dockerplugin":
self.skipTest(
- "Testing the docker plugin is not supported on this platform")
+ "Testing the docker plugin is not supported on this platform" +
+ "To run it, all the test with -Xdockerplugin='dockerplugin'")
setup_action = [
{
diff --git a/tests/PySys/tedge_connect/tedge_connect_test_positive/run.py b/tests/PySys/tedge_connect/tedge_connect_test_positive/run.py
index f0cf1229..089e7f77 100644
--- a/tests/PySys/tedge_connect/tedge_connect_test_positive/run.py
+++ b/tests/PySys/tedge_connect/tedge_connect_test_positive/run.py
@@ -33,5 +33,11 @@ class TedgeConnectTestPositive(EnvironmentC8y):
self.assertGrep(
"tedge_connect_c8y_test_positive.out", "connection check is successful.", contains=True
)
+ try:
+ id = self.device_fragment['id']
+ except:
+ self.log.error("Cannot find id in device_fragment")
+ raise SystemError("Cannot find id in device_fragment")
+
self.assertTrue(
self.device_fragment['id'] != None, "thin-edge.io device with the given name exists")