Merge ~cypressyew/qa-regression-testing:phlin/posix-ipc-jammy into qa-regression-testing:master

Proposed by Po-Hsu Lin
Status: Merged
Merged at revision: a7fbd8eb04e247ce91f63ef2019e0c5786bfc70a
Proposed branch: ~cypressyew/qa-regression-testing:phlin/posix-ipc-jammy
Merge into: qa-regression-testing:master
Diff against target: 15 lines (+2/-2)
1 file modified
scripts/test-apparmor.py (+2/-2)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Po-Hsu Lin Pending
Review via email: mp+439910@code.launchpad.net

This proposal supersedes a proposal from 2023-03-23.

Commit message

With the apparmor package on Jammy updated to 3.0.4-2ubuntu2.2,
non-x86 archs on Jammy are failing with this posix_ipc test as well.

Apply the patch we use for LP: #2000359

Bug: https://bugs.launchpad.net/qa-regression-testing/+bug/2012591

Description of the change

Simplify the if statement, apply the patch for apparmor >= 3.0.4-2ubuntu2.2

To post a comment you must log in.
Revision history for this message
Alex Murray (alexmurray) wrote : Posted in a previous version of this proposal

LGTM - note this is also being SRU'd back to focal as well with version 2.13.3-7ubuntu5.2 so it would probably be worth adding a similar check for that release and version as well.

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote : Posted in a previous version of this proposal

Thanks Alex, I will resubmit one with Focal added.

review: Needs Resubmitting
Revision history for this message
Po-Hsu Lin (cypressyew) wrote : Posted in a previous version of this proposal

Hello Alex,
I got apparmor on Focal proposed (2.13.3-7ubuntu5.2) tested with the ApparmorTestsuites.test_regression_testsuite, with commit 2548c39948 in qa-regression-testing.
But I was unable to trigger this failure. Maybe this is not need yet for Focal?

$ sudo python3 ./test-apparmor.py -v ApparmorTestsuites.test_regression_testsuite
Running test: './test-apparmor.py' distro: 'Ubuntu 20.04' kernel: '5.4.0-146.163 (Ubuntu 5.4.0-146.163-generic 5.4.229)' arch: 'amd64' uid: 0/0 SUDO_USER: 'ubuntu')
Skipping private tests

WARN: kernel rate limiting in effect
Disabling ratelimiting until the next reboot. To renable, run:
# sysctl -w kernel.printk_ratelimit=5

test_regression_testsuite (__main__.ApparmorTestsuites)
Run kernel regression tests ...
  preparing apparmor_2.13.3-7ubuntu5.2.dsc... done

 (disabling ptrace for this test)
(Applying patch use-pyflakes3-with-2.13.patch) (Applying patch 0001-regression-tests-add-FIPS-140-2-lib-validation-hmac-.patch) ok

----------------------------------------------------------------------
Ran 1 test in 625.085s

OK

Revision history for this message
Po-Hsu Lin (cypressyew) wrote : Posted in a previous version of this proposal

I see what's going on, I was using amd64 for focal. Should be non-amd64.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote : Posted in a previous version of this proposal

Hmm, with Focal ARM64 + apparmor 2.13.3-7ubuntu5.2 I was still unable to trigger this issue.

$ sudo python3 ./test-apparmor.py -v ApparmorTestsuites.test_regression_testsuite
Running test: './test-apparmor.py' distro: 'Ubuntu 20.04' kernel: '5.4.0-146.163 (Ubuntu 5.4.0-146.163-generic 5.4.229)' arch: 'arm64' uid: 0/0 SUDO_USER: 'ubuntu')
Skipping private tests

WARN: kernel rate limiting in effect
Disabling ratelimiting until the next reboot. To renable, run:
# sysctl -w kernel.printk_ratelimit=5

test_regression_testsuite (__main__.ApparmorTestsuites)
Run kernel regression tests ...
  preparing apparmor_2.13.3-7ubuntu5.2.dsc... done

 (disabling ptrace for this test)
(Applying patch use-pyflakes3-with-2.13.patch) (Applying patch 0001-regression-tests-add-FIPS-140-2-lib-validation-hmac-.patch) ok

----------------------------------------------------------------------
Ran 1 test in 550.435s

OK

Revision history for this message
Alex Murray (alexmurray) wrote : Posted in a previous version of this proposal

Ok no worries - I assumed that since apparmor in focal now supports posix_mq mediation that this would also be needed - but if not then let's keep it as is.

Revision history for this message
Steve Beattie (sbeattie) wrote : Posted in a previous version of this proposal

Hey Po-Hsu,

On Thu, Mar 23, 2023 at 08:44:29AM -0000, Po-Hsu Lin wrote:
> Po-Hsu Lin has proposed merging ~cypressyew/qa-regression-testing:phlin/posix-ipc-jammy into qa-regression-testing:master.
>
> Commit message:
> With the apparmor package on Jammy updated to 3.0.4-2ubuntu2.2,
> non-x86 archs on Jammy are failing with this posix_ipc test as well.
>
> diff --git a/scripts/test-apparmor.py b/scripts/test-apparmor.py
> index 0886cff..bf412a3 100755
> --- a/scripts/test-apparmor.py
> +++ b/scripts/test-apparmor.py
> @@ -1763,8 +1763,9 @@ class ApparmorTestsuites(testlib.TestlibCase):
> self._apply_patch('0001-Add-CAP_CHECKPOINT_RESTORE-to-severity.db.patch')
>
> # on non-x86 systems the posix_ipc tests fail with "Unrecognized option"
> - # (LP: #2000359)
> - if testlib.dpkg_compare_installed_version('apparmor', 'ge', '3.0.7-1ubuntu2'):
> + # (LP: #2000359, LP: #2012591)
> + if testlib.dpkg_compare_installed_version('apparmor', 'ge', '3.0.7-1ubuntu2') or \
> + (self.lsb_release['Release'] == 22.04 and testlib.dpkg_compare_installed_version('apparmor', 'ge', '3.0.4-2ubuntu2.2')):
> self._apply_patch('tests-fix-variable-type-for-getopt.patch')

This is fine as-is, but personally I would just simplify the test
down to testlib.dpkg_compare_installed_version('apparmor', 'ge',
'3.0.4-2ubuntu2.2') and if we then end up with specific package
versions that have it fixed (unlikely), then we can get into specific
release+version ranges.

It would be nice to fix this in lunar's apparmor before release.

I am surprised that it is not showing up in focal's backport of
the mqueue test patches; looking at the patch set, the 'char opt'
declaration bug in the tests are both present. It would not hurt
to apply there, and then in that case we would need to have the
focal/2.13.3-7ubuntu5.2 pair as part of the test.

Thanks.

--
Steve Beattie
<email address hidden>

Revision history for this message
Po-Hsu Lin (cypressyew) wrote : Posted in a previous version of this proposal

Thanks for the comment, I will resubmit with just:
  if testlib.dpkg_compare_installed_version('apparmor', 'ge', '3.0.4-2ubuntu2.2'):
      self._apply_patch('tests-fix-variable-type-for-getopt.patch')

As suggested.

Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM - thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/test-apparmor.py b/scripts/test-apparmor.py
2index 2054c33..5fe13a0 100755
3--- a/scripts/test-apparmor.py
4+++ b/scripts/test-apparmor.py
5@@ -1764,8 +1764,8 @@ class ApparmorTestsuites(testlib.TestlibCase):
6 self._apply_patch('0001-Add-CAP_CHECKPOINT_RESTORE-to-severity.db.patch')
7
8 # on non-x86 systems the posix_ipc tests fail with "Unrecognized option"
9- # (LP: #2000359)
10- if testlib.dpkg_compare_installed_version('apparmor', 'ge', '3.0.7-1ubuntu2'):
11+ # (LP: #2000359, LP: #2012591)
12+ if testlib.dpkg_compare_installed_version('apparmor', 'ge', '3.0.4-2ubuntu2.2'):
13 self._apply_patch('tests-fix-variable-type-for-getopt.patch')
14
15 print("done")

Subscribers

People subscribed via source and target branches