bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kselftest OOT run_tests
@ 2020-05-25 13:55 Yauheni Kaliuta
  2020-05-26 17:13 ` shuah
  0 siblings, 1 reply; 8+ messages in thread
From: Yauheni Kaliuta @ 2020-05-25 13:55 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Shuah Khan, linux-kselftest, bpf

Hi!

I'm wondering how out of tree check is supposed to work for make
O=dir run_tests from selftests (or make -C ...) directory?

(both with 051f278e9d81 ("kbuild: replace KBUILD_SRCTREE with
boolean building_out_of_srctree") and without)

make M= ... does not work with run_tests.

-- 
WBR,
Yauheni Kaliuta


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kselftest OOT run_tests
  2020-05-25 13:55 kselftest OOT run_tests Yauheni Kaliuta
@ 2020-05-26 17:13 ` shuah
  2020-05-26 20:40   ` Joe Lawrence
  2020-05-27  7:30   ` Yauheni Kaliuta
  0 siblings, 2 replies; 8+ messages in thread
From: shuah @ 2020-05-26 17:13 UTC (permalink / raw)
  To: Yauheni Kaliuta, Masahiro Yamada; +Cc: linux-kselftest, bpf, shuah

On 5/25/20 7:55 AM, Yauheni Kaliuta wrote:
> Hi!
> 
> I'm wondering how out of tree check is supposed to work for make
> O=dir run_tests from selftests (or make -C ...) directory?
> 
> (both with 051f278e9d81 ("kbuild: replace KBUILD_SRCTREE with
> boolean building_out_of_srctree") and without)
> 
> make M= ... does not work with run_tests.
>

Kselftests run_tests target isn't intended for building and running
tests OOT. Also make M= doesn't make sense for them.

There is no support to build OOT at the moment. I would like to get
a better understanding of your use-case. Can you elaborate?

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kselftest OOT run_tests
  2020-05-26 17:13 ` shuah
@ 2020-05-26 20:40   ` Joe Lawrence
  2020-05-27  7:34     ` Yauheni Kaliuta
  2020-05-27  7:30   ` Yauheni Kaliuta
  1 sibling, 1 reply; 8+ messages in thread
From: Joe Lawrence @ 2020-05-26 20:40 UTC (permalink / raw)
  To: shuah, Yauheni Kaliuta, Masahiro Yamada; +Cc: linux-kselftest, bpf

On 5/26/20 1:13 PM, shuah wrote:
> On 5/25/20 7:55 AM, Yauheni Kaliuta wrote:
>> Hi!
>>
>> I'm wondering how out of tree check is supposed to work for make
>> O=dir run_tests from selftests (or make -C ...) directory?
>>
>> (both with 051f278e9d81 ("kbuild: replace KBUILD_SRCTREE with
>> boolean building_out_of_srctree") and without)
>>
>> make M= ... does not work with run_tests.
>>
> 
> Kselftests run_tests target isn't intended for building and running
> tests OOT. Also make M= doesn't make sense for them.
> 
> There is no support to build OOT at the moment. I would like to get
> a better understanding of your use-case. Can you elaborate?
> 

Hey Yauheni, can you CC me on the use-case explanation?

We currently do something really silly for the livepatch selftests on 
RHEL-7 for CKI that requires building them as pseudo OOT... in our case, 
we'd like to just be able to do something like make modules_prepare && 
make M= lib/livepatch, so perhaps a bit different... but I'd be curious 
for which problem you're currently trying to solve.

Regards,

-- Joe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kselftest OOT run_tests
  2020-05-26 17:13 ` shuah
  2020-05-26 20:40   ` Joe Lawrence
@ 2020-05-27  7:30   ` Yauheni Kaliuta
  2020-05-27 18:22     ` shuah
  1 sibling, 1 reply; 8+ messages in thread
From: Yauheni Kaliuta @ 2020-05-27  7:30 UTC (permalink / raw)
  To: shuah; +Cc: Masahiro Yamada, linux-kselftest, bpf

Hi, shuah!

>>>>> On Tue, 26 May 2020 11:13:29 -0600, shuah   wrote:

 > On 5/25/20 7:55 AM, Yauheni Kaliuta wrote:
 >> Hi!
 >> 
 >> I'm wondering how out of tree check is supposed to work for make
 >> O=dir run_tests from selftests (or make -C ...) directory?
 >> 
 >> (both with 051f278e9d81 ("kbuild: replace KBUILD_SRCTREE with
 >> boolean building_out_of_srctree") and without)
 >> 
 >> make M= ... does not work with run_tests.
 >> 

 > Kselftests run_tests target isn't intended for building and
 > running tests OOT.

But there is code there trying to handle it. All that OUTPUT
related things must be removed if it's broken, right? Can I post
a patch?

 > Also make M= doesn't make sense for them.

Well, M=... at least includes all the makefiles.

 > There is no support to build OOT at the moment. I would like
 > to get a better understanding of your use-case. Can you
 > elaborate?

I care about make install actually. But fixing it I had to deal
with OUTPUT. Looking a proper for that I found that it's a bit
broken.


-- 
WBR,
Yauheni Kaliuta


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kselftest OOT run_tests
  2020-05-26 20:40   ` Joe Lawrence
@ 2020-05-27  7:34     ` Yauheni Kaliuta
  0 siblings, 0 replies; 8+ messages in thread
From: Yauheni Kaliuta @ 2020-05-27  7:34 UTC (permalink / raw)
  To: Joe Lawrence; +Cc: shuah, Masahiro Yamada, linux-kselftest, bpf

Hi, Joe!

>>>>> On Tue, 26 May 2020 16:40:06 -0400, Joe Lawrence  wrote:

 > On 5/26/20 1:13 PM, shuah wrote:
 >> On 5/25/20 7:55 AM, Yauheni Kaliuta wrote:
 >>> Hi!
 >>> 
 >>> I'm wondering how out of tree check is supposed to work for make
 >>> O=dir run_tests from selftests (or make -C ...) directory?
 >>> 
 >>> (both with 051f278e9d81 ("kbuild: replace KBUILD_SRCTREE with
 >>> boolean building_out_of_srctree") and without)
 >>> 
 >>> make M= ... does not work with run_tests.
 >>> 
 >> 
 >> Kselftests run_tests target isn't intended for building and running
 >> tests OOT. Also make M= doesn't make sense for them.
 >> 
 >> There is no support to build OOT at the moment. I would like to get
 >> a better understanding of your use-case. Can you elaborate?
 >> 

 > Hey Yauheni, can you CC me on the use-case explanation?

 > We currently do something really silly for the livepatch
 > selftests on RHEL-7 for CKI that requires building them as
 > pseudo OOT... in our case, we'd like to just be able to do
 > something like make modules_prepare && make M= lib/livepatch,
 > so perhaps a bit different... but I'd be curious for which
 > problem you're currently trying to solve.

I care about `make install` for tests at the moment, for CI. For
CI you need to build kernel, install (and save/pack) the tests,
then boot the kernel and run the tests. It deals with OUTPUT, I
looked how to do it properly and found what I found.

My understanding, that it was supposed to work the way you
described. But looks like I'm wrong.


-- 
WBR,
Yauheni Kaliuta


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kselftest OOT run_tests
  2020-05-27  7:30   ` Yauheni Kaliuta
@ 2020-05-27 18:22     ` shuah
  2020-05-27 18:40       ` Yauheni Kaliuta
  0 siblings, 1 reply; 8+ messages in thread
From: shuah @ 2020-05-27 18:22 UTC (permalink / raw)
  To: Yauheni Kaliuta; +Cc: Masahiro Yamada, linux-kselftest, bpf, shuah

On 5/27/20 1:30 AM, Yauheni Kaliuta wrote:
> Hi, shuah!
> 
>>>>>> On Tue, 26 May 2020 11:13:29 -0600, shuah   wrote:
> 
>   > On 5/25/20 7:55 AM, Yauheni Kaliuta wrote:
>   >> Hi!
>   >>
>   >> I'm wondering how out of tree check is supposed to work for make
>   >> O=dir run_tests from selftests (or make -C ...) directory?
>   >>
>   >> (both with 051f278e9d81 ("kbuild: replace KBUILD_SRCTREE with
>   >> boolean building_out_of_srctree") and without)
>   >>
>   >> make M= ... does not work with run_tests.
>   >>
> 
>   > Kselftests run_tests target isn't intended for building and
>   > running tests OOT.
> 
> But there is code there trying to handle it. All that OUTPUT
> related things must be removed if it's broken, right? Can I post
> a patch?
> 
>   > Also make M= doesn't make sense for them.
> 
> Well, M=... at least includes all the makefiles.
> 
>   > There is no support to build OOT at the moment. I would like
>   > to get a better understanding of your use-case. Can you
>   > elaborate?
> 
> I care about make install actually. But fixing it I had to deal
> with OUTPUT. Looking a proper for that I found that it's a bit
> broken.
> 
> 

kselftest supports install of all all tests and a sub-set of tests
both native and cross-builds.

Simple case:
If you want to build all tests and install to $HOME/install/
This has a dependency on kernel being built in the source repo
you are running the following install command from:

In Kernel source root dir run:
make kselftest-install O=$HOME/install

You will find installed tests with run script to run them all
under $HOME/install/kselftest/kselftest_install/

If you run run_kselftest.sh under kselftest_install, it will run
all the tests.

You can use TARGETS var to build a sub-set of tests.

In Kernel source root dir run:
make kselftest-install TARGETS=bpf O=$HOME/install


Native or cross-build case when you are doing relocatable
builds.

arm64 cross-build:
# first do a relocatable kernel build in $HOME/arm64_build
make O=$HOME/arm64_build/ ARCH=arm64 HOSTCC=gcc \
             CROSS_COMPILE=aarch64-linux-gnu- defconfig

make O=$HOME/arm64_build/ ARCH=arm64 HOSTCC=gcc \
             CROSS_COMPILE=aarch64-linux-gnu- all

# install selftests (all)
make kselftest-install O=$HOME/arm64_build ARCH=arm64 \
             HOSTCC=gcc CROSS_COMPILE=aarch64-linux-gnu-

# install selftests (just bpf)
make kselftest-install TARGETS=bpf O=$HOME/arm64_build ARCH=arm64 \
             HOSTCC=gcc CROSS_COMPILE=aarch64-linux-gnu-


You will find kselftest installed under

$HOME/arm64_build/kselftest/kselftest_install

You can use the same procedure for native builds as well
assuming your native env. is x86_64

# first do a relocatable kernel build in $HOME/x86_64_build

make kselftest-install TARGETS=bpf O=$HOME/x86_64_build

You will find kselftest installed under

$HOME/x86_64_build/kselftest/kselftest_install

It is on todo to update the documentation. :(

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kselftest OOT run_tests
  2020-05-27 18:22     ` shuah
@ 2020-05-27 18:40       ` Yauheni Kaliuta
  2020-05-27 21:46         ` shuah
  0 siblings, 1 reply; 8+ messages in thread
From: Yauheni Kaliuta @ 2020-05-27 18:40 UTC (permalink / raw)
  To: shuah; +Cc: Masahiro Yamada, open list:KERNEL SELFTEST FRAMEWORK, bpf

On Wed, May 27, 2020 at 9:22 PM shuah <shuah@kernel.org> wrote:
>
> On 5/27/20 1:30 AM, Yauheni Kaliuta wrote:
> > Hi, shuah!
> >
> >>>>>> On Tue, 26 May 2020 11:13:29 -0600, shuah   wrote:
> >
> >   > On 5/25/20 7:55 AM, Yauheni Kaliuta wrote:
> >   >> Hi!
> >   >>
> >   >> I'm wondering how out of tree check is supposed to work for make
> >   >> O=dir run_tests from selftests (or make -C ...) directory?
> >   >>
> >   >> (both with 051f278e9d81 ("kbuild: replace KBUILD_SRCTREE with
> >   >> boolean building_out_of_srctree") and without)
> >   >>
> >   >> make M= ... does not work with run_tests.
> >   >>
> >
> >   > Kselftests run_tests target isn't intended for building and
> >   > running tests OOT.
> >
> > But there is code there trying to handle it. All that OUTPUT
> > related things must be removed if it's broken, right? Can I post
> > a patch?
> >
> >   > Also make M= doesn't make sense for them.
> >
> > Well, M=... at least includes all the makefiles.
> >
> >   > There is no support to build OOT at the moment. I would like
> >   > to get a better understanding of your use-case. Can you
> >   > elaborate?
> >
> > I care about make install actually. But fixing it I had to deal
> > with OUTPUT. Looking a proper for that I found that it's a bit
> > broken.
> >
> >
>
> kselftest supports install of all all tests and a sub-set of tests
> both native and cross-builds.
>
> Simple case:
> If you want to build all tests and install to $HOME/install/
> This has a dependency on kernel being built in the source repo
> you are running the following install command from:
>
> In Kernel source root dir run:
> make kselftest-install O=$HOME/install
>
> You will find installed tests with run script to run them all
> under $HOME/install/kselftest/kselftest_install/
>
> If you run run_kselftest.sh under kselftest_install, it will run
> all the tests.
>
> You can use TARGETS var to build a sub-set of tests.
>
> In Kernel source root dir run:
> make kselftest-install TARGETS=bpf O=$HOME/install
>

Have you tried it with the recent bpf tree? ;)

(BTW, it is a bit misleading, it's building there, not installing).

>
> Native or cross-build case when you are doing relocatable
> builds.
>
> arm64 cross-build:
> # first do a relocatable kernel build in $HOME/arm64_build
> make O=$HOME/arm64_build/ ARCH=arm64 HOSTCC=gcc \
>              CROSS_COMPILE=aarch64-linux-gnu- defconfig
>
> make O=$HOME/arm64_build/ ARCH=arm64 HOSTCC=gcc \
>              CROSS_COMPILE=aarch64-linux-gnu- all
>
> # install selftests (all)
> make kselftest-install O=$HOME/arm64_build ARCH=arm64 \
>              HOSTCC=gcc CROSS_COMPILE=aarch64-linux-gnu-
>
> # install selftests (just bpf)
> make kselftest-install TARGETS=bpf O=$HOME/arm64_build ARCH=arm64 \
>              HOSTCC=gcc CROSS_COMPILE=aarch64-linux-gnu-
>
>
> You will find kselftest installed under
>
> $HOME/arm64_build/kselftest/kselftest_install
>
> You can use the same procedure for native builds as well
> assuming your native env. is x86_64
>
> # first do a relocatable kernel build in $HOME/x86_64_build
>
> make kselftest-install TARGETS=bpf O=$HOME/x86_64_build
>
> You will find kselftest installed under
>
> $HOME/x86_64_build/kselftest/kselftest_install
>
> It is on todo to update the documentation. :(
>
> thanks,
> -- Shuah
>


-- 
WBR, Yauheni


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: kselftest OOT run_tests
  2020-05-27 18:40       ` Yauheni Kaliuta
@ 2020-05-27 21:46         ` shuah
  0 siblings, 0 replies; 8+ messages in thread
From: shuah @ 2020-05-27 21:46 UTC (permalink / raw)
  To: Yauheni Kaliuta
  Cc: Masahiro Yamada, open list:KERNEL SELFTEST FRAMEWORK, bpf, shuah

On 5/27/20 12:40 PM, Yauheni Kaliuta wrote:
> On Wed, May 27, 2020 at 9:22 PM shuah <shuah@kernel.org> wrote:
>>
>> On 5/27/20 1:30 AM, Yauheni Kaliuta wrote:
>>> Hi, shuah!
>>>
>>>>>>>> On Tue, 26 May 2020 11:13:29 -0600, shuah   wrote:
>>>
>>>    > On 5/25/20 7:55 AM, Yauheni Kaliuta wrote:
>>>    >> Hi!
>>>    >>
>>>    >> I'm wondering how out of tree check is supposed to work for make
>>>    >> O=dir run_tests from selftests (or make -C ...) directory?
>>>    >>
>>>    >> (both with 051f278e9d81 ("kbuild: replace KBUILD_SRCTREE with
>>>    >> boolean building_out_of_srctree") and without)
>>>    >>
>>>    >> make M= ... does not work with run_tests.
>>>    >>
>>>
>>>    > Kselftests run_tests target isn't intended for building and
>>>    > running tests OOT.
>>>
>>> But there is code there trying to handle it. All that OUTPUT
>>> related things must be removed if it's broken, right? Can I post
>>> a patch?
>>>
>>>    > Also make M= doesn't make sense for them.
>>>
>>> Well, M=... at least includes all the makefiles.
>>>
>>>    > There is no support to build OOT at the moment. I would like
>>>    > to get a better understanding of your use-case. Can you
>>>    > elaborate?
>>>
>>> I care about make install actually. But fixing it I had to deal
>>> with OUTPUT. Looking a proper for that I found that it's a bit
>>> broken.
>>>
>>>
>>
>> kselftest supports install of all all tests and a sub-set of tests
>> both native and cross-builds.
>>
>> Simple case:
>> If you want to build all tests and install to $HOME/install/
>> This has a dependency on kernel being built in the source repo
>> you are running the following install command from:
>>
>> In Kernel source root dir run:
>> make kselftest-install O=$HOME/install
>>
>> You will find installed tests with run script to run them all
>> under $HOME/install/kselftest/kselftest_install/
>>
>> If you run run_kselftest.sh under kselftest_install, it will run
>> all the tests.
>>
>> You can use TARGETS var to build a sub-set of tests.
>>
>> In Kernel source root dir run:
>> make kselftest-install TARGETS=bpf O=$HOME/install
>>
> 
> Have you tried it with the recent bpf tree? ;)
>  > (BTW, it is a bit misleading, it's building there, not installing).
> 

It doesn't build for me on Linux 5.7-rc7 - install is another story

bpf install through kselftest-install hasn't been working for a
while.

bpf test has dependency bpftool and its Makefile is more complex
as a result.


thanks,
-- Shuah







^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-27 21:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 13:55 kselftest OOT run_tests Yauheni Kaliuta
2020-05-26 17:13 ` shuah
2020-05-26 20:40   ` Joe Lawrence
2020-05-27  7:34     ` Yauheni Kaliuta
2020-05-27  7:30   ` Yauheni Kaliuta
2020-05-27 18:22     ` shuah
2020-05-27 18:40       ` Yauheni Kaliuta
2020-05-27 21:46         ` shuah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).