[LTP] getrusage04 issues on virtualized env

Cyril Hrubis chrubis@suse.cz
Wed Oct 13 12:21:46 CEST 2021


Hi!
> I am running LTP tests in different public cloud providers ( Azure , GCE
> , Amazon ). Currently have issues with getrusage04 test on Azure . Looks
> like
> https://github.com/linux-test-project/ltp/commit/3e0ba9aa6a7c933a74d6525ca69028992a3ba1ad
> not behaves as expected ==> test is not actually skipped on Azure and
> failing because of known instability of the tests in virtual environments :
> 
> sh-4.4# getrusage04; echo cmd-exit-774-$?
> getrusage04    0  TINFO  :  Expected timers granularity is 4000 us
> getrusage04    0  TINFO  :  Using 1 as multiply factor for max [us]time
> increment (1000+4000us)!
> getrusage04    0  TINFO  :  utime:        2538us; stime:           0us
> getrusage04    0  TINFO  :  utime:        3813us; stime:        1906us
> getrusage04    0  TINFO  :  utime:        6317us; stime:        6317us
> getrusage04    0  TINFO  :  utime:        7407us; stime:        6317us
> getrusage04    0  TINFO  :  utime:        8849us; stime:        8849us
> getrusage04    0  TINFO  :  utime:        9587us; stime:       12783us
> getrusage04    0  TINFO  :  utime:        9637us; stime:       16062us
> getrusage04    0  TINFO  :  utime:       10709us; stime:       21418us
> getrusage04    1  TFAIL  :  getrusage04.c:133: stime increased > 5000us:
> 
> 
> I manually checked "systemd-detect-virt" execution on VM in azure and it
> returns "microsoft" as expected. Digging into tst_is_virt source code
> and around also haven't bring any ideas to me :(
> 
> Any hints how to follow up ?

I guess that we should skip the test if any virtualization is detected,
that should be done with:

diff --git a/testcases/kernel/syscalls/getrusage/getrusage04.c b/testcases/kernel/syscalls/getrusage/getrusage04.c
index 06b576d79..318fa7ffc 100644
--- a/testcases/kernel/syscalls/getrusage/getrusage04.c
+++ b/testcases/kernel/syscalls/getrusage/getrusage04.c
@@ -197,7 +197,7 @@ static void setup(void)
 {
        tst_sig(NOFORK, DEF_HANDLER, cleanup);

-       if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_KVM) || tst_is_virt(VIRT_HYPERV))
+       if (tst_is_virt(VIRT_ANY))
                tst_brkm(TCONF, NULL, "This testcase is not supported on this"
                        " virtual machine.");


Will you send a patch to ML or should I do so?

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list