Re: [PATCH 2/9] selftests: Add install target

2015-03-11 Thread Shuah Khan
On 03/10/2015 09:20 PM, Michael Ellerman wrote:
> On Tue, 2015-03-10 at 09:11 -0600, Shuah Khan wrote:
>> On 03/09/2015 04:29 PM, Shuah Khan wrote:
>>> On 03/09/2015 08:20 AM, Shuah Khan wrote:
 On 03/05/2015 11:53 AM, Dave Jones wrote:
> On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
>  > This adds make install support to selftests. The basic usage is:
>  > 
>  > $ cd tools/testing/selftests
>  > $ make install
>  > 
>  > That installs into tools/testing/selftests/install, which can then be
>  > copied where ever necessary.
>  > 
>  > The install destination is also configurable using eg:
>  > 
>  > $ INSTALL_PATH=/mnt/selftests make install
>
>  ...
>
>  > +  @# Ask all targets to emit their test scripts
>  > +  echo "#!/bin/bash\n\n" > $(ALL_SCRIPT)
>
> $ ./all.sh 
> -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
>
> Removing the \n\n fixes it.
>
>  > +  echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \
>
> ditto
>
>   Dave

 Michael,

 Could you please fix these problems and send the patch.

>>>
>>> Michael,
>>>
>>> Did you happen to run run_kselftest.sh from the install
>>> directory to make sure all the dependent executables
>>> are installed? You are missing a few required dependencies.
>>> efivars test for example.
>>>
>>> Please run kselftest_install.sh I sent out for review and
>>> compare the following:
>>>
>>> - contents of install directory created with your patch vs.
>>>   my kselftest_install.sh tool
>>> - Compare your run_kselftest.sh run with the one that gets
>>>   generated with my kselftest_install.sh tool
>>>
>>> General rule is all tests that get run when run_tests target
>>> is run should run from the install directory using the
>>> run_kselftest.sh generated during install.
>>>
>>
>> Couple more things. Please change the install directory name
>> to kselftest
>>
>> tools/testing/selftests/kselftest
>> instead of
>> tools/testing/selftests/install
> 
> I prefer install, that's what it is after all. I don't know why you're so
> obsessed with the "kselftest" name.

It is the overall user-interface. I want to be able to call
install wrapper script and have the right directory generated.
If user passes in /tmp for example as a main directory, install
is so generic and doesn't make sense. I see that you sent the
patch v4 still with install and please change it to kselftest
> 
>> Also please flatten the directory structure under the install
>> directory. I don't see any value in creating directory for each
>> test for install. Also it is makes it cumbersome for users
>> to navigate and work with after the install. This would mean cpu
>> and memory hot-plug scripts need unique names.
> 
> That's not a good idea. To start with different tests might the same name, as
> already happens with the memory & cpu hot-plug tests. They may also have data
> files that would clobber each other. We'd need to make sure all files used in
> all tests have different names, that would be a total mess.

No I want the just one container directory for the tests. Again I am
looking at the bigger picture user-interface angle. Please flatten it,
and resend it.

I responded to your patch v4. Please re-do the patch to address my
comments if you want your patch to be included.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-11 Thread Shuah Khan
On 03/10/2015 09:20 PM, Michael Ellerman wrote:
 On Tue, 2015-03-10 at 09:11 -0600, Shuah Khan wrote:
 On 03/09/2015 04:29 PM, Shuah Khan wrote:
 On 03/09/2015 08:20 AM, Shuah Khan wrote:
 On 03/05/2015 11:53 AM, Dave Jones wrote:
 On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
   This adds make install support to selftests. The basic usage is:
   
   $ cd tools/testing/selftests
   $ make install
   
   That installs into tools/testing/selftests/install, which can then be
   copied where ever necessary.
   
   The install destination is also configurable using eg:
   
   $ INSTALL_PATH=/mnt/selftests make install

  ...

   +  @# Ask all targets to emit their test scripts
   +  echo #!/bin/bash\n\n  $(ALL_SCRIPT)

 $ ./all.sh 
 -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory

 Removing the \n\n fixes it.

   +  echo cd \$$ROOT\n  $(ALL_SCRIPT); \

 ditto

   Dave

 Michael,

 Could you please fix these problems and send the patch.


 Michael,

 Did you happen to run run_kselftest.sh from the install
 directory to make sure all the dependent executables
 are installed? You are missing a few required dependencies.
 efivars test for example.

 Please run kselftest_install.sh I sent out for review and
 compare the following:

 - contents of install directory created with your patch vs.
   my kselftest_install.sh tool
 - Compare your run_kselftest.sh run with the one that gets
   generated with my kselftest_install.sh tool

 General rule is all tests that get run when run_tests target
 is run should run from the install directory using the
 run_kselftest.sh generated during install.


 Couple more things. Please change the install directory name
 to kselftest

 tools/testing/selftests/kselftest
 instead of
 tools/testing/selftests/install
 
 I prefer install, that's what it is after all. I don't know why you're so
 obsessed with the kselftest name.

It is the overall user-interface. I want to be able to call
install wrapper script and have the right directory generated.
If user passes in /tmp for example as a main directory, install
is so generic and doesn't make sense. I see that you sent the
patch v4 still with install and please change it to kselftest
 
 Also please flatten the directory structure under the install
 directory. I don't see any value in creating directory for each
 test for install. Also it is makes it cumbersome for users
 to navigate and work with after the install. This would mean cpu
 and memory hot-plug scripts need unique names.
 
 That's not a good idea. To start with different tests might the same name, as
 already happens with the memory  cpu hot-plug tests. They may also have data
 files that would clobber each other. We'd need to make sure all files used in
 all tests have different names, that would be a total mess.

No I want the just one container directory for the tests. Again I am
looking at the bigger picture user-interface angle. Please flatten it,
and resend it.

I responded to your patch v4. Please re-do the patch to address my
comments if you want your patch to be included.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-10 Thread Michael Ellerman
On Tue, 2015-03-10 at 09:11 -0600, Shuah Khan wrote:
> On 03/09/2015 04:29 PM, Shuah Khan wrote:
> > On 03/09/2015 08:20 AM, Shuah Khan wrote:
> >> On 03/05/2015 11:53 AM, Dave Jones wrote:
> >>> On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
> >>>  > This adds make install support to selftests. The basic usage is:
> >>>  > 
> >>>  > $ cd tools/testing/selftests
> >>>  > $ make install
> >>>  > 
> >>>  > That installs into tools/testing/selftests/install, which can then be
> >>>  > copied where ever necessary.
> >>>  > 
> >>>  > The install destination is also configurable using eg:
> >>>  > 
> >>>  > $ INSTALL_PATH=/mnt/selftests make install
> >>>
> >>>  ...
> >>>
> >>>  > +  @# Ask all targets to emit their test scripts
> >>>  > +  echo "#!/bin/bash\n\n" > $(ALL_SCRIPT)
> >>>
> >>> $ ./all.sh 
> >>> -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
> >>>
> >>> Removing the \n\n fixes it.
> >>>
> >>>  > +  echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \
> >>>
> >>> ditto
> >>>
> >>>   Dave
> >>
> >> Michael,
> >>
> >> Could you please fix these problems and send the patch.
> >>
> > 
> > Michael,
> > 
> > Did you happen to run run_kselftest.sh from the install
> > directory to make sure all the dependent executables
> > are installed? You are missing a few required dependencies.
> > efivars test for example.
> > 
> > Please run kselftest_install.sh I sent out for review and
> > compare the following:
> > 
> > - contents of install directory created with your patch vs.
> >   my kselftest_install.sh tool
> > - Compare your run_kselftest.sh run with the one that gets
> >   generated with my kselftest_install.sh tool
> > 
> > General rule is all tests that get run when run_tests target
> > is run should run from the install directory using the
> > run_kselftest.sh generated during install.
> > 
> 
> Couple more things. Please change the install directory name
> to kselftest
> 
> tools/testing/selftests/kselftest
> instead of
> tools/testing/selftests/install

I prefer install, that's what it is after all. I don't know why you're so
obsessed with the "kselftest" name.

> Also please flatten the directory structure under the install
> directory. I don't see any value in creating directory for each
> test for install. Also it is makes it cumbersome for users
> to navigate and work with after the install. This would mean cpu
> and memory hot-plug scripts need unique names.

That's not a good idea. To start with different tests might the same name, as
already happens with the memory & cpu hot-plug tests. They may also have data
files that would clobber each other. We'd need to make sure all files used in
all tests have different names, that would be a total mess.

cheers


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-10 Thread Dave Jones
On Wed, Mar 11, 2015 at 02:15:10PM +1100, Michael Ellerman wrote:
 > On Thu, 2015-03-05 at 13:53 -0500, Dave Jones wrote:
 > > $ ./all.sh 
 > > -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
 > > 
 > > Removing the \n\n fixes it.
 > > 
 > >  > +   echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \
 > > 
 > > ditto
 > 
 > Weird, I don't see that.
 > 
 >   $ make install
 >   $ head install/run_kselftest.sh
 >   #!/bin/bash
 >   
 >   
 >   cd $(dirname $0)
 > 
 > 
 > Does it depend on the shell? I guess none of the newlines are necessary so 
 > I'll
 > just remove them.

Dunno, bash here too. Maybe the version ? My environment at the office is a 
little
dated. (It's based on ye olde ubuntu lts)

Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-10 Thread Michael Ellerman
On Thu, 2015-03-05 at 13:53 -0500, Dave Jones wrote:
> On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
>  > This adds make install support to selftests. The basic usage is:
>  > 
>  > $ cd tools/testing/selftests
>  > $ make install
>  > 
>  > That installs into tools/testing/selftests/install, which can then be
>  > copied where ever necessary.
>  > 
>  > The install destination is also configurable using eg:
>  > 
>  > $ INSTALL_PATH=/mnt/selftests make install
> 
>  ...
> 
>  > +  @# Ask all targets to emit their test scripts
>  > +  echo "#!/bin/bash\n\n" > $(ALL_SCRIPT)
> 
> $ ./all.sh 
> -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
> 
> Removing the \n\n fixes it.
> 
>  > +  echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \
> 
> ditto

Weird, I don't see that.

  $ make install
  $ head install/run_kselftest.sh
  #!/bin/bash
  
  
  cd $(dirname $0)


Does it depend on the shell? I guess none of the newlines are necessary so I'll
just remove them.

cheers


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-10 Thread Shuah Khan
On 03/09/2015 04:29 PM, Shuah Khan wrote:
> On 03/09/2015 08:20 AM, Shuah Khan wrote:
>> On 03/05/2015 11:53 AM, Dave Jones wrote:
>>> On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
>>>  > This adds make install support to selftests. The basic usage is:
>>>  > 
>>>  > $ cd tools/testing/selftests
>>>  > $ make install
>>>  > 
>>>  > That installs into tools/testing/selftests/install, which can then be
>>>  > copied where ever necessary.
>>>  > 
>>>  > The install destination is also configurable using eg:
>>>  > 
>>>  > $ INSTALL_PATH=/mnt/selftests make install
>>>
>>>  ...
>>>
>>>  > +@# Ask all targets to emit their test scripts
>>>  > +echo "#!/bin/bash\n\n" > $(ALL_SCRIPT)
>>>
>>> $ ./all.sh 
>>> -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
>>>
>>> Removing the \n\n fixes it.
>>>
>>>  > +echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \
>>>
>>> ditto
>>>
>>> Dave
>>
>> Michael,
>>
>> Could you please fix these problems and send the patch.
>>
> 
> Michael,
> 
> Did you happen to run run_kselftest.sh from the install
> directory to make sure all the dependent executables
> are installed? You are missing a few required dependencies.
> efivars test for example.
> 
> Please run kselftest_install.sh I sent out for review and
> compare the following:
> 
> - contents of install directory created with your patch vs.
>   my kselftest_install.sh tool
> - Compare your run_kselftest.sh run with the one that gets
>   generated with my kselftest_install.sh tool
> 
> General rule is all tests that get run when run_tests target
> is run should run from the install directory using the
> run_kselftest.sh generated during install.
> 

Couple more things. Please change the install directory name
to kselftest

tools/testing/selftests/kselftest
instead of
tools/testing/selftests/install

Also please flatten the directory structure under the install
directory. I don't see any value in creating directory for each
test for install. Also it is makes it cumbersome for users
to navigate and work with after the install. This would mean cpu
and memory hot-plug scripts need unique names.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-10 Thread Michael Ellerman
On Tue, 2015-03-10 at 09:11 -0600, Shuah Khan wrote:
 On 03/09/2015 04:29 PM, Shuah Khan wrote:
  On 03/09/2015 08:20 AM, Shuah Khan wrote:
  On 03/05/2015 11:53 AM, Dave Jones wrote:
  On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
This adds make install support to selftests. The basic usage is:

$ cd tools/testing/selftests
$ make install

That installs into tools/testing/selftests/install, which can then be
copied where ever necessary.

The install destination is also configurable using eg:

$ INSTALL_PATH=/mnt/selftests make install
 
   ...
 
+  @# Ask all targets to emit their test scripts
+  echo #!/bin/bash\n\n  $(ALL_SCRIPT)
 
  $ ./all.sh 
  -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
 
  Removing the \n\n fixes it.
 
+  echo cd \$$ROOT\n  $(ALL_SCRIPT); \
 
  ditto
 
Dave
 
  Michael,
 
  Could you please fix these problems and send the patch.
 
  
  Michael,
  
  Did you happen to run run_kselftest.sh from the install
  directory to make sure all the dependent executables
  are installed? You are missing a few required dependencies.
  efivars test for example.
  
  Please run kselftest_install.sh I sent out for review and
  compare the following:
  
  - contents of install directory created with your patch vs.
my kselftest_install.sh tool
  - Compare your run_kselftest.sh run with the one that gets
generated with my kselftest_install.sh tool
  
  General rule is all tests that get run when run_tests target
  is run should run from the install directory using the
  run_kselftest.sh generated during install.
  
 
 Couple more things. Please change the install directory name
 to kselftest
 
 tools/testing/selftests/kselftest
 instead of
 tools/testing/selftests/install

I prefer install, that's what it is after all. I don't know why you're so
obsessed with the kselftest name.

 Also please flatten the directory structure under the install
 directory. I don't see any value in creating directory for each
 test for install. Also it is makes it cumbersome for users
 to navigate and work with after the install. This would mean cpu
 and memory hot-plug scripts need unique names.

That's not a good idea. To start with different tests might the same name, as
already happens with the memory  cpu hot-plug tests. They may also have data
files that would clobber each other. We'd need to make sure all files used in
all tests have different names, that would be a total mess.

cheers


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-10 Thread Michael Ellerman
On Thu, 2015-03-05 at 13:53 -0500, Dave Jones wrote:
 On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
   This adds make install support to selftests. The basic usage is:
   
   $ cd tools/testing/selftests
   $ make install
   
   That installs into tools/testing/selftests/install, which can then be
   copied where ever necessary.
   
   The install destination is also configurable using eg:
   
   $ INSTALL_PATH=/mnt/selftests make install
 
  ...
 
   +  @# Ask all targets to emit their test scripts
   +  echo #!/bin/bash\n\n  $(ALL_SCRIPT)
 
 $ ./all.sh 
 -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
 
 Removing the \n\n fixes it.
 
   +  echo cd \$$ROOT\n  $(ALL_SCRIPT); \
 
 ditto

Weird, I don't see that.

  $ make install
  $ head install/run_kselftest.sh
  #!/bin/bash
  
  
  cd $(dirname $0)


Does it depend on the shell? I guess none of the newlines are necessary so I'll
just remove them.

cheers


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-10 Thread Dave Jones
On Wed, Mar 11, 2015 at 02:15:10PM +1100, Michael Ellerman wrote:
  On Thu, 2015-03-05 at 13:53 -0500, Dave Jones wrote:
   $ ./all.sh 
   -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
   
   Removing the \n\n fixes it.
   
 +   echo cd \$$ROOT\n  $(ALL_SCRIPT); \
   
   ditto
  
  Weird, I don't see that.
  
$ make install
$ head install/run_kselftest.sh
#!/bin/bash


cd $(dirname $0)
  
  
  Does it depend on the shell? I guess none of the newlines are necessary so 
  I'll
  just remove them.

Dunno, bash here too. Maybe the version ? My environment at the office is a 
little
dated. (It's based on ye olde ubuntu lts)

Dave

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-10 Thread Shuah Khan
On 03/09/2015 04:29 PM, Shuah Khan wrote:
 On 03/09/2015 08:20 AM, Shuah Khan wrote:
 On 03/05/2015 11:53 AM, Dave Jones wrote:
 On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
   This adds make install support to selftests. The basic usage is:
   
   $ cd tools/testing/selftests
   $ make install
   
   That installs into tools/testing/selftests/install, which can then be
   copied where ever necessary.
   
   The install destination is also configurable using eg:
   
   $ INSTALL_PATH=/mnt/selftests make install

  ...

   +@# Ask all targets to emit their test scripts
   +echo #!/bin/bash\n\n  $(ALL_SCRIPT)

 $ ./all.sh 
 -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory

 Removing the \n\n fixes it.

   +echo cd \$$ROOT\n  $(ALL_SCRIPT); \

 ditto

 Dave

 Michael,

 Could you please fix these problems and send the patch.

 
 Michael,
 
 Did you happen to run run_kselftest.sh from the install
 directory to make sure all the dependent executables
 are installed? You are missing a few required dependencies.
 efivars test for example.
 
 Please run kselftest_install.sh I sent out for review and
 compare the following:
 
 - contents of install directory created with your patch vs.
   my kselftest_install.sh tool
 - Compare your run_kselftest.sh run with the one that gets
   generated with my kselftest_install.sh tool
 
 General rule is all tests that get run when run_tests target
 is run should run from the install directory using the
 run_kselftest.sh generated during install.
 

Couple more things. Please change the install directory name
to kselftest

tools/testing/selftests/kselftest
instead of
tools/testing/selftests/install

Also please flatten the directory structure under the install
directory. I don't see any value in creating directory for each
test for install. Also it is makes it cumbersome for users
to navigate and work with after the install. This would mean cpu
and memory hot-plug scripts need unique names.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-09 Thread Shuah Khan
On 03/09/2015 08:20 AM, Shuah Khan wrote:
> On 03/05/2015 11:53 AM, Dave Jones wrote:
>> On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
>>  > This adds make install support to selftests. The basic usage is:
>>  > 
>>  > $ cd tools/testing/selftests
>>  > $ make install
>>  > 
>>  > That installs into tools/testing/selftests/install, which can then be
>>  > copied where ever necessary.
>>  > 
>>  > The install destination is also configurable using eg:
>>  > 
>>  > $ INSTALL_PATH=/mnt/selftests make install
>>
>>  ...
>>
>>  > + @# Ask all targets to emit their test scripts
>>  > + echo "#!/bin/bash\n\n" > $(ALL_SCRIPT)
>>
>> $ ./all.sh 
>> -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
>>
>> Removing the \n\n fixes it.
>>
>>  > + echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \
>>
>> ditto
>>
>>  Dave
> 
> Michael,
> 
> Could you please fix these problems and send the patch.
> 

Michael,

Did you happen to run run_kselftest.sh from the install
directory to make sure all the dependent executables
are installed? You are missing a few required dependencies.
efivars test for example.

Please run kselftest_install.sh I sent out for review and
compare the following:

- contents of install directory created with your patch vs.
  my kselftest_install.sh tool
- Compare your run_kselftest.sh run with the one that gets
  generated with my kselftest_install.sh tool

General rule is all tests that get run when run_tests target
is run should run from the install directory using the
run_kselftest.sh generated during install.

thanks,
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-09 Thread Shuah Khan
On 03/05/2015 11:53 AM, Dave Jones wrote:
> On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
>  > This adds make install support to selftests. The basic usage is:
>  > 
>  > $ cd tools/testing/selftests
>  > $ make install
>  > 
>  > That installs into tools/testing/selftests/install, which can then be
>  > copied where ever necessary.
>  > 
>  > The install destination is also configurable using eg:
>  > 
>  > $ INSTALL_PATH=/mnt/selftests make install
> 
>  ...
> 
>  > +  @# Ask all targets to emit their test scripts
>  > +  echo "#!/bin/bash\n\n" > $(ALL_SCRIPT)
> 
> $ ./all.sh 
> -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
> 
> Removing the \n\n fixes it.
> 
>  > +  echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \
> 
> ditto
> 
>   Dave

Michael,

Could you please fix these problems and send the patch.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-09 Thread Shuah Khan
On 03/05/2015 11:53 AM, Dave Jones wrote:
 On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
   This adds make install support to selftests. The basic usage is:
   
   $ cd tools/testing/selftests
   $ make install
   
   That installs into tools/testing/selftests/install, which can then be
   copied where ever necessary.
   
   The install destination is also configurable using eg:
   
   $ INSTALL_PATH=/mnt/selftests make install
 
  ...
 
   +  @# Ask all targets to emit their test scripts
   +  echo #!/bin/bash\n\n  $(ALL_SCRIPT)
 
 $ ./all.sh 
 -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory
 
 Removing the \n\n fixes it.
 
   +  echo cd \$$ROOT\n  $(ALL_SCRIPT); \
 
 ditto
 
   Dave

Michael,

Could you please fix these problems and send the patch.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-09 Thread Shuah Khan
On 03/09/2015 08:20 AM, Shuah Khan wrote:
 On 03/05/2015 11:53 AM, Dave Jones wrote:
 On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
   This adds make install support to selftests. The basic usage is:
   
   $ cd tools/testing/selftests
   $ make install
   
   That installs into tools/testing/selftests/install, which can then be
   copied where ever necessary.
   
   The install destination is also configurable using eg:
   
   $ INSTALL_PATH=/mnt/selftests make install

  ...

   + @# Ask all targets to emit their test scripts
   + echo #!/bin/bash\n\n  $(ALL_SCRIPT)

 $ ./all.sh 
 -bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory

 Removing the \n\n fixes it.

   + echo cd \$$ROOT\n  $(ALL_SCRIPT); \

 ditto

  Dave
 
 Michael,
 
 Could you please fix these problems and send the patch.
 

Michael,

Did you happen to run run_kselftest.sh from the install
directory to make sure all the dependent executables
are installed? You are missing a few required dependencies.
efivars test for example.

Please run kselftest_install.sh I sent out for review and
compare the following:

- contents of install directory created with your patch vs.
  my kselftest_install.sh tool
- Compare your run_kselftest.sh run with the one that gets
  generated with my kselftest_install.sh tool

General rule is all tests that get run when run_tests target
is run should run from the install directory using the
run_kselftest.sh generated during install.

thanks,
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shua...@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-05 Thread Dave Jones
On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
 > This adds make install support to selftests. The basic usage is:
 > 
 > $ cd tools/testing/selftests
 > $ make install
 > 
 > That installs into tools/testing/selftests/install, which can then be
 > copied where ever necessary.
 > 
 > The install destination is also configurable using eg:
 > 
 > $ INSTALL_PATH=/mnt/selftests make install

 ...

 > +@# Ask all targets to emit their test scripts
 > +echo "#!/bin/bash\n\n" > $(ALL_SCRIPT)

$ ./all.sh 
-bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory

Removing the \n\n fixes it.

 > +echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \

ditto

Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/9] selftests: Add install target

2015-03-05 Thread Dave Jones
On Tue, Mar 03, 2015 at 03:51:35PM +1100, Michael Ellerman wrote:
  This adds make install support to selftests. The basic usage is:
  
  $ cd tools/testing/selftests
  $ make install
  
  That installs into tools/testing/selftests/install, which can then be
  copied where ever necessary.
  
  The install destination is also configurable using eg:
  
  $ INSTALL_PATH=/mnt/selftests make install

 ...

  +@# Ask all targets to emit their test scripts
  +echo #!/bin/bash\n\n  $(ALL_SCRIPT)

$ ./all.sh 
-bash: ./all.sh: /bin/bash\n\n: bad interpreter: No such file or directory

Removing the \n\n fixes it.

  +echo cd \$$ROOT\n  $(ALL_SCRIPT); \

ditto

Dave

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/9] selftests: Add install target

2015-03-02 Thread Michael Ellerman
This adds make install support to selftests. The basic usage is:

$ cd tools/testing/selftests
$ make install

That installs into tools/testing/selftests/install, which can then be
copied where ever necessary.

The install destination is also configurable using eg:

$ INSTALL_PATH=/mnt/selftests make install

The implementation uses two targets in the child makefiles. The first
"install" is expected to install all files into $(INSTALL_PATH).

The second, "emit_tests", is expected to emit the test instructions (ie.
bash script) on stdout. Separating this from install means the child
makefiles need no knowledge of the location of the test script.

Signed-off-by: Michael Ellerman 
---
 tools/testing/selftests/Makefile| 33 +
 tools/testing/selftests/exec/Makefile   |  3 +++
 tools/testing/selftests/lib.mk  | 23 -
 tools/testing/selftests/memory-hotplug/Makefile |  2 ++
 tools/testing/selftests/mount/Makefile  |  2 ++
 tools/testing/selftests/mqueue/Makefile |  7 ++
 tools/testing/selftests/net/Makefile|  1 +
 tools/testing/selftests/sysctl/Makefile |  1 +
 8 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 4e511221a0c1..a2345f4512bb 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -47,7 +47,40 @@ clean_hotplug:
make -C $$TARGET clean; \
done;
 
+INSTALL_PATH ?= install
+INSTALL_PATH := $(abspath $(INSTALL_PATH))
+ALL_SCRIPT := $(INSTALL_PATH)/all.sh
+
+install:
+ifdef INSTALL_PATH
+   @# Ask all targets to install their files
+   mkdir -p $(INSTALL_PATH)
+   for TARGET in $(TARGETS); do \
+   mkdir -p $(INSTALL_PATH)/$$TARGET ; \
+   make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; 
\
+   done;
+
+   @# Ask all targets to emit their test scripts
+   echo "#!/bin/bash\n\n" > $(ALL_SCRIPT)
+   echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
+   echo "ROOT=\$$PWD\n" >> $(ALL_SCRIPT)
+
+   for TARGET in $(TARGETS); do \
+   echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
+   echo "echo " >> 
$(ALL_SCRIPT); \
+   echo "cd $$TARGET" >> $(ALL_SCRIPT); \
+   make -s -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
+   echo "cd \$$ROOT\n" >> $(ALL_SCRIPT); \
+   done;
+
+   chmod u+x $(ALL_SCRIPT)
+else
+   $(error Error: set INSTALL_PATH to use install)
+endif
+
 clean:
for TARGET in $(TARGETS); do \
make -C $$TARGET clean; \
done;
+
+.PHONY: install
diff --git a/tools/testing/selftests/exec/Makefile 
b/tools/testing/selftests/exec/Makefile
index a0098daeb73d..886cabe307b1 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -19,8 +19,11 @@ execveat.denatured: execveat
$(CC) $(CFLAGS) -o $@ $^
 
 TEST_PROGS := execveat
+TEST_FILES := $(DEPS)
 
 include ../lib.mk
 
+override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: 
execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
+
 clean:
rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved x*
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index b30c5a49cb61..7bd3dabe2846 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -7,4 +7,25 @@ endef
 run_tests: all
$(RUN_TESTS)
 
-.PHONY: run_tests all clean
+define INSTALL_RULE
+   mkdir -p $(INSTALL_PATH)
+   install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_FILES)
+endef
+
+install: all
+ifdef INSTALL_PATH
+   $(INSTALL_RULE)
+else
+   $(error Error: set INSTALL_PATH to use install)
+endif
+
+define EMIT_TESTS
+   @for TEST in $(TEST_PROGS); do \
+   echo "(./$$TEST && echo \"selftests: $$TEST [PASS]\") || echo 
\"selftests: $$TEST [FAIL]\""; \
+   done;
+endef
+
+emit_tests:
+   $(EMIT_TESTS)
+
+.PHONY: run_tests all clean install emit_tests
diff --git a/tools/testing/selftests/memory-hotplug/Makefile 
b/tools/testing/selftests/memory-hotplug/Makefile
index 8f7dea66ecac..598a1f68f534 100644
--- a/tools/testing/selftests/memory-hotplug/Makefile
+++ b/tools/testing/selftests/memory-hotplug/Makefile
@@ -2,7 +2,9 @@ all:
 
 include ../lib.mk
 
+TEST_PROGS := on-off-test.sh
 override RUN_TESTS := ./on-off-test.sh -r 2 || echo "selftests: memory-hotplug 
[FAIL]"
+override EMIT_TESTS := echo "$(RUN_TESTS)"
 
 run_full_test:
@/bin/bash ./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]"
diff --git a/tools/testing/selftests/mount/Makefile 
b/tools/testing/selftests/mount/Makefile
index 06931dfd3ef0..a5b367f032ba 100644
--- a/tools/testing/selftests/mount/Makefile
+++ b/tools/testing/selftests/mount/Makefile
@@ -7,7 +7,9 @@ 

[PATCH 2/9] selftests: Add install target

2015-03-02 Thread Michael Ellerman
This adds make install support to selftests. The basic usage is:

$ cd tools/testing/selftests
$ make install

That installs into tools/testing/selftests/install, which can then be
copied where ever necessary.

The install destination is also configurable using eg:

$ INSTALL_PATH=/mnt/selftests make install

The implementation uses two targets in the child makefiles. The first
install is expected to install all files into $(INSTALL_PATH).

The second, emit_tests, is expected to emit the test instructions (ie.
bash script) on stdout. Separating this from install means the child
makefiles need no knowledge of the location of the test script.

Signed-off-by: Michael Ellerman m...@ellerman.id.au
---
 tools/testing/selftests/Makefile| 33 +
 tools/testing/selftests/exec/Makefile   |  3 +++
 tools/testing/selftests/lib.mk  | 23 -
 tools/testing/selftests/memory-hotplug/Makefile |  2 ++
 tools/testing/selftests/mount/Makefile  |  2 ++
 tools/testing/selftests/mqueue/Makefile |  7 ++
 tools/testing/selftests/net/Makefile|  1 +
 tools/testing/selftests/sysctl/Makefile |  1 +
 8 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 4e511221a0c1..a2345f4512bb 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -47,7 +47,40 @@ clean_hotplug:
make -C $$TARGET clean; \
done;
 
+INSTALL_PATH ?= install
+INSTALL_PATH := $(abspath $(INSTALL_PATH))
+ALL_SCRIPT := $(INSTALL_PATH)/all.sh
+
+install:
+ifdef INSTALL_PATH
+   @# Ask all targets to install their files
+   mkdir -p $(INSTALL_PATH)
+   for TARGET in $(TARGETS); do \
+   mkdir -p $(INSTALL_PATH)/$$TARGET ; \
+   make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; 
\
+   done;
+
+   @# Ask all targets to emit their test scripts
+   echo #!/bin/bash\n\n  $(ALL_SCRIPT)
+   echo cd \$$(dirname \$$0)  $(ALL_SCRIPT)
+   echo ROOT=\$$PWD\n  $(ALL_SCRIPT)
+
+   for TARGET in $(TARGETS); do \
+   echo echo ; echo Running tests in $$TARGET  $(ALL_SCRIPT); \
+   echo echo   
$(ALL_SCRIPT); \
+   echo cd $$TARGET  $(ALL_SCRIPT); \
+   make -s -C $$TARGET emit_tests  $(ALL_SCRIPT); \
+   echo cd \$$ROOT\n  $(ALL_SCRIPT); \
+   done;
+
+   chmod u+x $(ALL_SCRIPT)
+else
+   $(error Error: set INSTALL_PATH to use install)
+endif
+
 clean:
for TARGET in $(TARGETS); do \
make -C $$TARGET clean; \
done;
+
+.PHONY: install
diff --git a/tools/testing/selftests/exec/Makefile 
b/tools/testing/selftests/exec/Makefile
index a0098daeb73d..886cabe307b1 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -19,8 +19,11 @@ execveat.denatured: execveat
$(CC) $(CFLAGS) -o $@ $^
 
 TEST_PROGS := execveat
+TEST_FILES := $(DEPS)
 
 include ../lib.mk
 
+override EMIT_TESTS := echo mkdir -p subdir; (./execveat  echo \selftests: 
execveat [PASS]\) || echo \selftests: execveat [FAIL]\
+
 clean:
rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved x*
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index b30c5a49cb61..7bd3dabe2846 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -7,4 +7,25 @@ endef
 run_tests: all
$(RUN_TESTS)
 
-.PHONY: run_tests all clean
+define INSTALL_RULE
+   mkdir -p $(INSTALL_PATH)
+   install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_FILES)
+endef
+
+install: all
+ifdef INSTALL_PATH
+   $(INSTALL_RULE)
+else
+   $(error Error: set INSTALL_PATH to use install)
+endif
+
+define EMIT_TESTS
+   @for TEST in $(TEST_PROGS); do \
+   echo (./$$TEST  echo \selftests: $$TEST [PASS]\) || echo 
\selftests: $$TEST [FAIL]\; \
+   done;
+endef
+
+emit_tests:
+   $(EMIT_TESTS)
+
+.PHONY: run_tests all clean install emit_tests
diff --git a/tools/testing/selftests/memory-hotplug/Makefile 
b/tools/testing/selftests/memory-hotplug/Makefile
index 8f7dea66ecac..598a1f68f534 100644
--- a/tools/testing/selftests/memory-hotplug/Makefile
+++ b/tools/testing/selftests/memory-hotplug/Makefile
@@ -2,7 +2,9 @@ all:
 
 include ../lib.mk
 
+TEST_PROGS := on-off-test.sh
 override RUN_TESTS := ./on-off-test.sh -r 2 || echo selftests: memory-hotplug 
[FAIL]
+override EMIT_TESTS := echo $(RUN_TESTS)
 
 run_full_test:
@/bin/bash ./on-off-test.sh || echo memory-hotplug selftests: [FAIL]
diff --git a/tools/testing/selftests/mount/Makefile 
b/tools/testing/selftests/mount/Makefile
index 06931dfd3ef0..a5b367f032ba 100644
--- a/tools/testing/selftests/mount/Makefile
+++ b/tools/testing/selftests/mount/Makefile
@@ -7,7 +7,9 @@ unprivileged-remount-test: