Lines Matching +full:test +full:- +full:cpu

2 # SPDX-License-Identifier: GPL-2.0
4 # A test that makes sure that sysdata runtime CPU data is properly set
7 # There are 3 different tests, every time sent using a random CPU.
8 # - Test #1
10 # - Test #2
12 # - Test #3
17 set -euo pipefail
19 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
25 if [[ ! -f "${NETCONS_PATH}/userdata/cpu_nr_enabled" ]]
27 echo "Populate CPU configfs path not available in ${NETCONS_PATH}/userdata/cpu_nr_enabled" >&2
36 if [[ ! -f "${NETCONS_PATH}/userdata/taskname_enabled" ]]
47 if [[ ! -f "${NETCONS_PATH}/userdata/release_enabled" ]]
58 if [[ ! -f "${NETCONS_PATH}/userdata/msgid_enabled" ]]
85 # Test if MSG contains sysdata
88 # 6.11.1-0_fbk0_rc13_509_g30d75cea12f7,13,1822,115075213798,-;netconsole selftest: netcons_gtJHM
90 # cpu=X
94 # Echo is what this test uses to create the message. See runtest()
98 if [ ! -f "$OUTPUT_FILE" ]; then
103 if ! grep -q "${MSG}" "${OUTPUT_FILE}"; then
109 # Check if cpu=XX exists in the file and matches the one used
111 if ! grep -q "cpu=${CPU}\+" "${OUTPUT_FILE}"; then
112 echo "FAIL: 'cpu=${CPU}' not found in ${OUTPUT_FILE}" >&2
117 if ! grep -q "taskname=${SENDER}" "${OUTPUT_FILE}"; then
123 if ! grep -q "msgid=[0-9]\+$" "${OUTPUT_FILE}"; then
134 RELEASE=$(uname -r)
136 if [ ! -f "$OUTPUT_FILE" ]; then
141 if ! grep -q "release=${RELEASE}" "${OUTPUT_FILE}"; then
148 # Test if MSG content exists in OUTPUT_FILE but no `cpu=` and `taskname=`
151 if [ ! -f "$OUTPUT_FILE" ]; then
156 if ! grep -q "${MSG}" "${OUTPUT_FILE}"; then
162 if grep -q "cpu=" "${OUTPUT_FILE}"; then
163 echo "FAIL: 'cpu= found in ${OUTPUT_FILE}" >&2
168 if grep -q "taskname=" "${OUTPUT_FILE}"; then
174 if grep -q "release=" "${OUTPUT_FILE}"; then
180 if grep -q "msgid=" "${OUTPUT_FILE}"; then
198 taskset -c "${CPU}" echo "${MSG}: ${TARGET}" > /dev/kmsg
200 busywait "${BUSYWAIT_TIMEOUT}" test -s "${OUTPUT_FILE}"
212 # This test also depends on taskset(1). Check for it before starting the test
225 # TEST #1
226 # Send message from a random CPU
228 # Random CPU in the system
229 CPU=$((RANDOM % $(nproc)))
231 MSG="Test #1 from CPU${CPU}"
245 # TEST #2
246 # This test now adds userdata together with sysdata
248 # Get a new random CPU
249 CPU=$((RANDOM % $(nproc)))
251 MSG="Test #2 from CPU${CPU}"
258 # TEST #3
261 CPU=$((RANDOM % $(nproc)))
263 MSG="Test #3 from CPU${CPU}"
269 # At this time, cpu= shouldn't be present in the msg