Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA-817: Install script module for the tests that need it and enable them #2681

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,10 @@ def check_log_is_unauthenticated(device, since=None):
Helpers._check_log_for_message(
device, "Failed to authorize with the server", since
)

@staticmethod
def install_community_update_module(device, module):
url = f"https://raw.githubusercontent.com/mendersoftware/mender-update-modules/master/{module}/module/{module}"
device.run("mkdir -p /usr/share/mender/modules/v3")
device.run(f"wget -P /usr/share/mender/modules/v3 {url}")
device.run(f"chmod +x /usr/share/mender/modules/v3/{module}")
5 changes: 4 additions & 1 deletion tests/tests/test_deployment_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .. import conftest
from ..common_setup import enterprise_no_client
from ..MenderAPI import logger, Authentication, DeviceAuthV2, Deployments
from ..helpers import Helpers
from testutils.infra.cli import CliTenantadm
from testutils.common import Tenant, User, new_tenant_client
from .common_artifact import get_script_artifact
Expand Down Expand Up @@ -53,7 +54,6 @@ def make_script_artifact(artifact_name, device_type, output_path):
return get_script_artifact(script, artifact_name, device_type, output_path)


@pytest.mark.skip(reason="FIXME: QA-817")
@pytest.mark.usefixtures("enterprise_no_client")
class TestDeploymentRetryEnterprise(MenderTesting):
"""Tests the retry deployment functionality"""
Expand Down Expand Up @@ -100,6 +100,9 @@ def test_deployment_retry_failed_update(self, enterprise_no_client):
)
devauth.accept_devices(1)

# Install the script update module required for this test
Helpers.install_community_update_module(device, "script")

with tempfile.NamedTemporaryFile() as tf:

artifact = make_script_artifact(
Expand Down
9 changes: 7 additions & 2 deletions tests/tests/test_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
enterprise_one_client_bootstrapped,
)
from ..MenderAPI import DeviceAuthV2, Deployments, Inventory, logger
from ..helpers import Helpers
from .common_artifact import get_script_artifact
from .mendertesting import MenderTesting

Expand All @@ -47,6 +48,9 @@ def do_test_inventory(self, env):
deploy = Deployments(env.auth, devauth)
inv = Inventory(env.auth)

# Install the script update module required for this test
Helpers.install_community_update_module(env.device, "script")

def deploy_simple_artifact(artifact_name, extra_args):
# create a simple artifact (script) which doesn't do anything
with tempfile.NamedTemporaryFile() as tf:
Expand Down Expand Up @@ -227,6 +231,9 @@ def do_test_inventory_update_after_successful_deployment(self, env):
mender_device.run(sedcmd)
mender_device.run("systemctl restart mender-updated")

# Install the script update module required for this test
Helpers.install_community_update_module(mender_device, "script")

# Get the inventory sent after first boot
initial_inv_json = inv.get_devices()
assert len(initial_inv_json) > 0
Expand Down Expand Up @@ -271,7 +278,6 @@ def deploy_simple_artifact(artifact_name, extra_args):
), "The device has not updated the inventory after the update"


@pytest.mark.skip(reason="FIXME: QA-817")
class TestInventoryOpenSource(BaseTestInventory):
@MenderTesting.fast
def test_inventory(self, standard_setup_one_client_bootstrapped):
Expand All @@ -286,7 +292,6 @@ def test_inventory_update_after_successful_deployment(
)


@pytest.mark.skip(reason="FIXME: QA-817")
class TestInventoryEnterprise(BaseTestInventory):
@MenderTesting.fast
def test_inventory(self, enterprise_one_client_bootstrapped):
Expand Down
6 changes: 4 additions & 2 deletions tests/tests/test_mender_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ def do_test_deployment_two_devices_parallel_updates_multiple_deployments(
devauth = DeviceAuthV2(env.auth)
deploy = Deployments(env.auth, devauth)

# Install the script update module required for this test
Helpers.install_community_update_module(mender_device_1, "script")
Helpers.install_community_update_module(mender_device_2, "script")

host_ip = env.get_virtual_network_host_ip()
mender_conf = mender_device_1.run("cat /etc/mender/mender.conf")
valid_image = valid_image_with_mender_conf(mender_conf)
Expand Down Expand Up @@ -514,7 +518,6 @@ def test_deployment_two_devices_parallel_updates_one_aborted(
valid_image_with_mender_conf,
)

@pytest.mark.skip(reason="FIXME: QA-817")
@flaky(max_runs=3)
@MenderTesting.fast
def test_deployment_two_devices_parallel_updates_multiple_deployments(
Expand Down Expand Up @@ -619,7 +622,6 @@ def test_deployment_two_devices_parallel_updates_one_aborted(
valid_image_with_mender_conf,
)

@pytest.mark.skip(reason="FIXME: QA-817")
@flaky(max_runs=3)
@MenderTesting.fast
def test_deployment_two_devices_parallel_updates_multiple_deployments(
Expand Down
5 changes: 4 additions & 1 deletion tests/tests/test_mtls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

from .. import conftest
from ..MenderAPI import reset_mender_api, auth, deploy, devauth, logger
from ..helpers import Helpers
from .common_artifact import get_script_artifact
from .mendertesting import MenderTesting

Expand Down Expand Up @@ -85,7 +86,6 @@ def make_script_artifact(artifact_name, device_type, output_path):
return get_script_artifact(script, artifact_name, device_type, output_path)


@pytest.mark.skip(reason="FIXME: QA-817")
@pytest.mark.skipif(
isK8S(), reason="not relevant in a staging or production environment"
)
Expand Down Expand Up @@ -200,6 +200,9 @@ def common_test_mtls_enterprise(
self.hsm_setup(pin, ssl_engine_id, env.device)
key_uri = self.hsm_get_key_uri(pin, ssl_engine_id, env.device)

# Install the script update module required for this test
Helpers.install_community_update_module(env.device, "script")

try:
# retrieve the original configuration file
output = env.device.run("cat /etc/mender/mender.conf")
Expand Down