xref: /linux/tools/testing/selftests/pstore/pstore_tests (revision da1d9caf95def6f0320819cf941c9fd1069ba9e1)
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 -Eq "console \[(pstore|${backend})"
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