diff mbox series

[ACT,2/3] UBUNTU: SAUCE: ubuntu_ltp_syscalls: import pending LTP patches for several failures

Message ID 20210628075217.12395-2-krzysztof.kozlowski@canonical.com
State New
Headers show
Series [ACT,1/3] UBUNTU: SAUCE: ubuntu_ltp: import pending LTP patches for several failures | expand

Commit Message

Krzysztof Kozlowski June 28, 2021, 7:52 a.m. UTC
Few patches to upstream LTP project are pending for longer time (2-3
weeks).  Either the discussion is on-going (and not necessarily going
anywhere like in case of controllers/memcg patches) or they are ignored.

These patches fix real test issues, so apply them here.  The patchset
contains fixes for ubuntu_ltp and ubuntu_ltp_syscalls, because it is
easier to keep one set.

Move the existing syscalls "UBUNTU: SAUCE: skip fanotify09 test #2 for
older kernels" to same folder and share it with ubuntu_ltp to keep
out-of-tree patches consistent.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 ...p-fanotify09-test-2-for-older-kernel.patch |  0
 ubuntu_ltp/ubuntu_ltp.py                      |  2 ++
 ubuntu_ltp_syscalls/patches                   |  1 +
 ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py    | 34 +++++++++++++++++++
 4 files changed, 37 insertions(+)
 rename {ubuntu_ltp_syscalls => ubuntu_ltp/patches}/0001-skip-fanotify09-test-2-for-older-kernel.patch (100%)
 create mode 120000 ubuntu_ltp_syscalls/patches

Comments

Po-Hsu Lin June 30, 2021, 11:27 a.m. UTC | #1
On Mon, Jun 28, 2021 at 3:52 PM Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> wrote:
>
> Few patches to upstream LTP project are pending for longer time (2-3
> weeks).  Either the discussion is on-going (and not necessarily going
> anywhere like in case of controllers/memcg patches) or they are ignored.
>
> These patches fix real test issues, so apply them here.  The patchset
> contains fixes for ubuntu_ltp and ubuntu_ltp_syscalls, because it is
> easier to keep one set.
>
> Move the existing syscalls "UBUNTU: SAUCE: skip fanotify09 test #2 for
> older kernels" to same folder and share it with ubuntu_ltp to keep
> out-of-tree patches consistent.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  ...p-fanotify09-test-2-for-older-kernel.patch |  0
>  ubuntu_ltp/ubuntu_ltp.py                      |  2 ++
>  ubuntu_ltp_syscalls/patches                   |  1 +
>  ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py    | 34 +++++++++++++++++++
>  4 files changed, 37 insertions(+)
>  rename {ubuntu_ltp_syscalls => ubuntu_ltp/patches}/0001-skip-fanotify09-test-2-for-older-kernel.patch (100%)
>  create mode 120000 ubuntu_ltp_syscalls/patches
>
> diff --git a/ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch b/ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
> similarity index 100%
> rename from ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch
> rename to ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
> diff --git a/ubuntu_ltp/ubuntu_ltp.py b/ubuntu_ltp/ubuntu_ltp.py
> index 3b89d21d2c92..9d0f96d4730c 100644
> --- a/ubuntu_ltp/ubuntu_ltp.py
> +++ b/ubuntu_ltp/ubuntu_ltp.py
> @@ -13,6 +13,8 @@ class ubuntu_ltp(test.test):
>      version = 1
>      patches = [
>          # Each element is also a list of patch title (user printable) and relative path to patch from bindir
> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
>          ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
>           'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
>          ['include/tst_pid.h: fix language typo (subtraction)',
> diff --git a/ubuntu_ltp_syscalls/patches b/ubuntu_ltp_syscalls/patches
> new file mode 120000
> index 000000000000..bd31461cfab9
> --- /dev/null
> +++ b/ubuntu_ltp_syscalls/patches
> @@ -0,0 +1 @@
> +../ubuntu_ltp/patches
> \ No newline at end of file
> diff --git a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> index b6b09246393b..1f8bbfee46d0 100644
> --- a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> +++ b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> @@ -22,6 +22,35 @@ except Exception, e:
>
>  class ubuntu_ltp_syscalls(test.test):
>      version = 1
> +    patches = [
> +        # Each element is also a list of patch title (user printable) and relative path to patch from bindir
> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
> +        ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
> +         'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
> +        ['include/tst_pid.h: fix language typo (subtraction)',
> +         'patches/0002-include-tst_pid.h-fix-language-typo-subtraction.patch'],
> +        ['syscalls/msgstress04: fix fork failure on small memory systems',
> +         'patches/0003-syscalls-msgstress04-fix-fork-failure-on-small-memor.patch'],
> +        ['syscalls/msgstress03: fix fork failure on small memory systems',
> +         'patches/0004-syscalls-msgstress03-fix-fork-failure-on-small-memor.patch'],
> +        ['syscalls/msgstress: tune limit of processes for small machines',
> +         'patches/0005-syscalls-msgstress-tune-limit-of-processes-for-small.patch'],
> +        ['patches/device-drivers/cpufreq_boost: skip test on virtual machines',
> +         'patches/0006-device-drivers-cpufreq_boost-skip-test-on-virtual-ma.patch'],
> +        ['lib: memutils: don\'t pollute entire system memory to avoid OoM',
> +         'patches/0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch'],
> +        ['controllers/memcg: accept range of max_usage_in_bytes/memcg: accept range of max_usage_in_bytes',
> +         'patches/0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch'],
> +        ['controllers/memcg: accept range of usage_in_bytes',
> +         'patches/0009-controllers-memcg-accept-range-of-usage_in_bytes.patch'],
> +        ['controllers/memcg: accept non-zero max_usage_in_bytes after reset',
> +          'patches/0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch'],
> +        ['controllers/memcg: increase memory limit in subgroup charge',
> +         'patches/0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch'],
> +        ['tpci: accept ENOMEM resource failure with virtio-pci',
> +         'patches/0012-tpci-accept-ENOMEM-resource-failure-with-virtio-pci.patch'],
> +    ]
>
>      def install_required_pkgs(self):
>          arch = platform.processor()
> @@ -42,6 +71,7 @@ class ubuntu_ltp_syscalls(test.test):
>              'libselinux1-dev',
>              'libssl-dev',
>              'libtirpc-dev',
> +            'patchutils',
>              'pkg-config',
>              'quota',
>              'virt-what',
> @@ -97,6 +127,10 @@ class ubuntu_ltp_syscalls(test.test):
>          print("Patching fanotify09 for older kernels...")
>          utils.system('patch -N -p1 < %s/0001-skip-fanotify09-test-2-for-older-kernel.patch' % self.bindir)
>
Hi Krzysztof,

code below will conflict with the existing patch command above.

Also, there is another tricky part is that we kinda "freeze" the LTP
repo for ESM releases like trusty (b938c86be UBUNTU: SAUCE:
ubuntu_ltp_syscalls: use a fixed SHA1 for ESM releases) since they're
not going to receive any other non-CVE related patches. By doing so
it can help us to narrow down failing cases that we need to fix on
these ESM releases, otherwise we can alway expect to see newer test
cases failing on them.
(And we might need to do this for Xenial as well.)

Some of your patches cannot be applied on top of LTP de9dd02b:
* 0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch
* 0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch
* 0009-controllers-memcg-accept-range-of-usage_in_bytes.patch
* 0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch
* 0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch

We can fix this by tailoring which patch should be applied, or fast
forward the tip we use on ESM series, but these changes here are
mostly for other tests (not for syscalls), not sure if it worth it
to spend more time on this?

Thanks
Sam

> +        for patch in self.patches:
> +            print("Patching with: %s" % patch[0])
> +            utils.system('patch -p1 < %s/%s' % (self.bindir, patch[1]))
> +
>          # Disable NTFS as we disable RW support
>          cmd = 'sed -i /ntfs/d lib/tst_supported_fs_types.c'
>          utils.system_output(cmd)
> --
> 2.27.0
>
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Krzysztof Kozlowski June 30, 2021, 11:38 a.m. UTC | #2
On 30/06/2021 13:27, Po-Hsu Lin wrote:
> 
> On Mon, Jun 28, 2021 at 3:52 PM Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> wrote:
>>
>> Few patches to upstream LTP project are pending for longer time (2-3
>> weeks).  Either the discussion is on-going (and not necessarily going
>> anywhere like in case of controllers/memcg patches) or they are ignored.
>>
>> These patches fix real test issues, so apply them here.  The patchset
>> contains fixes for ubuntu_ltp and ubuntu_ltp_syscalls, because it is
>> easier to keep one set.
>>
>> Move the existing syscalls "UBUNTU: SAUCE: skip fanotify09 test #2 for
>> older kernels" to same folder and share it with ubuntu_ltp to keep
>> out-of-tree patches consistent.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>> ---
>>  ...p-fanotify09-test-2-for-older-kernel.patch |  0
>>  ubuntu_ltp/ubuntu_ltp.py                      |  2 ++
>>  ubuntu_ltp_syscalls/patches                   |  1 +
>>  ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py    | 34 +++++++++++++++++++
>>  4 files changed, 37 insertions(+)
>>  rename {ubuntu_ltp_syscalls => ubuntu_ltp/patches}/0001-skip-fanotify09-test-2-for-older-kernel.patch (100%)
>>  create mode 120000 ubuntu_ltp_syscalls/patches
>>
>> diff --git a/ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch b/ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
>> similarity index 100%
>> rename from ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch
>> rename to ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
>> diff --git a/ubuntu_ltp/ubuntu_ltp.py b/ubuntu_ltp/ubuntu_ltp.py
>> index 3b89d21d2c92..9d0f96d4730c 100644
>> --- a/ubuntu_ltp/ubuntu_ltp.py
>> +++ b/ubuntu_ltp/ubuntu_ltp.py
>> @@ -13,6 +13,8 @@ class ubuntu_ltp(test.test):
>>      version = 1
>>      patches = [
>>          # Each element is also a list of patch title (user printable) and relative path to patch from bindir
>> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
>> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
>>          ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
>>           'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
>>          ['include/tst_pid.h: fix language typo (subtraction)',
>> diff --git a/ubuntu_ltp_syscalls/patches b/ubuntu_ltp_syscalls/patches
>> new file mode 120000
>> index 000000000000..bd31461cfab9
>> --- /dev/null
>> +++ b/ubuntu_ltp_syscalls/patches
>> @@ -0,0 +1 @@
>> +../ubuntu_ltp/patches
>> \ No newline at end of file
>> diff --git a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>> index b6b09246393b..1f8bbfee46d0 100644
>> --- a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>> +++ b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>> @@ -22,6 +22,35 @@ except Exception, e:
>>
>>  class ubuntu_ltp_syscalls(test.test):
>>      version = 1
>> +    patches = [
>> +        # Each element is also a list of patch title (user printable) and relative path to patch from bindir
>> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
>> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
>> +        ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
>> +         'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
>> +        ['include/tst_pid.h: fix language typo (subtraction)',
>> +         'patches/0002-include-tst_pid.h-fix-language-typo-subtraction.patch'],
>> +        ['syscalls/msgstress04: fix fork failure on small memory systems',
>> +         'patches/0003-syscalls-msgstress04-fix-fork-failure-on-small-memor.patch'],
>> +        ['syscalls/msgstress03: fix fork failure on small memory systems',
>> +         'patches/0004-syscalls-msgstress03-fix-fork-failure-on-small-memor.patch'],
>> +        ['syscalls/msgstress: tune limit of processes for small machines',
>> +         'patches/0005-syscalls-msgstress-tune-limit-of-processes-for-small.patch'],
>> +        ['patches/device-drivers/cpufreq_boost: skip test on virtual machines',
>> +         'patches/0006-device-drivers-cpufreq_boost-skip-test-on-virtual-ma.patch'],
>> +        ['lib: memutils: don\'t pollute entire system memory to avoid OoM',
>> +         'patches/0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch'],
>> +        ['controllers/memcg: accept range of max_usage_in_bytes/memcg: accept range of max_usage_in_bytes',
>> +         'patches/0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch'],
>> +        ['controllers/memcg: accept range of usage_in_bytes',
>> +         'patches/0009-controllers-memcg-accept-range-of-usage_in_bytes.patch'],
>> +        ['controllers/memcg: accept non-zero max_usage_in_bytes after reset',
>> +          'patches/0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch'],
>> +        ['controllers/memcg: increase memory limit in subgroup charge',
>> +         'patches/0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch'],
>> +        ['tpci: accept ENOMEM resource failure with virtio-pci',
>> +         'patches/0012-tpci-accept-ENOMEM-resource-failure-with-virtio-pci.patch'],
>> +    ]
>>
>>      def install_required_pkgs(self):
>>          arch = platform.processor()
>> @@ -42,6 +71,7 @@ class ubuntu_ltp_syscalls(test.test):
>>              'libselinux1-dev',
>>              'libssl-dev',
>>              'libtirpc-dev',
>> +            'patchutils',
>>              'pkg-config',
>>              'quota',
>>              'virt-what',
>> @@ -97,6 +127,10 @@ class ubuntu_ltp_syscalls(test.test):
>>          print("Patching fanotify09 for older kernels...")
>>          utils.system('patch -N -p1 < %s/0001-skip-fanotify09-test-2-for-older-kernel.patch' % self.bindir)
>>
> Hi Krzysztof,
> 
> code below will conflict with the existing patch command above.

I thought I removed it... my bad.

> 
> Also, there is another tricky part is that we kinda "freeze" the LTP
> repo for ESM releases like trusty (b938c86be UBUNTU: SAUCE:
> ubuntu_ltp_syscalls: use a fixed SHA1 for ESM releases) since they're
> not going to receive any other non-CVE related patches. By doing so
> it can help us to narrow down failing cases that we need to fix on
> these ESM releases, otherwise we can alway expect to see newer test
> cases failing on them.
> (And we might need to do this for Xenial as well.)

How about then mirroring the LTP repo and having dedicated (obvious)
branches for xenial and current testing? Rebasing patches would be also
much easier. Usually rebase and cherry-pick can work around significant
hunk differences. Manual patching - cannot.

> Some of your patches cannot be applied on top of LTP de9dd02b:
> * 0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch
> * 0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch
> * 0009-controllers-memcg-accept-range-of-usage_in_bytes.patch
> * 0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch
> * 0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch
> 
> We can fix this by tailoring which patch should be applied, or fast
> forward the tip we use on ESM series, but these changes here are
> mostly for other tests (not for syscalls), not sure if it worth it
> to spend more time on this?

I think the easiest would be to have the same code for all of them -
ubuntu_ltp, ltp_syscalls and ltp_stable. Managing two or three separate
patchsets is additional effort.


Best regards,
Krzysztof
Po-Hsu Lin July 7, 2021, 6:08 a.m. UTC | #3
On Wed, Jun 30, 2021 at 7:38 PM Krzysztof Kozlowski
<krzysztof.kozlowski@canonical.com> wrote:
>
> On 30/06/2021 13:27, Po-Hsu Lin wrote:
> >
> > On Mon, Jun 28, 2021 at 3:52 PM Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> wrote:
> >>
> >> Few patches to upstream LTP project are pending for longer time (2-3
> >> weeks).  Either the discussion is on-going (and not necessarily going
> >> anywhere like in case of controllers/memcg patches) or they are ignored.
> >>
> >> These patches fix real test issues, so apply them here.  The patchset
> >> contains fixes for ubuntu_ltp and ubuntu_ltp_syscalls, because it is
> >> easier to keep one set.
> >>
> >> Move the existing syscalls "UBUNTU: SAUCE: skip fanotify09 test #2 for
> >> older kernels" to same folder and share it with ubuntu_ltp to keep
> >> out-of-tree patches consistent.
> >>
> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> >> ---
> >>  ...p-fanotify09-test-2-for-older-kernel.patch |  0
> >>  ubuntu_ltp/ubuntu_ltp.py                      |  2 ++
> >>  ubuntu_ltp_syscalls/patches                   |  1 +
> >>  ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py    | 34 +++++++++++++++++++
> >>  4 files changed, 37 insertions(+)
> >>  rename {ubuntu_ltp_syscalls => ubuntu_ltp/patches}/0001-skip-fanotify09-test-2-for-older-kernel.patch (100%)
> >>  create mode 120000 ubuntu_ltp_syscalls/patches
> >>
> >> diff --git a/ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch b/ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
> >> similarity index 100%
> >> rename from ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch
> >> rename to ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
> >> diff --git a/ubuntu_ltp/ubuntu_ltp.py b/ubuntu_ltp/ubuntu_ltp.py
> >> index 3b89d21d2c92..9d0f96d4730c 100644
> >> --- a/ubuntu_ltp/ubuntu_ltp.py
> >> +++ b/ubuntu_ltp/ubuntu_ltp.py
> >> @@ -13,6 +13,8 @@ class ubuntu_ltp(test.test):
> >>      version = 1
> >>      patches = [
> >>          # Each element is also a list of patch title (user printable) and relative path to patch from bindir
> >> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
> >> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
> >>          ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
> >>           'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
> >>          ['include/tst_pid.h: fix language typo (subtraction)',
> >> diff --git a/ubuntu_ltp_syscalls/patches b/ubuntu_ltp_syscalls/patches
> >> new file mode 120000
> >> index 000000000000..bd31461cfab9
> >> --- /dev/null
> >> +++ b/ubuntu_ltp_syscalls/patches
> >> @@ -0,0 +1 @@
> >> +../ubuntu_ltp/patches
> >> \ No newline at end of file
> >> diff --git a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> >> index b6b09246393b..1f8bbfee46d0 100644
> >> --- a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> >> +++ b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> >> @@ -22,6 +22,35 @@ except Exception, e:
> >>
> >>  class ubuntu_ltp_syscalls(test.test):
> >>      version = 1
> >> +    patches = [
> >> +        # Each element is also a list of patch title (user printable) and relative path to patch from bindir
> >> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
> >> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
> >> +        ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
> >> +         'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
> >> +        ['include/tst_pid.h: fix language typo (subtraction)',
> >> +         'patches/0002-include-tst_pid.h-fix-language-typo-subtraction.patch'],
> >> +        ['syscalls/msgstress04: fix fork failure on small memory systems',
> >> +         'patches/0003-syscalls-msgstress04-fix-fork-failure-on-small-memor.patch'],
> >> +        ['syscalls/msgstress03: fix fork failure on small memory systems',
> >> +         'patches/0004-syscalls-msgstress03-fix-fork-failure-on-small-memor.patch'],
> >> +        ['syscalls/msgstress: tune limit of processes for small machines',
> >> +         'patches/0005-syscalls-msgstress-tune-limit-of-processes-for-small.patch'],
> >> +        ['patches/device-drivers/cpufreq_boost: skip test on virtual machines',
> >> +         'patches/0006-device-drivers-cpufreq_boost-skip-test-on-virtual-ma.patch'],
> >> +        ['lib: memutils: don\'t pollute entire system memory to avoid OoM',
> >> +         'patches/0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch'],
> >> +        ['controllers/memcg: accept range of max_usage_in_bytes/memcg: accept range of max_usage_in_bytes',
> >> +         'patches/0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch'],
> >> +        ['controllers/memcg: accept range of usage_in_bytes',
> >> +         'patches/0009-controllers-memcg-accept-range-of-usage_in_bytes.patch'],
> >> +        ['controllers/memcg: accept non-zero max_usage_in_bytes after reset',
> >> +          'patches/0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch'],
> >> +        ['controllers/memcg: increase memory limit in subgroup charge',
> >> +         'patches/0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch'],
> >> +        ['tpci: accept ENOMEM resource failure with virtio-pci',
> >> +         'patches/0012-tpci-accept-ENOMEM-resource-failure-with-virtio-pci.patch'],
> >> +    ]
> >>
> >>      def install_required_pkgs(self):
> >>          arch = platform.processor()
> >> @@ -42,6 +71,7 @@ class ubuntu_ltp_syscalls(test.test):
> >>              'libselinux1-dev',
> >>              'libssl-dev',
> >>              'libtirpc-dev',
> >> +            'patchutils',
> >>              'pkg-config',
> >>              'quota',
> >>              'virt-what',
> >> @@ -97,6 +127,10 @@ class ubuntu_ltp_syscalls(test.test):
> >>          print("Patching fanotify09 for older kernels...")
> >>          utils.system('patch -N -p1 < %s/0001-skip-fanotify09-test-2-for-older-kernel.patch' % self.bindir)
> >>
> > Hi Krzysztof,
> >
> > code below will conflict with the existing patch command above.
>
> I thought I removed it... my bad.
>
> >
> > Also, there is another tricky part is that we kinda "freeze" the LTP
> > repo for ESM releases like trusty (b938c86be UBUNTU: SAUCE:
> > ubuntu_ltp_syscalls: use a fixed SHA1 for ESM releases) since they're
> > not going to receive any other non-CVE related patches. By doing so
> > it can help us to narrow down failing cases that we need to fix on
> > these ESM releases, otherwise we can alway expect to see newer test
> > cases failing on them.
> > (And we might need to do this for Xenial as well.)
>
> How about then mirroring the LTP repo and having dedicated (obvious)
> branches for xenial and current testing? Rebasing patches would be also
> much easier. Usually rebase and cherry-pick can work around significant
> hunk differences. Manual patching - cannot.

Hi Krzysztof,
after discussing this with Francis, we decided to:
  1. Host a mirror LTP repo from upstream
  2. Apply our SAUCE patch on top of it
  3. Use a script to do automatic pull and rebase periodically
  4. Change the SHA1 printing code in ubuntu_ltp* to print the first
SHA1 that is not a SAUCE patch
  5. We will keep an extra branch for ESM series, to help us filter
out know (and won't fix) issues.

Thoughts?

We will update the repo location in ubuntu_ltp* once it's ready.
Thanks
Sam


>
> > Some of your patches cannot be applied on top of LTP de9dd02b:
> > * 0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch
> > * 0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch
> > * 0009-controllers-memcg-accept-range-of-usage_in_bytes.patch
> > * 0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch
> > * 0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch
> >
> > We can fix this by tailoring which patch should be applied, or fast
> > forward the tip we use on ESM series, but these changes here are
> > mostly for other tests (not for syscalls), not sure if it worth it
> > to spend more time on this?
>
> I think the easiest would be to have the same code for all of them -
> ubuntu_ltp, ltp_syscalls and ltp_stable. Managing two or three separate
> patchsets is additional effort.
>
>
> Best regards,
> Krzysztof
Krzysztof Kozlowski July 7, 2021, 7:15 a.m. UTC | #4
On 07/07/2021 08:08, Po-Hsu Lin wrote:
> On Wed, Jun 30, 2021 at 7:38 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.com> wrote:
>>
>> On 30/06/2021 13:27, Po-Hsu Lin wrote:
>>>
>>> On Mon, Jun 28, 2021 at 3:52 PM Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> wrote:
>>>>
>>>> Few patches to upstream LTP project are pending for longer time (2-3
>>>> weeks).  Either the discussion is on-going (and not necessarily going
>>>> anywhere like in case of controllers/memcg patches) or they are ignored.
>>>>
>>>> These patches fix real test issues, so apply them here.  The patchset
>>>> contains fixes for ubuntu_ltp and ubuntu_ltp_syscalls, because it is
>>>> easier to keep one set.
>>>>
>>>> Move the existing syscalls "UBUNTU: SAUCE: skip fanotify09 test #2 for
>>>> older kernels" to same folder and share it with ubuntu_ltp to keep
>>>> out-of-tree patches consistent.
>>>>
>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>>>> ---
>>>>  ...p-fanotify09-test-2-for-older-kernel.patch |  0
>>>>  ubuntu_ltp/ubuntu_ltp.py                      |  2 ++
>>>>  ubuntu_ltp_syscalls/patches                   |  1 +
>>>>  ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py    | 34 +++++++++++++++++++
>>>>  4 files changed, 37 insertions(+)
>>>>  rename {ubuntu_ltp_syscalls => ubuntu_ltp/patches}/0001-skip-fanotify09-test-2-for-older-kernel.patch (100%)
>>>>  create mode 120000 ubuntu_ltp_syscalls/patches
>>>>
>>>> diff --git a/ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch b/ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
>>>> similarity index 100%
>>>> rename from ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch
>>>> rename to ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
>>>> diff --git a/ubuntu_ltp/ubuntu_ltp.py b/ubuntu_ltp/ubuntu_ltp.py
>>>> index 3b89d21d2c92..9d0f96d4730c 100644
>>>> --- a/ubuntu_ltp/ubuntu_ltp.py
>>>> +++ b/ubuntu_ltp/ubuntu_ltp.py
>>>> @@ -13,6 +13,8 @@ class ubuntu_ltp(test.test):
>>>>      version = 1
>>>>      patches = [
>>>>          # Each element is also a list of patch title (user printable) and relative path to patch from bindir
>>>> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
>>>> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
>>>>          ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
>>>>           'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
>>>>          ['include/tst_pid.h: fix language typo (subtraction)',
>>>> diff --git a/ubuntu_ltp_syscalls/patches b/ubuntu_ltp_syscalls/patches
>>>> new file mode 120000
>>>> index 000000000000..bd31461cfab9
>>>> --- /dev/null
>>>> +++ b/ubuntu_ltp_syscalls/patches
>>>> @@ -0,0 +1 @@
>>>> +../ubuntu_ltp/patches
>>>> \ No newline at end of file
>>>> diff --git a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>>>> index b6b09246393b..1f8bbfee46d0 100644
>>>> --- a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>>>> +++ b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>>>> @@ -22,6 +22,35 @@ except Exception, e:
>>>>
>>>>  class ubuntu_ltp_syscalls(test.test):
>>>>      version = 1
>>>> +    patches = [
>>>> +        # Each element is also a list of patch title (user printable) and relative path to patch from bindir
>>>> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
>>>> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
>>>> +        ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
>>>> +         'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
>>>> +        ['include/tst_pid.h: fix language typo (subtraction)',
>>>> +         'patches/0002-include-tst_pid.h-fix-language-typo-subtraction.patch'],
>>>> +        ['syscalls/msgstress04: fix fork failure on small memory systems',
>>>> +         'patches/0003-syscalls-msgstress04-fix-fork-failure-on-small-memor.patch'],
>>>> +        ['syscalls/msgstress03: fix fork failure on small memory systems',
>>>> +         'patches/0004-syscalls-msgstress03-fix-fork-failure-on-small-memor.patch'],
>>>> +        ['syscalls/msgstress: tune limit of processes for small machines',
>>>> +         'patches/0005-syscalls-msgstress-tune-limit-of-processes-for-small.patch'],
>>>> +        ['patches/device-drivers/cpufreq_boost: skip test on virtual machines',
>>>> +         'patches/0006-device-drivers-cpufreq_boost-skip-test-on-virtual-ma.patch'],
>>>> +        ['lib: memutils: don\'t pollute entire system memory to avoid OoM',
>>>> +         'patches/0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch'],
>>>> +        ['controllers/memcg: accept range of max_usage_in_bytes/memcg: accept range of max_usage_in_bytes',
>>>> +         'patches/0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch'],
>>>> +        ['controllers/memcg: accept range of usage_in_bytes',
>>>> +         'patches/0009-controllers-memcg-accept-range-of-usage_in_bytes.patch'],
>>>> +        ['controllers/memcg: accept non-zero max_usage_in_bytes after reset',
>>>> +          'patches/0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch'],
>>>> +        ['controllers/memcg: increase memory limit in subgroup charge',
>>>> +         'patches/0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch'],
>>>> +        ['tpci: accept ENOMEM resource failure with virtio-pci',
>>>> +         'patches/0012-tpci-accept-ENOMEM-resource-failure-with-virtio-pci.patch'],
>>>> +    ]
>>>>
>>>>      def install_required_pkgs(self):
>>>>          arch = platform.processor()
>>>> @@ -42,6 +71,7 @@ class ubuntu_ltp_syscalls(test.test):
>>>>              'libselinux1-dev',
>>>>              'libssl-dev',
>>>>              'libtirpc-dev',
>>>> +            'patchutils',
>>>>              'pkg-config',
>>>>              'quota',
>>>>              'virt-what',
>>>> @@ -97,6 +127,10 @@ class ubuntu_ltp_syscalls(test.test):
>>>>          print("Patching fanotify09 for older kernels...")
>>>>          utils.system('patch -N -p1 < %s/0001-skip-fanotify09-test-2-for-older-kernel.patch' % self.bindir)
>>>>
>>> Hi Krzysztof,
>>>
>>> code below will conflict with the existing patch command above.
>>
>> I thought I removed it... my bad.
>>
>>>
>>> Also, there is another tricky part is that we kinda "freeze" the LTP
>>> repo for ESM releases like trusty (b938c86be UBUNTU: SAUCE:
>>> ubuntu_ltp_syscalls: use a fixed SHA1 for ESM releases) since they're
>>> not going to receive any other non-CVE related patches. By doing so
>>> it can help us to narrow down failing cases that we need to fix on
>>> these ESM releases, otherwise we can alway expect to see newer test
>>> cases failing on them.
>>> (And we might need to do this for Xenial as well.)
>>
>> How about then mirroring the LTP repo and having dedicated (obvious)
>> branches for xenial and current testing? Rebasing patches would be also
>> much easier. Usually rebase and cherry-pick can work around significant
>> hunk differences. Manual patching - cannot.
> 
> Hi Krzysztof,
> after discussing this with Francis, we decided to:
>   1. Host a mirror LTP repo from upstream
>   2. Apply our SAUCE patch on top of it
>   3. Use a script to do automatic pull and rebase periodically
>   4. Change the SHA1 printing code in ubuntu_ltp* to print the first
> SHA1 that is not a SAUCE patch
>   5. We will keep an extra branch for ESM series, to help us filter
> out know (and won't fix) issues.
> 
> Thoughts?
> 
> We will update the repo location in ubuntu_ltp* once it's ready.
> Thanks

Great! Let me know when I can refresh the patches (I have updates for
the memcg limits) or optionally you can take them directly from:
https://github.com/krzk/ltp
branch: canonical-set


Best regards,
Krzysztof
Po-Hsu Lin July 8, 2021, 11:14 a.m. UTC | #5
On Wed, Jul 7, 2021 at 3:15 PM Krzysztof Kozlowski
<krzysztof.kozlowski@canonical.com> wrote:
>
> On 07/07/2021 08:08, Po-Hsu Lin wrote:
> > On Wed, Jun 30, 2021 at 7:38 PM Krzysztof Kozlowski
> > <krzysztof.kozlowski@canonical.com> wrote:
> >>
> >> On 30/06/2021 13:27, Po-Hsu Lin wrote:
> >>>
> >>> On Mon, Jun 28, 2021 at 3:52 PM Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> wrote:
> >>>>
> >>>> Few patches to upstream LTP project are pending for longer time (2-3
> >>>> weeks).  Either the discussion is on-going (and not necessarily going
> >>>> anywhere like in case of controllers/memcg patches) or they are ignored.
> >>>>
> >>>> These patches fix real test issues, so apply them here.  The patchset
> >>>> contains fixes for ubuntu_ltp and ubuntu_ltp_syscalls, because it is
> >>>> easier to keep one set.
> >>>>
> >>>> Move the existing syscalls "UBUNTU: SAUCE: skip fanotify09 test #2 for
> >>>> older kernels" to same folder and share it with ubuntu_ltp to keep
> >>>> out-of-tree patches consistent.
> >>>>
> >>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> >>>> ---
> >>>>  ...p-fanotify09-test-2-for-older-kernel.patch |  0
> >>>>  ubuntu_ltp/ubuntu_ltp.py                      |  2 ++
> >>>>  ubuntu_ltp_syscalls/patches                   |  1 +
> >>>>  ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py    | 34 +++++++++++++++++++
> >>>>  4 files changed, 37 insertions(+)
> >>>>  rename {ubuntu_ltp_syscalls => ubuntu_ltp/patches}/0001-skip-fanotify09-test-2-for-older-kernel.patch (100%)
> >>>>  create mode 120000 ubuntu_ltp_syscalls/patches
> >>>>
> >>>> diff --git a/ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch b/ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
> >>>> similarity index 100%
> >>>> rename from ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch
> >>>> rename to ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
> >>>> diff --git a/ubuntu_ltp/ubuntu_ltp.py b/ubuntu_ltp/ubuntu_ltp.py
> >>>> index 3b89d21d2c92..9d0f96d4730c 100644
> >>>> --- a/ubuntu_ltp/ubuntu_ltp.py
> >>>> +++ b/ubuntu_ltp/ubuntu_ltp.py
> >>>> @@ -13,6 +13,8 @@ class ubuntu_ltp(test.test):
> >>>>      version = 1
> >>>>      patches = [
> >>>>          # Each element is also a list of patch title (user printable) and relative path to patch from bindir
> >>>> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
> >>>> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
> >>>>          ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
> >>>>           'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
> >>>>          ['include/tst_pid.h: fix language typo (subtraction)',
> >>>> diff --git a/ubuntu_ltp_syscalls/patches b/ubuntu_ltp_syscalls/patches
> >>>> new file mode 120000
> >>>> index 000000000000..bd31461cfab9
> >>>> --- /dev/null
> >>>> +++ b/ubuntu_ltp_syscalls/patches
> >>>> @@ -0,0 +1 @@
> >>>> +../ubuntu_ltp/patches
> >>>> \ No newline at end of file
> >>>> diff --git a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> >>>> index b6b09246393b..1f8bbfee46d0 100644
> >>>> --- a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> >>>> +++ b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
> >>>> @@ -22,6 +22,35 @@ except Exception, e:
> >>>>
> >>>>  class ubuntu_ltp_syscalls(test.test):
> >>>>      version = 1
> >>>> +    patches = [
> >>>> +        # Each element is also a list of patch title (user printable) and relative path to patch from bindir
> >>>> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
> >>>> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
> >>>> +        ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
> >>>> +         'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
> >>>> +        ['include/tst_pid.h: fix language typo (subtraction)',
> >>>> +         'patches/0002-include-tst_pid.h-fix-language-typo-subtraction.patch'],
> >>>> +        ['syscalls/msgstress04: fix fork failure on small memory systems',
> >>>> +         'patches/0003-syscalls-msgstress04-fix-fork-failure-on-small-memor.patch'],
> >>>> +        ['syscalls/msgstress03: fix fork failure on small memory systems',
> >>>> +         'patches/0004-syscalls-msgstress03-fix-fork-failure-on-small-memor.patch'],
> >>>> +        ['syscalls/msgstress: tune limit of processes for small machines',
> >>>> +         'patches/0005-syscalls-msgstress-tune-limit-of-processes-for-small.patch'],
> >>>> +        ['patches/device-drivers/cpufreq_boost: skip test on virtual machines',
> >>>> +         'patches/0006-device-drivers-cpufreq_boost-skip-test-on-virtual-ma.patch'],
> >>>> +        ['lib: memutils: don\'t pollute entire system memory to avoid OoM',
> >>>> +         'patches/0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch'],
> >>>> +        ['controllers/memcg: accept range of max_usage_in_bytes/memcg: accept range of max_usage_in_bytes',
> >>>> +         'patches/0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch'],
> >>>> +        ['controllers/memcg: accept range of usage_in_bytes',
> >>>> +         'patches/0009-controllers-memcg-accept-range-of-usage_in_bytes.patch'],
> >>>> +        ['controllers/memcg: accept non-zero max_usage_in_bytes after reset',
> >>>> +          'patches/0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch'],
> >>>> +        ['controllers/memcg: increase memory limit in subgroup charge',
> >>>> +         'patches/0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch'],
> >>>> +        ['tpci: accept ENOMEM resource failure with virtio-pci',
> >>>> +         'patches/0012-tpci-accept-ENOMEM-resource-failure-with-virtio-pci.patch'],
> >>>> +    ]
> >>>>
> >>>>      def install_required_pkgs(self):
> >>>>          arch = platform.processor()
> >>>> @@ -42,6 +71,7 @@ class ubuntu_ltp_syscalls(test.test):
> >>>>              'libselinux1-dev',
> >>>>              'libssl-dev',
> >>>>              'libtirpc-dev',
> >>>> +            'patchutils',
> >>>>              'pkg-config',
> >>>>              'quota',
> >>>>              'virt-what',
> >>>> @@ -97,6 +127,10 @@ class ubuntu_ltp_syscalls(test.test):
> >>>>          print("Patching fanotify09 for older kernels...")
> >>>>          utils.system('patch -N -p1 < %s/0001-skip-fanotify09-test-2-for-older-kernel.patch' % self.bindir)
> >>>>
> >>> Hi Krzysztof,
> >>>
> >>> code below will conflict with the existing patch command above.
> >>
> >> I thought I removed it... my bad.
> >>
> >>>
> >>> Also, there is another tricky part is that we kinda "freeze" the LTP
> >>> repo for ESM releases like trusty (b938c86be UBUNTU: SAUCE:
> >>> ubuntu_ltp_syscalls: use a fixed SHA1 for ESM releases) since they're
> >>> not going to receive any other non-CVE related patches. By doing so
> >>> it can help us to narrow down failing cases that we need to fix on
> >>> these ESM releases, otherwise we can alway expect to see newer test
> >>> cases failing on them.
> >>> (And we might need to do this for Xenial as well.)
> >>
> >> How about then mirroring the LTP repo and having dedicated (obvious)
> >> branches for xenial and current testing? Rebasing patches would be also
> >> much easier. Usually rebase and cherry-pick can work around significant
> >> hunk differences. Manual patching - cannot.
> >
> > Hi Krzysztof,
> > after discussing this with Francis, we decided to:
> >   1. Host a mirror LTP repo from upstream
> >   2. Apply our SAUCE patch on top of it
> >   3. Use a script to do automatic pull and rebase periodically
> >   4. Change the SHA1 printing code in ubuntu_ltp* to print the first
> > SHA1 that is not a SAUCE patch
> >   5. We will keep an extra branch for ESM series, to help us filter
> > out know (and won't fix) issues.
> >
> > Thoughts?
> >
> > We will update the repo location in ubuntu_ltp* once it's ready.
> > Thanks
>
> Great! Let me know when I can refresh the patches (I have updates for
> the memcg limits) or optionally you can take them directly from:
> https://github.com/krzk/ltp
> branch: canonical-set
>
I have the LTP suite hosted on:
https://kernel.ubuntu.com/git/ubuntu/ltp.git/

And with all your changes in canonical-set branch on your github repo
applied, with a new branch called "sru" (With patch titles renamed, I
added "UBUNTU: SAUCE:" there)
I will work on the bits in autotest-client-tests.

Thanks
Sam

>
> Best regards,
> Krzysztof
Krzysztof Kozlowski July 8, 2021, 11:34 a.m. UTC | #6
On 08/07/2021 13:14, Po-Hsu Lin wrote:
> On Wed, Jul 7, 2021 at 3:15 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.com> wrote:
>>
>> On 07/07/2021 08:08, Po-Hsu Lin wrote:
>>> On Wed, Jun 30, 2021 at 7:38 PM Krzysztof Kozlowski
>>> <krzysztof.kozlowski@canonical.com> wrote:
>>>>
>>>> On 30/06/2021 13:27, Po-Hsu Lin wrote:
>>>>>
>>>>> On Mon, Jun 28, 2021 at 3:52 PM Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> wrote:
>>>>>>
>>>>>> Few patches to upstream LTP project are pending for longer time (2-3
>>>>>> weeks).  Either the discussion is on-going (and not necessarily going
>>>>>> anywhere like in case of controllers/memcg patches) or they are ignored.
>>>>>>
>>>>>> These patches fix real test issues, so apply them here.  The patchset
>>>>>> contains fixes for ubuntu_ltp and ubuntu_ltp_syscalls, because it is
>>>>>> easier to keep one set.
>>>>>>
>>>>>> Move the existing syscalls "UBUNTU: SAUCE: skip fanotify09 test #2 for
>>>>>> older kernels" to same folder and share it with ubuntu_ltp to keep
>>>>>> out-of-tree patches consistent.
>>>>>>
>>>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>>>>>> ---
>>>>>>  ...p-fanotify09-test-2-for-older-kernel.patch |  0
>>>>>>  ubuntu_ltp/ubuntu_ltp.py                      |  2 ++
>>>>>>  ubuntu_ltp_syscalls/patches                   |  1 +
>>>>>>  ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py    | 34 +++++++++++++++++++
>>>>>>  4 files changed, 37 insertions(+)
>>>>>>  rename {ubuntu_ltp_syscalls => ubuntu_ltp/patches}/0001-skip-fanotify09-test-2-for-older-kernel.patch (100%)
>>>>>>  create mode 120000 ubuntu_ltp_syscalls/patches
>>>>>>
>>>>>> diff --git a/ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch b/ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
>>>>>> similarity index 100%
>>>>>> rename from ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch
>>>>>> rename to ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
>>>>>> diff --git a/ubuntu_ltp/ubuntu_ltp.py b/ubuntu_ltp/ubuntu_ltp.py
>>>>>> index 3b89d21d2c92..9d0f96d4730c 100644
>>>>>> --- a/ubuntu_ltp/ubuntu_ltp.py
>>>>>> +++ b/ubuntu_ltp/ubuntu_ltp.py
>>>>>> @@ -13,6 +13,8 @@ class ubuntu_ltp(test.test):
>>>>>>      version = 1
>>>>>>      patches = [
>>>>>>          # Each element is also a list of patch title (user printable) and relative path to patch from bindir
>>>>>> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
>>>>>> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
>>>>>>          ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
>>>>>>           'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
>>>>>>          ['include/tst_pid.h: fix language typo (subtraction)',
>>>>>> diff --git a/ubuntu_ltp_syscalls/patches b/ubuntu_ltp_syscalls/patches
>>>>>> new file mode 120000
>>>>>> index 000000000000..bd31461cfab9
>>>>>> --- /dev/null
>>>>>> +++ b/ubuntu_ltp_syscalls/patches
>>>>>> @@ -0,0 +1 @@
>>>>>> +../ubuntu_ltp/patches
>>>>>> \ No newline at end of file
>>>>>> diff --git a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>>>>>> index b6b09246393b..1f8bbfee46d0 100644
>>>>>> --- a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>>>>>> +++ b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
>>>>>> @@ -22,6 +22,35 @@ except Exception, e:
>>>>>>
>>>>>>  class ubuntu_ltp_syscalls(test.test):
>>>>>>      version = 1
>>>>>> +    patches = [
>>>>>> +        # Each element is also a list of patch title (user printable) and relative path to patch from bindir
>>>>>> +        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
>>>>>> +         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
>>>>>> +        ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
>>>>>> +         'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
>>>>>> +        ['include/tst_pid.h: fix language typo (subtraction)',
>>>>>> +         'patches/0002-include-tst_pid.h-fix-language-typo-subtraction.patch'],
>>>>>> +        ['syscalls/msgstress04: fix fork failure on small memory systems',
>>>>>> +         'patches/0003-syscalls-msgstress04-fix-fork-failure-on-small-memor.patch'],
>>>>>> +        ['syscalls/msgstress03: fix fork failure on small memory systems',
>>>>>> +         'patches/0004-syscalls-msgstress03-fix-fork-failure-on-small-memor.patch'],
>>>>>> +        ['syscalls/msgstress: tune limit of processes for small machines',
>>>>>> +         'patches/0005-syscalls-msgstress-tune-limit-of-processes-for-small.patch'],
>>>>>> +        ['patches/device-drivers/cpufreq_boost: skip test on virtual machines',
>>>>>> +         'patches/0006-device-drivers-cpufreq_boost-skip-test-on-virtual-ma.patch'],
>>>>>> +        ['lib: memutils: don\'t pollute entire system memory to avoid OoM',
>>>>>> +         'patches/0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch'],
>>>>>> +        ['controllers/memcg: accept range of max_usage_in_bytes/memcg: accept range of max_usage_in_bytes',
>>>>>> +         'patches/0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch'],
>>>>>> +        ['controllers/memcg: accept range of usage_in_bytes',
>>>>>> +         'patches/0009-controllers-memcg-accept-range-of-usage_in_bytes.patch'],
>>>>>> +        ['controllers/memcg: accept non-zero max_usage_in_bytes after reset',
>>>>>> +          'patches/0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch'],
>>>>>> +        ['controllers/memcg: increase memory limit in subgroup charge',
>>>>>> +         'patches/0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch'],
>>>>>> +        ['tpci: accept ENOMEM resource failure with virtio-pci',
>>>>>> +         'patches/0012-tpci-accept-ENOMEM-resource-failure-with-virtio-pci.patch'],
>>>>>> +    ]
>>>>>>
>>>>>>      def install_required_pkgs(self):
>>>>>>          arch = platform.processor()
>>>>>> @@ -42,6 +71,7 @@ class ubuntu_ltp_syscalls(test.test):
>>>>>>              'libselinux1-dev',
>>>>>>              'libssl-dev',
>>>>>>              'libtirpc-dev',
>>>>>> +            'patchutils',
>>>>>>              'pkg-config',
>>>>>>              'quota',
>>>>>>              'virt-what',
>>>>>> @@ -97,6 +127,10 @@ class ubuntu_ltp_syscalls(test.test):
>>>>>>          print("Patching fanotify09 for older kernels...")
>>>>>>          utils.system('patch -N -p1 < %s/0001-skip-fanotify09-test-2-for-older-kernel.patch' % self.bindir)
>>>>>>
>>>>> Hi Krzysztof,
>>>>>
>>>>> code below will conflict with the existing patch command above.
>>>>
>>>> I thought I removed it... my bad.
>>>>
>>>>>
>>>>> Also, there is another tricky part is that we kinda "freeze" the LTP
>>>>> repo for ESM releases like trusty (b938c86be UBUNTU: SAUCE:
>>>>> ubuntu_ltp_syscalls: use a fixed SHA1 for ESM releases) since they're
>>>>> not going to receive any other non-CVE related patches. By doing so
>>>>> it can help us to narrow down failing cases that we need to fix on
>>>>> these ESM releases, otherwise we can alway expect to see newer test
>>>>> cases failing on them.
>>>>> (And we might need to do this for Xenial as well.)
>>>>
>>>> How about then mirroring the LTP repo and having dedicated (obvious)
>>>> branches for xenial and current testing? Rebasing patches would be also
>>>> much easier. Usually rebase and cherry-pick can work around significant
>>>> hunk differences. Manual patching - cannot.
>>>
>>> Hi Krzysztof,
>>> after discussing this with Francis, we decided to:
>>>   1. Host a mirror LTP repo from upstream
>>>   2. Apply our SAUCE patch on top of it
>>>   3. Use a script to do automatic pull and rebase periodically
>>>   4. Change the SHA1 printing code in ubuntu_ltp* to print the first
>>> SHA1 that is not a SAUCE patch
>>>   5. We will keep an extra branch for ESM series, to help us filter
>>> out know (and won't fix) issues.
>>>
>>> Thoughts?
>>>
>>> We will update the repo location in ubuntu_ltp* once it's ready.
>>> Thanks
>>
>> Great! Let me know when I can refresh the patches (I have updates for
>> the memcg limits) or optionally you can take them directly from:
>> https://github.com/krzk/ltp
>> branch: canonical-set
>>
> I have the LTP suite hosted on:
> https://kernel.ubuntu.com/git/ubuntu/ltp.git/
> 
> And with all your changes in canonical-set branch on your github repo
> applied, with a new branch called "sru" (With patch titles renamed, I
> added "UBUNTU: SAUCE:" there)
> I will work on the bits in autotest-client-tests.

Awesome, thank you!


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch b/ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
similarity index 100%
rename from ubuntu_ltp_syscalls/0001-skip-fanotify09-test-2-for-older-kernel.patch
rename to ubuntu_ltp/patches/0001-skip-fanotify09-test-2-for-older-kernel.patch
diff --git a/ubuntu_ltp/ubuntu_ltp.py b/ubuntu_ltp/ubuntu_ltp.py
index 3b89d21d2c92..9d0f96d4730c 100644
--- a/ubuntu_ltp/ubuntu_ltp.py
+++ b/ubuntu_ltp/ubuntu_ltp.py
@@ -13,6 +13,8 @@  class ubuntu_ltp(test.test):
     version = 1
     patches = [
         # Each element is also a list of patch title (user printable) and relative path to patch from bindir
+        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
+         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
         ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
          'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
         ['include/tst_pid.h: fix language typo (subtraction)',
diff --git a/ubuntu_ltp_syscalls/patches b/ubuntu_ltp_syscalls/patches
new file mode 120000
index 000000000000..bd31461cfab9
--- /dev/null
+++ b/ubuntu_ltp_syscalls/patches
@@ -0,0 +1 @@ 
+../ubuntu_ltp/patches
\ No newline at end of file
diff --git a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
index b6b09246393b..1f8bbfee46d0 100644
--- a/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
+++ b/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py
@@ -22,6 +22,35 @@  except Exception, e:
 
 class ubuntu_ltp_syscalls(test.test):
     version = 1
+    patches = [
+        # Each element is also a list of patch title (user printable) and relative path to patch from bindir
+        ['UBUNTU: SAUCE: skip fanotify09 test #2 for older kernels',
+         'patches/0001-skip-fanotify09-test-2-for-older-kernel.patch'],
+        ['controllers/cpuacct: skip cpuacct_100_100 on small memory systems',
+         'patches/0001-controllers-cpuacct-skip-cpuacct_100_100-on-small-me.patch'],
+        ['include/tst_pid.h: fix language typo (subtraction)',
+         'patches/0002-include-tst_pid.h-fix-language-typo-subtraction.patch'],
+        ['syscalls/msgstress04: fix fork failure on small memory systems',
+         'patches/0003-syscalls-msgstress04-fix-fork-failure-on-small-memor.patch'],
+        ['syscalls/msgstress03: fix fork failure on small memory systems',
+         'patches/0004-syscalls-msgstress03-fix-fork-failure-on-small-memor.patch'],
+        ['syscalls/msgstress: tune limit of processes for small machines',
+         'patches/0005-syscalls-msgstress-tune-limit-of-processes-for-small.patch'],
+        ['patches/device-drivers/cpufreq_boost: skip test on virtual machines',
+         'patches/0006-device-drivers-cpufreq_boost-skip-test-on-virtual-ma.patch'],
+        ['lib: memutils: don\'t pollute entire system memory to avoid OoM',
+         'patches/0007-lib-memutils-don-t-pollute-entire-system-memory-to-a.patch'],
+        ['controllers/memcg: accept range of max_usage_in_bytes/memcg: accept range of max_usage_in_bytes',
+         'patches/0008-controllers-memcg-accept-range-of-max_usage_in_bytes.patch'],
+        ['controllers/memcg: accept range of usage_in_bytes',
+         'patches/0009-controllers-memcg-accept-range-of-usage_in_bytes.patch'],
+        ['controllers/memcg: accept non-zero max_usage_in_bytes after reset',
+          'patches/0010-controllers-memcg-accept-non-zero-max_usage_in_bytes.patch'],
+        ['controllers/memcg: increase memory limit in subgroup charge',
+         'patches/0011-controllers-memcg-increase-memory-limit-in-subgroup-.patch'],
+        ['tpci: accept ENOMEM resource failure with virtio-pci',
+         'patches/0012-tpci-accept-ENOMEM-resource-failure-with-virtio-pci.patch'],
+    ]
 
     def install_required_pkgs(self):
         arch = platform.processor()
@@ -42,6 +71,7 @@  class ubuntu_ltp_syscalls(test.test):
             'libselinux1-dev',
             'libssl-dev',
             'libtirpc-dev',
+            'patchutils',
             'pkg-config',
             'quota',
             'virt-what',
@@ -97,6 +127,10 @@  class ubuntu_ltp_syscalls(test.test):
         print("Patching fanotify09 for older kernels...")
         utils.system('patch -N -p1 < %s/0001-skip-fanotify09-test-2-for-older-kernel.patch' % self.bindir)
 
+        for patch in self.patches:
+            print("Patching with: %s" % patch[0])
+            utils.system('patch -p1 < %s/%s' % (self.bindir, patch[1]))
+
         # Disable NTFS as we disable RW support
         cmd = 'sed -i /ntfs/d lib/tst_supported_fs_types.c'
         utils.system_output(cmd)