public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] A new API to get distro name?
@ 2018-05-15  4:03 Zhang, Yixin
  2018-05-15 10:49 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Yixin @ 2018-05-15  4:03 UTC (permalink / raw)
  To: ltp

Hello,

I see that some shell tests are sensitive to distro, but not well managed currently. 
Here are some examples I find:
In test "su01" in scenario "admin_tools", here is the way how it determine the distro (which is incorrect)
  41 tvar=${MACHTYPE%-*}
  42 tvar=${tvar#*-}
  43
  44 # need to export tvar for su01_s1
  45 export tvar
  46 printf "Machine type is: $tvar\n\n"
  47
  48 if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ]
  49 # Need to also set group for TEST_USER2
Similar for cron/at tests in "admin_tools" (the location of deny/allow file is not at the default location for Ubuntu)

Also in test cpuhotplug07, the folder "/usr/src/linux" doesn't exits on Ubuntu, so some modification based on distro is needed.

I'd like to fix them, and need some suggestion: should we add a common API in test.sh or should I just fix them in the test cases derectly? If we plan to add a common API in the test.sh I may need some help as here I don't have all the distro in hand. Thanks. 

Yixin

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

* [LTP] A new API to get distro name?
  2018-05-15  4:03 [LTP] A new API to get distro name? Zhang, Yixin
@ 2018-05-15 10:49 ` Cyril Hrubis
  2018-05-16 10:05   ` Zhang, Yixin
  0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2018-05-15 10:49 UTC (permalink / raw)
  To: ltp

Hi!
> I see that some shell tests are sensitive to distro, but not well managed currently.
> Here are some examples I find:
> In test "su01" in scenario "admin_tools", here is the way how it determine the distro (which is incorrect)
>   41 tvar=${MACHTYPE%-*}
>   42 tvar=${tvar#*-}
>   43
>   44 # need to export tvar for su01_s1
>   45 export tvar
>   46 printf "Machine type is: $tvar\n\n"
>   47
>   48 if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ]
>   49 # Need to also set group for TEST_USER2
> Similar for cron/at tests in "admin_tools" (the location of deny/allow file is not at the default location for Ubuntu)

There has been a recent discussion about what command testcases should
be kept in LTP. Since LTP primary focus is on kernel testing, it does
not make much sense to keep broken test for userspace commands.

So we may as well get rid of these three testcases instead of rewriting
them unless somebody really wants to keep them. The whole admin_tools
runtest file consists of broken tests that are at least partially
outside of the focus of LTP.

> Also in test cpuhotplug07, the folder "/usr/src/linux" doesn't exits on Ubuntu, so some modification based on distro is needed.

This should be fixed, the test expects the Linux kernel sources to be
present at /usr/src/linux/ in order to generate system load.

> I'd like to fix them, and need some suggestion: should we add a common
> API in test.sh or should I just fix them in the test cases derectly?
> If we plan to add a common API in the test.sh I may need some help as
> here I don't have all the distro in hand.

Just FYI the test.sh is the old and deprecated test library, the new one
is called tst_test.sh.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] A new API to get distro name?
  2018-05-15 10:49 ` Cyril Hrubis
@ 2018-05-16 10:05   ` Zhang, Yixin
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Yixin @ 2018-05-16 10:05 UTC (permalink / raw)
  To: ltp

On 2018-05-15 at 12:49:52 +0200, Cyril Hrubis wrote:
> Hi!
> > I see that some shell tests are sensitive to distro, but not well managed currently.
> > Here are some examples I find:
> > In test "su01" in scenario "admin_tools", here is the way how it determine the distro (which is incorrect)
> >   41 tvar=${MACHTYPE%-*}
> >   42 tvar=${tvar#*-}
> >   43
> >   44 # need to export tvar for su01_s1
> >   45 export tvar
> >   46 printf "Machine type is: $tvar\n\n"
> >   47
> >   48 if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ]
> >   49 # Need to also set group for TEST_USER2
> > Similar for cron/at tests in "admin_tools" (the location of deny/allow file is not at the default location for Ubuntu)
> 
> There has been a recent discussion about what command testcases should
> be kept in LTP. Since LTP primary focus is on kernel testing, it does
> not make much sense to keep broken test for userspace commands.
> 
> So we may as well get rid of these three testcases instead of rewriting
> them unless somebody really wants to keep them. The whole admin_tools
> runtest file consists of broken tests that are at least partially
> outside of the focus of LTP.

Understood.

> 
> > Also in test cpuhotplug07, the folder "/usr/src/linux" doesn't exits on Ubuntu, so some modification based on distro is needed.
> 
> This should be fixed, the test expects the Linux kernel sources to be
> present at /usr/src/linux/ in order to generate system load.

I'll submit a patch for it, using "/usr/src/linux-`uname -r`" in case there is
no "/usr/src/linux/"

> 
> > I'd like to fix them, and need some suggestion: should we add a common
> > API in test.sh or should I just fix them in the test cases derectly?
> > If we plan to add a common API in the test.sh I may need some help as
> > here I don't have all the distro in hand.
> 
> Just FYI the test.sh is the old and deprecated test library, the new one
> is called tst_test.sh.

Got it.

> 
> -- 
> Cyril Hrubis
> chrubis@suse.cz

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

end of thread, other threads:[~2018-05-16 10:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-15  4:03 [LTP] A new API to get distro name? Zhang, Yixin
2018-05-15 10:49 ` Cyril Hrubis
2018-05-16 10:05   ` Zhang, Yixin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox