Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234764

Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot

From Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot
Date 2015-09-29 09:20 +0200
Message-ID <qdXmG-7W4-17@gated-at.bofh.it> (permalink)
References <q6oWK-2qG-21@gated-at.bofh.it> <q6ppL-2YE-5@gated-at.bofh.it> <q6AuR-2ah-1@gated-at.bofh.it> <q8Ok2-8ll-5@gated-at.bofh.it> <qbgvw-1pI-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-29 09:20 +0200

csiph-web