I got the following failure: adjtimex02 1 PASS : Test Passed, adjtimex() returned -1 with errno: 14 adjtimex02 2 PASS : Test Passed, adjtimex() returned -1 with errno: 22 adjtimex02 3 PASS : Test Passed, adjtimex() returned -1 with errno: 22 adjtimex02 4 FAIL : Test Failed, adjtimex()returned 5, errno = 0 : Success adjtimex02 5 FAIL : Test Failed, adjtimex()returned 5, errno = 0 : Success adjtimex02 6 PASS : Test Passed, adjtimex() returned -1 with errno: 1
This is because the latest kernel normalizes buf.offset value if it is outside the acceptable range. The commit is: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=eea83d896e318bda54be2d2770d2c5d6668d11db So we should not execute this test case if the kernel version is above 2.6.25. Here is the test result after patching (linux 2.6.26-rc2): adjtimex02 1 PASS : Test Passed, adjtimex() returned -1 with errno: 14 adjtimex02 2 PASS : Test Passed, adjtimex() returned -1 with errno: 22 adjtimex02 3 PASS : Test Passed, adjtimex() returned -1 with errno: 22 adjtimex02 4 CONF : this kernel normalizes buf.offset value if it is outside the acceptable range. adjtimex02 5 CONF : this kernel normalizes buf.offset value if it is outside the acceptable range. adjtimex02 6 PASS : Test Passed, adjtimex() returned -1 with errno: 1 Signed-off-by: Miao Xie <[EMAIL PROTECTED]> --- testcases/kernel/syscalls/adjtimex/adjtimex02.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/testcases/kernel/syscalls/adjtimex/adjtimex02.c b/testcases/kernel/syscalls/adjtimex/adjtimex02.c index 9ba56f0..52bc7e4 100644 --- a/testcases/kernel/syscalls/adjtimex/adjtimex02.c +++ b/testcases/kernel/syscalls/adjtimex/adjtimex02.c @@ -40,8 +40,12 @@ * is made to set buf.tick to a value > 1100000/HZ * 4) adjtimex(2) fails with errno set to EINVAL if an attempt * is made to set buf.offset to a value > 512000L + * (This test case will be executed only if the kernel version + * is 2.6.25 or below) * 5) adjtimex(2) fails with errno set to EINVAL if an attempt * is made to set buf.offset to a value < 512000L + * (This test case will be executed only if the kernel version + * is 2.6.25 or below) * 6) adjtimex(2) fails with errno set to EPERM if buf.mode is * non-zero and the user is not super-user. * @@ -154,6 +158,18 @@ main(int ac, char **av) Tst_count = 0; for(i = 0; i < TST_TOTAL; ++i) { + /* + * since Linux 2.6.26, if buf.offset value is outside + * the acceptable range, it is simply normalized instead + * of letting the syscall fail. so just skip this test + * case. + */ + if ((i == 3 || i == 4) && tst_kvercmp(2,6,25) > 0) { + tst_resm(TCONF, "this kernel normalizes buf." + "offset value if it is outside" + " the acceptable range."); + continue; + } buff = tim_save; buff.modes = SET_MODE; -- 1.5.4.rc3 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list