public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] syscalls/clock_settime03: Fix testcases have been waiting, timeout failure
@ 2022-03-10 12:33 Lianjie Zhang
  2022-10-10  9:32 ` Richard Palethorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Lianjie Zhang @ 2022-03-10 12:33 UTC (permalink / raw)
  To: ltp

From: zhanglianjie <zhanglianjie@uniontech.com>

If the system enables auto-synchronization time configuration,
this test case will wait until the timeout. Therefore,
the automatic synchronization time configuration of the system needs to be turned off in the setup phase.

message:
tst_test.c:1457: TINFO: Timeout per run is 0h 05m 00s
clock_settime03.c:35: TINFO: Testing variant: syscall with old kernel spec
tst_test.c:1506: TINFO: If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1
tst_test.c:1507: TBROK: Test killed! (timeout?)

Signed-off-by: zhanglianjie <zhanglianjie@uniontech.com>

diff --git a/testcases/kernel/syscalls/clock_settime/clock_settime03.c b/testcases/kernel/syscalls/clock_settime/clock_settime03.c
index f196a257c..ce0e7b4c4 100644
--- a/testcases/kernel/syscalls/clock_settime/clock_settime03.c
+++ b/testcases/kernel/syscalls/clock_settime/clock_settime03.c
@@ -31,6 +31,7 @@ static struct time64_variants variants[] = {
 static void setup(void)
 {
 	struct time64_variants *tv = &variants[tst_variant];
+	int ret;

 	tst_res(TINFO, "Testing variant: %s", tv->desc);
 	start.type = end.type = its.type = tv->ts_type;
@@ -40,6 +41,10 @@ static void setup(void)
 	    sizeof(start.ts.kern_old_ts.tv_sec) == 4) {
 		tst_brk(TCONF, "Not Y2038 safe to run test");
 	}
+
+	ret = tst_system("timedatectl set-ntp false");
+	if (ret)
+		tst_res(TINFO, "failed to timedatectl set-ntp");
 }

 static void run(void)
--
2.20.1




-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v2] syscalls/clock_settime03: Fix testcases have been waiting, timeout failure
  2022-03-10 12:33 [LTP] [PATCH v2] syscalls/clock_settime03: Fix testcases have been waiting, timeout failure Lianjie Zhang
@ 2022-10-10  9:32 ` Richard Palethorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Palethorpe @ 2022-10-10  9:32 UTC (permalink / raw)
  To: Lianjie Zhang; +Cc: ltp

Hello,

Lianjie Zhang <zhanglianjie@uniontech.com> writes:

> From: zhanglianjie <zhanglianjie@uniontech.com>
>
> If the system enables auto-synchronization time configuration,
> this test case will wait until the timeout. Therefore,
> the automatic synchronization time configuration of the system needs to be turned off in the setup phase.
>
> message:
> tst_test.c:1457: TINFO: Timeout per run is 0h 05m 00s
> clock_settime03.c:35: TINFO: Testing variant: syscall with old kernel spec
> tst_test.c:1506: TINFO: If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1
> tst_test.c:1507: TBROK: Test killed! (timeout?)
>
> Signed-off-by: zhanglianjie <zhanglianjie@uniontech.com>
>
> diff --git a/testcases/kernel/syscalls/clock_settime/clock_settime03.c b/testcases/kernel/syscalls/clock_settime/clock_settime03.c
> index f196a257c..ce0e7b4c4 100644
> --- a/testcases/kernel/syscalls/clock_settime/clock_settime03.c
> +++ b/testcases/kernel/syscalls/clock_settime/clock_settime03.c
> @@ -31,6 +31,7 @@ static struct time64_variants variants[] = {
>  static void setup(void)
>  {
>  	struct time64_variants *tv = &variants[tst_variant];
> +	int ret;
>
>  	tst_res(TINFO, "Testing variant: %s", tv->desc);
>  	start.type = end.type = its.type = tv->ts_type;
> @@ -40,6 +41,10 @@ static void setup(void)
>  	    sizeof(start.ts.kern_old_ts.tv_sec) == 4) {
>  		tst_brk(TCONF, "Not Y2038 safe to run test");
>  	}
> +
> +	ret = tst_system("timedatectl set-ntp false");

This still requires that systemd is being used to set the time.

Possibly we could setup a second timer which uses CLOCK_MONOTONIC. If
that expires before the other then we can check if the time was reset to
the present and signal TCONF.

> +	if (ret)
> +		tst_res(TINFO, "failed to timedatectl set-ntp");
>  }
>
>  static void run(void)
> --
> 2.20.1


-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2022-10-10  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10 12:33 [LTP] [PATCH v2] syscalls/clock_settime03: Fix testcases have been waiting, timeout failure Lianjie Zhang
2022-10-10  9:32 ` Richard Palethorpe

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