From: "Mitani" <mitani@ryobi.co.jp>
To: 'Garrett Cooper' <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net,
Mike Frysinger <vapier@gentoo.org>, Nate Straz <nate@refried.org>
Subject: Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
Date: Thu, 26 Nov 2009 12:02:48 +0900 [thread overview]
Message-ID: <002001ca6e44$ef7341a0$ce59c4e0$@co.jp> (raw)
In-Reply-To: <364299f40911242226g68c37f59r1fcfd23ad87dd1e@mail.gmail.com>
Hi,
Sorry I'm late.
I copied a patch part from ltp-list and apply it, but the patch failed.
I didn't notice that tabs in the patch were changed to blanks,
and I took time. Forgive me.
But, I could make right patch by copying from your email, and I succeeded.
As a result, mbind01 became PASS by applying your last patch.
Thank you.
-Tomonori Mitani
-----Original Message-----
From: Garrett Cooper [mailto:yanegomi@gmail.com]
Sent: Wednesday, November 25, 2009 3:26 PM
To: Mike Frysinger
Cc: Mitani; ltp-list@lists.sourceforge.net; Nate Straz; Matt Helsley
Subject: Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
On Tue, Nov 24, 2009 at 9:33 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
>> --- regen.sh 19 Nov 2009 19:35:15 -0000 1.12
>> +++ regen.sh 25 Nov 2009 05:12:13 -0000
>> @@ -32,8 +32,13 @@ static void cleanup(void);
>> tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch");
>> \\ errno = ENOSYS; \\
>> __ret = -1; \\
>> - } else \\
>> + } else { \\
>> __ret = syscall(NR, ##__VA_ARGS__); \\
>> + if (__ret == -1 && errno == ENOSYS) { \\
>> + tst_brkm(TCONF, cleanup, "syscall " #NR " not
supported on your arch");
>> \\ + errno = ENOSYS; \\
>> + } \\
>> + } \\
>> __ret; \\
>> })
>> EOF
>
> i'd prefer this change
> --- testcases/kernel/include/regen.sh 9 Oct 2009 17:55:48 -0000
1.11
> +++ testcases/kernel/include/regen.sh 25 Nov 2009 05:28:27 -0000
> @@ -30,11 +30,12 @@ static void cleanup(void);
> #define syscall(NR, ...) ({ \\
> int __ret; \\
> if (NR == 0) { \\
> - tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
> errno = ENOSYS; \\
> __ret = -1; \\
> } else \\
> __ret = syscall(NR, ##__VA_ARGS__); \\
> + if (__ret == -1 && errno == ENOSYS) \\
> + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
> __ret; \\
> })
> EOF
Ok -- that makes more sense.. besides, I think gcc was optimizing
out the first branch with -O2 if it always evaluated to false. Here's
the new patch (I'm keeping the errno = ENOSYS part because I want to
make sure that tst_brkm doesn't mess up the errno value if a write(2)
fails or something).
Thanks!
-Garrett
EXAMPLE (Positive):
gcooper@orangebox
/scratch/ltp-dev2/ltp/testcases/kernel/syscalls/mbind $ ./mbind01
mbind01 0 TINFO : (case00) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 1 TPASS : (case00) END
mbind01 0 TINFO : (case01) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 2 TPASS : (case01) END
mbind01 0 TINFO : (case02) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 3 TPASS : (case02) END
mbind01 0 TINFO : (case03) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 4 TPASS : (case03) END
mbind01 0 TINFO : (case04) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 5 TPASS : (case04) END
mbind01 0 TINFO : (case05) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 6 TPASS : (case05) END
mbind01 0 TINFO : (case06) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 7 TPASS : (case06) END
mbind01 0 TINFO : (case07) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 8 TPASS : (case07) END
mbind01 0 TINFO : (case08) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 9 TPASS : (case08) END
mbind01 0 TINFO : (case09) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 10 TPASS : (case09) END
mbind01 0 TINFO : (case10) START
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=14 (Bad address)
mbind01 11 TPASS : (case10) END
mbind01 0 TINFO : (case00) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 12 TPASS : (case00) END
mbind01 0 TINFO : (case01) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 13 TPASS : (case01) END
mbind01 0 TINFO : (case02) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 14 TPASS : (case02) END
mbind01 0 TINFO : (case03) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 15 TPASS : (case03) END
mbind01 0 TINFO : (case04) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 16 TPASS : (case04) END
mbind01 0 TINFO : (case05) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 17 TPASS : (case05) END
mbind01 0 TINFO : (case06) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 18 TPASS : (case06) END
mbind01 0 TINFO : (case07) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
mbind01 19 TPASS : (case07) END
mbind01 0 TINFO : (case08) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 20 TPASS : (case08) END
mbind01 0 TINFO : (case09) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
mbind01 21 TPASS : (case09) END
mbind01 0 TINFO : (case10) START
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=14 (Bad address)
mbind01 22 TPASS : (case10) END
EXAMPLE (Negative):
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ make
all
make -C "/scratch/ltp-dev2/ltp/lib" -f "/scratch/ltp-dev2/ltp/lib/Makefile"
all
make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/scratch/ltp-dev2/ltp/lib'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-I/scratch/ltp-dev2/ltp/testcases/kernel/include -I../../../../include
-I../../../../include -L../../../../lib foo.c -lltp -o foo
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $
./foo
foo 1 TCONF : syscall __NR_foo not supported on your arch
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo
$ cat foo.c
#include "test.h"
#include "linux_syscall_numbers.h"
#define __NR_foo 19567
int TST_TOTAL = 1;
char *TCID = "foo";
void cleanup(void) { }
int
main (void) {
return syscall(__NR_foo, "bar");
}
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $
./foo
foo 1 TCONF : syscall __NR_foo not supported on your arch
PATCH:
Index: regen.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/include/regen.sh,v
retrieving revision 1.12
diff -u -p -r1.12 regen.sh
--- regen.sh 19 Nov 2009 19:35:15 -0000 1.12
+++ regen.sh 25 Nov 2009 06:22:33 -0000
@@ -29,11 +29,15 @@ static void cleanup(void);
#define syscall(NR, ...) ({ \\
int __ret; \\
if (NR == 0) { \\
- tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
errno = ENOSYS; \\
__ret = -1; \\
- } else \\
+ } else { \\
__ret = syscall(NR, ##__VA_ARGS__); \\
+ } \\
+ if (__ret == -1 && errno == ENOSYS) { \\
+ tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
+ errno = ENOSYS; \\
+ } \\
__ret; \\
})
EOF
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2009-11-26 3:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 3:07 [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz Mitani
2009-11-25 5:17 ` Garrett Cooper
2009-11-25 5:33 ` Mike Frysinger
2009-11-25 6:26 ` Garrett Cooper
2009-11-25 7:36 ` Mike Frysinger
2009-11-25 7:42 ` Garrett Cooper
2009-11-26 3:02 ` Mitani [this message]
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='002001ca6e44$ef7341a0$ce59c4e0$@co.jp' \
--to=mitani@ryobi.co.jp \
--cc=ltp-list@lists.sourceforge.net \
--cc=nate@refried.org \
--cc=vapier@gentoo.org \
--cc=yanegomi@gmail.com \
/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