Updating directly to 4.x is too difficult and complex, as mender 4.x is a complete rewrite in C++, with several new dependencies and changes. As such, update to the last version that was written in Go, which is 3.5.3. The following changes are necessary: The artifact_info file is no longer supported. Instead, mender now expects a bootstrap.mender artifact created by mender-artifact /var/lib/mender. See the following for more information: https://northerntech.atlassian.net/browse/MEN-2585 https://northerntech.atlassian.net/browse/MEN-2583 https://docs.mender.io/release-information/release-notes-changelog/mender-client#mender-3-5-0-1 https://github.com/mendersoftware/mender/blob/3.5.3/Documentation/automatic-bootstrap-artifact.md - Remove all instances of creating or copying an artifact_info file from board examples and package/mender. - Add a generate_mender_bootstrap_artifact method to board/mender/x86_64/post-image-efi.sh which creates a proper bootstrap.mender file and places it in the data partition. - Add a post-build.sh script to support/testing/tests/package/test_mender with the same generate_mender_bootstrap_artifact method with one change: As the rootfs.ext4 file is not yet created; we omit the optional --provides "rootfs-image.checksum:${img_checksum}" argument when generating the bootstrap.mender file. Mender expects the device_type file to exist in /var/lib/mender/device_type. This is further supported by the following line in tests/Dockerfile.daemon: `echo device_type=docker-client > /var/lib/mender/device_type` Add a migration section in docs/manual/migrating.adoc Update the package/mender/readme.txt to include a quick mention of the bootstrap.mender artifact change. License changes: New: vendor/github.com/klauspost/compress/internal/snapref/LICENSE (BSD-3-Clause) vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt (MIT) Removed: vendor/github.com/klauspost/compress/internal/snapref/LICENSE vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt Modified: LICENSE: Update year from 2022 to 2024 LIC_FILES_CHKSUM.sha256: Sum of all Licenses changed vendor/github.com/mendersoftware/mender-artifact/LICENSE - Update year from 2022 to 2023 Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> [Arnout: - fix LIC_FILES_CHKSUM.sha256 hash - Better URL for bootstrap artifact doc - Migrate to 2025.02 instead of 2024.11 - Improve migrating text (editorial changes) ] Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
72 lines
2.3 KiB
Python
72 lines
2.3 KiB
Python
import os
|
|
|
|
import infra.basetest
|
|
|
|
|
|
class TestMenderInfra(infra.basetest.BRTest):
|
|
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
|
|
"""
|
|
BR2_PACKAGE_MENDER=y
|
|
BR2_PACKAGE_HOST_MENDER_ARTIFACT=y
|
|
BR2_TARGET_ROOTFS_CPIO=y
|
|
BR2_ROOTFS_POST_BUILD_SCRIPT="{}"
|
|
BR2_ROOTFS_OVERLAY="{}"
|
|
""".format(
|
|
infra.filepath("tests/package/test_mender/post-build.sh"),
|
|
# overlay to add a fake 'fw_printenv', used by Mender
|
|
infra.filepath("tests/package/test_mender/rootfs-overlay"))
|
|
|
|
def base_test_run(self):
|
|
cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
|
|
self.emulator.boot(arch="armv5", kernel="builtin",
|
|
options=["-initrd", cpio_file])
|
|
self.emulator.login()
|
|
|
|
def run_mender_test(self):
|
|
self.assertRunOk("ps aux | egrep [m]ender")
|
|
|
|
# Check if a simple Mender command is correctly executed
|
|
self.assertRunOk("mender -log-level debug show-artifact")
|
|
self.assertRunOk("mender -log-level debug show-artifact | grep 'RUNTIME_TEST_ARTIFACT_NAME'")
|
|
cmd = "mender show-artifact 2>&1 | grep -i 'err'" # Check if no 'error' among the traces
|
|
_, exit_code = self.emulator.run(cmd)
|
|
self.assertEqual(exit_code, 1)
|
|
|
|
|
|
class TestMenderRW(TestMenderInfra):
|
|
def test_run(self):
|
|
TestMenderInfra.base_test_run(self)
|
|
|
|
# Check if the Daemon is running
|
|
self.assertRunOk("ls /var/run/mender.pid")
|
|
self.run_mender_test()
|
|
|
|
|
|
class TestMenderRO(TestMenderInfra):
|
|
config = \
|
|
"""
|
|
{}
|
|
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
|
|
""".format(TestMenderInfra.config)
|
|
|
|
def test_run(self):
|
|
TestMenderInfra.base_test_run(self)
|
|
|
|
# Check if the Daemon is running
|
|
self.assertRunOk("ls /var/run/mender.pid")
|
|
self.run_mender_test()
|
|
|
|
|
|
class TestMenderSystemd(TestMenderInfra):
|
|
config = \
|
|
"""
|
|
{}
|
|
BR2_INIT_SYSTEMD=y
|
|
""".format(TestMenderInfra.config)
|
|
|
|
def test_run(self):
|
|
TestMenderInfra.base_test_run(self)
|
|
output, _ = self.emulator.run("systemctl is-active mender-client")
|
|
self.assertEqual(output[0], "active")
|
|
self.run_mender_test()
|