tools/testing/selftests/pstore/pstore_post_reboot_tests
Source file repositories/reference/linux-study-clean/tools/testing/selftests/pstore/pstore_post_reboot_tests
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/pstore/pstore_post_reboot_tests- Extension
[no extension]- Size
- 1943 bytes
- Lines
- 81
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
# pstore_post_reboot_tests - Check pstore's behavior after crash/reboot
#
# Copyright (C) Hitachi Ltd., 2015
# Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
#
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
. ./common_tests
if [ -e $REBOOT_FLAG ]; then
rm $REBOOT_FLAG
else
prlog "pstore_crash_test has not been executed yet. we skip further tests."
exit $ksft_skip
fi
prlog -n "Mounting pstore filesystem ... "
mount_info=`grep pstore /proc/mounts`
if [ $? -eq 0 ]; then
mount_point=`echo ${mount_info} | cut -d' ' -f2 | head -n1`
prlog "ok"
else
mount none /sys/fs/pstore -t pstore
if [ $? -eq 0 ]; then
mount_point=`grep pstore /proc/mounts | cut -d' ' -f2 | head -n1`
prlog "ok"
else
prlog "FAIL"
exit 1
fi
fi
cd ${mount_point}
prlog -n "Checking dmesg files exist in pstore filesystem ... "
check_files_exist dmesg
prlog -n "Checking console files exist in pstore filesystem ... "
check_files_exist console
prlog -n "Checking pmsg files exist in pstore filesystem ... "
check_files_exist pmsg
prlog -n "Checking dmesg files contain oops end marker"
grep_end_trace() {
grep -q "\---\[ end trace" $1
}
files=`ls dmesg-${backend}-*`
operate_files $? "$files" grep_end_trace
prlog -n "Checking console file contains oops end marker ... "
grep -q "\---\[ end trace" console-${backend}-0
show_result $?
prlog -n "Checking pmsg file properly keeps the content written before crash ... "
prev_uuid=`cat $TOP_DIR/prev_uuid`
if [ $? -eq 0 ]; then
nr_matched=`grep -c "$TEST_STRING_PATTERN" pmsg-${backend}-0`
if [ $nr_matched -eq 1 ]; then
grep -q "$TEST_STRING_PATTERN"$prev_uuid pmsg-${backend}-0
show_result $?
else
prlog "FAIL"
rc=1
fi
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.