xref: /linux/tools/testing/selftests/pstore/pstore_tests (revision 7aacf86b75bc5523d20fd9127104384fce51ce9c)
1#!/bin/sh
2
3# pstore_tests - Check pstore's behavior before crash/reboot
4#
5# Copyright (C) Hitachi Ltd., 2015
6#  Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
7#
8# Released under the terms of the GPL v2.
9
10. ./common_tests
11
12prlog -n "Checking pstore console is registered ... "
13dmesg | grep -q "console \[pstore"
14show_result $?
15
16prlog -n "Checking /dev/pmsg0 exists ... "
17test -e /dev/pmsg0
18show_result $?
19
20prlog -n "Writing unique string to /dev/pmsg0 ... "
21if [ -e "/dev/pmsg0" ]; then
22    echo "${TEST_STRING_PATTERN}""$UUID" > /dev/pmsg0
23    show_result $?
24    echo "$UUID" > $TOP_DIR/uuid
25else
26    prlog "FAIL"
27    rc=1
28fi
29
30exit $rc
31