tools/testing/selftests/pstore/common_tests
Source file repositories/reference/linux-study-clean/tools/testing/selftests/pstore/common_tests
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/pstore/common_tests- Extension
[no extension]- Size
- 1629 bytes
- Lines
- 84
- 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
# common_tests - Shell script commonly used by pstore test scripts
#
# Copyright (C) Hitachi Ltd., 2015
# Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
#
# Utilities
errexit() { # message
echo "Error: $1" 1>&2
exit 1
}
absdir() { # file_path
(cd `dirname $1`; pwd)
}
show_result() { # result_value
if [ $1 -eq 0 ]; then
prlog "ok"
else
prlog "FAIL"
rc=1
fi
}
check_files_exist() { # type of pstorefs file
if [ -e ${1}-${backend}-0 ]; then
prlog "ok"
for f in `ls ${1}-${backend}-*`; do
prlog -e "\t${f}"
done
else
prlog "FAIL"
rc=1
fi
}
operate_files() { # tested value, files, operation
if [ $1 -eq 0 ]; then
prlog
for f in $2; do
prlog -ne "\t${f} ... "
# execute operation
$3 $f
show_result $?
done
else
prlog " ... FAIL"
rc=1
fi
}
# Parameters
TEST_STRING_PATTERN="Testing pstore: uuid="
UUID=`cat /proc/sys/kernel/random/uuid`
TOP_DIR=`absdir $0`
LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`_${UUID}/
REBOOT_FLAG=$TOP_DIR/reboot_flag
# Preparing logs
LOG_FILE=$LOG_DIR/`basename $0`.log
mkdir -p $LOG_DIR || errexit "Failed to make a log directory: $LOG_DIR"
date > $LOG_FILE
prlog() { # messages
/bin/echo "$@" | tee -a $LOG_FILE
}
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.