public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Takeshi Misawa <jeantsuru@icloud.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] settimeofday01:TFAIL in Kernel 4.2.0
Date: Sun, 13 Sep 2015 23:27:26 +0900	[thread overview]
Message-ID: <55F587CE.1070904@iCloud.com> (raw)

This is a my first mail to LTP mailing list.

I'm testing Linux Kernel 4.2.0 by LTP. I saw a following Error.
-----
settimeofday01    1  TFAIL  :  settimeofday01.c:98: Error Setting Time, 
errno=22
settimeofday01    2  TFAIL  :  settimeofday01.c:120: Test condition 1 failed
settimeofday01    3  TPASS  :  Test condition 2 successful
-----

In commit of Linux Kernel:
e1d7ba8735551ed79c7a0463a042353574b96da3 "time: Always make sure 
wall_to_monotonic isn't positive"
add a new check to do_settimeofday64().

This commit said:
"As a result one can't set the CLOCK_REALTIME time prior to (1970 + 
system uptime)."

In settimeofday01 test case, parameter of first settimeofday() is 
100s100μs. A lot of cases, TEST_RETURN is -1.

I'd better to modify settimeofday01 test case.

To meet that requirement, I made following changes.(I have less 
confidence that it is correct...)
-----
diff --git a/testcases/kernel/syscalls/settimeofday/settimeofday01.c 
b/testcases/kernel/syscalls/settimeofday
index b598800..a6894fb 100644
--- a/testcases/kernel/syscalls/settimeofday/settimeofday01.c
+++ b/testcases/kernel/syscalls/settimeofday/settimeofday01.c
@@ -88,9 +88,10 @@ int main(int argc, char **argv)
               int condition_number = 1;
               /* reset tst_count in case we are looping */
               tst_count = 0;
-
-               tp.tv_sec = VAL_SEC;
-               tp.tv_usec = VAL_MSEC;
+
+               gettimeofday(&tp, NULL);
+               tp.tv_sec += VAL_SEC;
+               tp.tv_usec += VAL_MSEC;

               TEST(settimeofday(&tp, NULL));
               if (TEST_RETURN == -1) {
----

Result:
settimeofday01    1  TPASS  :  Test condition 1 successful
settimeofday01    2  TPASS  :  Test condition 2 successful

Thanks.


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2015-09-13 14:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-13 14:27 Takeshi Misawa [this message]
2015-09-15  8:51 ` [LTP] settimeofday01:TFAIL in Kernel 4.2.0 Cyril Hrubis
2015-09-19  7:57   ` Takeshi Misawa
2015-09-24 14:26     ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55F587CE.1070904@iCloud.com \
    --to=jeantsuru@icloud.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox