From: chrubis@suse.cz
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] new testcase: kmsg01
Date: Mon, 17 Jun 2013 18:21:04 +0200 [thread overview]
Message-ID: <20130617162103.GC2053@rei> (raw)
In-Reply-To: <790434361.3815720.1371483737505.JavaMail.root@redhat.com>
Hi!
> > > +static void test_read_returns_first_message(void)
> > > +{
> > > + char msg[NUM_READ_MSGS][MAX_MSGSIZE];
> > > + int msgs_match = 1;
> > > + int i;
> > > +
> > > + tst_resm(TINFO, "TEST: mult. readers will get same first message");
> > > + for (i = 0; i < NUM_READ_MSGS; i++) {
> > > + if (find_msg(-1, "", msg[i], MAX_MSGSIZE, 1) != 0)
> > > + tst_resm(TFAIL, "failed to find any message");
> > > + }
> > > +
> > > + for (i = 0; i < NUM_READ_MSGS-1; i++)
> > > + if (strlen(msg[i]) > 0 && strcmp(msg[i], msg[i+1]) != 0)
> > > + msgs_match = 0;
> > > + if (msgs_match)
> > > + tst_resm(TPASS, "all readers got same message on first read");
> > > + else
> > > + tst_resm(TFAIL, "readers got different messages");
> >
> > Is here a chance that the log would be overwritten by a kernel writing
> > urelated message? We do fill the log with a bunch of messages (126)
> > before this test, how much of the kernel log is filled by this? Looking
> > in the kernel .config I have LOG_BUF_SHIFT=18 which is 256KB which
> > should be large enough, but it could be set as low as 12 which is 4KB.
>
> It is. Let's open extra fd, which we attempt to read only at the end.
> If reads fails with EPIPE we know that first message was overwritten.
> If that happens we can retry for NUM_READ_RETRY and repeat the test.
> If we get EPIPE in each attempt we can report TWARN.
>
Souns good.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2013-06-17 16:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-11 13:47 [LTP] [PATCH] new testcase: kmsg01 Jan Stancek
2013-06-17 15:13 ` chrubis
[not found] ` <790434361.3815720.1371483737505.JavaMail.root@redhat.com>
2013-06-17 16:21 ` chrubis [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=20130617162103.GC2053@rei \
--to=chrubis@suse.cz \
--cc=jstancek@redhat.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