xref: /linux/tools/testing/selftests/pstore/pstore_tests (revision 71e2f4dd5a65bd8dbca0b77661e75eea471168f8)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-only
3
4# pstore_tests - Check pstore's behavior before crash/reboot
5#
6# Copyright (C) Hitachi Ltd., 2015
7#  Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
8#
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