[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <560A3B58.9060403@hitachi.com>
Date: Tue, 29 Sep 2015 16:18:48 +0900
From: Hiraku Toyooka <hiraku.toyooka.gu@...achi.com>
To: Mark Salyzyn <salyzyn@...roid.com>, <linux-kernel@...r.kernel.org>
CC: Tony Luck <tony.luck@...el.com>, Kees Cook <keescook@...omium.org>,
<linux-api@...r.kernel.org>, Anton Vorontsov <anton@...msg.org>,
Shuah Khan <shuahkh@....samsung.com>,
Colin Cross <ccross@...roid.com>, <seiji.aguchi.tr@...achi.com>
Subject: Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot
Hello,
I'm sorry for my late reply.
Mark Salyzyn wrote:
> Perfectly match is an issue, since something else might be using pmsg.
> For instance, one of the applications that uses this interface
> packetizes the messages so they can be picked out from other sources
> that do not comply with the header (count, magic number etc). In this
> case, should that daemon be active, your content would be ignores, but
> your content would also be buried, but can be needled out with grep.
>
> What you should do is grep for your string pattern within some
> acceptable regex, and one should be found and no other, and it should
> match perfectly. This would prevent another daemon's content from
> disrupting your test and causing a false negative.
OK. I think that the following method suit your intention.
By splitting unique test string into TEST_STRING_PATTERN part and UUID
part, we can check both the non-existence of previous content and the
unique match on reboot-comparison run.
I'll include this in v2.
# before crash
TEST_STRING_PATTERN="Testing pstore: uuid="
UUID=`cat /proc/sys/kernel/random/uuid`
echo "$TEST_STRING_PATTERN""$UUID" > /dev/pmsg0
echo "$UUID" > uuid
# after crash
prlog -n "Checking pmsg file properly keeps the content written before
crash ... "
nr_matched=`grep -c "$TEST_STRING_PATTERN" pmsg-${backend}-0`
if [ $nr_matched -eq 1 ]; then
grep -q "$TEST_STRING_PATTERN"`cat uuid` pmsg-${backend}-0
if [ $? -eq 0 ]; then
prlog "ok"
else
prlog "FAIL"
else
prlog "FAIL"
fi
Best regards,
Hiraku Toyooka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists