push
gitlab-ci
fix(update-modules): fail the install when the backup fails `ret=$?` was read inside `if ! <backup>; then`, where `$?` holds the status of the negated pipeline and is therefore always 0. Both modules exited 0 before applying the payload, so a failed install was reported to the server as successful: the destination was left untouched while the new software version was recorded for it. Capture the status from the command itself instead. The directory module is the more exposed of the two, since it backs up the whole destination directory, so any unrelated file growing there can exhaust the data partition. Reported from the field with a multi-GB core dump. Add a pytest suite for the shipped update module scripts, alongside the existing one for the artifact generators, covering both a failing backup and a successful install for each module. Ignore the Python test caches while here, since the new suite is the second pytest directory in the tree. Ticket: MEN-10021 Changelog: Fixed the directory and single-file Update Modules reporting a deployment as successful when the destination could not be backed up, leaving the destination unchanged. (cherry picked from commit 8d6f02c81) Signed-off-by: Ludvig Szklarz Anderson <ludvig.s.anderson@northern.tech>
8487 of 10433 relevant lines covered (81.35%)
21663.75 hits per line