Bug description: Applied patches go to a Partial-Applied state
after applying a new reboot-required patch, until the system reboots.
Please note that this bug only happens when applying a new patch,
when removing patches the previously applied patches don't have
their state changed.
sw-patch query result before applying a new patch:
Patch ID RR Release Patch State =========================== == ======= ===========
PATCH_0001 Y 9.0 Applied
PATCH_0002 Y 9.0 Applied
PATCH_0003 Y 9.0 Applied
PATCH_0004 Y 9.0 Applied
PATCH_0005 Y 9.0 Available
Then after applying the latest patch, previously applied patches
go to partial-applied, as follows:
Patch ID RR Release Patch State =========================== == ======= =============
PATCH_0001 Y 9.0 Partial-Apply
PATCH_0002 Y 9.0 Partial-Apply
PATCH_0003 Y 9.0 Partial-Apply
PATCH_0004 Y 9.0 Applied
PATCH_0005 Y 9.0 Partial-Apply
This happens because the previously applied patches commit
doesn't match the latest_sysroot_commit, but the latest applied patch
(in our example PATCH_0004) do have their commit matching, so we need
to mark their dependent patches as Applied.
Test Plan:
PASS: For in-service patches (non reboot-required) the issues doesn't happen and the bugfix in place it has the same behavior.
PASS: Python code for patch_controler.py unit tests pass and a
a new test case was created to cover this condition
After this bugfix, using a virtual machine with patched code, the patch reports are the following:
Patch ID RR Release Patch State =========================== == ======= =============
PATCH_0001 Y 9.0 Applied
PATCH_0002 Y 9.0 Applied
PATCH_0003 Y 9.0 Applied
PATCH_0004 Y 9.0 Applied
PATCH_0005 Y 9.0 Partial-Apply
Reviewed: https:/ /review. opendev. org/c/starlingx /update/ +/916800 /opendev. org/starlingx/ update/ commit/ 32d49f15f14ac28 b1f62865fff517c fdffbfdc73
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 32d49f15f14ac28 b1f62865fff517c fdffbfdc73
Author: caio-volpato <email address hidden>
Date: Fri Apr 19 16:58:11 2024 -0300
Patch state reporting bugfix
This commit fixes the sw-patch reporting bug.
Bug description: Applied patches go to a Partial-Applied state
after applying a new reboot-required patch, until the system reboots.
Please note that this bug only happens when applying a new patch,
when removing patches the previously applied patches don't have
their state changed.
sw-patch query result before applying a new patch:
PATCH_0001 Y 9.0 Applied
PATCH_0002 Y 9.0 Applied
PATCH_0003 Y 9.0 Applied
PATCH_0004 Y 9.0 Applied
PATCH_0005 Y 9.0 Available
Then after applying the latest patch, previously applied patches
go to partial-applied, as follows:
PATCH_0001 Y 9.0 Partial-Apply
PATCH_0002 Y 9.0 Partial-Apply
PATCH_0003 Y 9.0 Partial-Apply
PATCH_0004 Y 9.0 Applied
PATCH_0005 Y 9.0 Partial-Apply
This happens because the previously applied patches commit sysroot_ commit, but the latest applied patch
doesn't match the latest_
(in our example PATCH_0004) do have their commit matching, so we need
to mark their dependent patches as Applied.
Test Plan:
PASS: For in-service patches (non reboot-required) the issues doesn't happen and the bugfix in place it has the same behavior.
PASS: Python code for patch_controler.py unit tests pass and a
a new test case was created to cover this condition
After this bugfix, using a virtual machine with patched code, the patch reports are the following:
PATCH_0001 Y 9.0 Applied
PATCH_0002 Y 9.0 Applied
PATCH_0003 Y 9.0 Applied
PATCH_0004 Y 9.0 Applied
PATCH_0005 Y 9.0 Partial-Apply
Closes-Bug: 2063374
Change-Id: Ibceeecbf025535 b73886517b6ce02 e6013d99aea
Signed-off-by: caio-volpato <email address hidden>