mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
selftests/cpu-hotplug: Delete fault injection related code
[ Upstream commit195d74be71
] Delete fault injection related code since the module has been deleted. Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Stable-dep-of:51d4c85146
("selftests/cpu-hotplug: Reserve one cpu online at least") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c5cc950103
commit
42058240cd
2 changed files with 6 additions and 82 deletions
|
@ -1 +0,0 @@
|
||||||
CONFIG_NOTIFIER_ERROR_INJECTION=y
|
|
|
@ -116,10 +116,10 @@ online_cpu_expect_fail()
|
||||||
|
|
||||||
if online_cpu $cpu 2> /dev/null; then
|
if online_cpu $cpu 2> /dev/null; then
|
||||||
echo $FUNCNAME $cpu: unexpected success >&2
|
echo $FUNCNAME $cpu: unexpected success >&2
|
||||||
exit 1
|
retval=1
|
||||||
elif ! cpu_is_offline $cpu; then
|
elif ! cpu_is_offline $cpu; then
|
||||||
echo $FUNCNAME $cpu: unexpected online >&2
|
echo $FUNCNAME $cpu: unexpected online >&2
|
||||||
exit 1
|
retval=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,16 +142,14 @@ offline_cpu_expect_fail()
|
||||||
|
|
||||||
if offline_cpu $cpu 2> /dev/null; then
|
if offline_cpu $cpu 2> /dev/null; then
|
||||||
echo $FUNCNAME $cpu: unexpected success >&2
|
echo $FUNCNAME $cpu: unexpected success >&2
|
||||||
exit 1
|
retval=1
|
||||||
elif ! cpu_is_online $cpu; then
|
elif ! cpu_is_online $cpu; then
|
||||||
echo $FUNCNAME $cpu: unexpected offline >&2
|
echo $FUNCNAME $cpu: unexpected offline >&2
|
||||||
exit 1
|
retval=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
error=-12
|
|
||||||
allcpus=0
|
allcpus=0
|
||||||
priority=0
|
|
||||||
online_cpus=0
|
online_cpus=0
|
||||||
online_max=0
|
online_max=0
|
||||||
offline_cpus=0
|
offline_cpus=0
|
||||||
|
@ -159,31 +157,20 @@ offline_max=0
|
||||||
present_cpus=0
|
present_cpus=0
|
||||||
present_max=0
|
present_max=0
|
||||||
|
|
||||||
while getopts e:ahp: opt; do
|
while getopts ah opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
e)
|
|
||||||
error=$OPTARG
|
|
||||||
;;
|
|
||||||
a)
|
a)
|
||||||
allcpus=1
|
allcpus=1
|
||||||
;;
|
;;
|
||||||
h)
|
h)
|
||||||
echo "Usage $0 [ -a ] [ -e errno ] [ -p notifier-priority ]"
|
echo "Usage $0 [ -a ]"
|
||||||
echo -e "\t default offline one cpu"
|
echo -e "\t default offline one cpu"
|
||||||
echo -e "\t run with -a option to offline all cpus"
|
echo -e "\t run with -a option to offline all cpus"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
p)
|
|
||||||
priority=$OPTARG
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! [ "$error" -ge -4095 -a "$error" -lt 0 ]; then
|
|
||||||
echo "error code must be -4095 <= errno < 0" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
prerequisite
|
prerequisite
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -231,66 +218,4 @@ for cpu in `hotplaggable_offline_cpus`; do
|
||||||
online_cpu_expect_success $cpu
|
online_cpu_expect_success $cpu
|
||||||
done
|
done
|
||||||
|
|
||||||
#
|
|
||||||
# Test with cpu notifier error injection
|
|
||||||
#
|
|
||||||
|
|
||||||
DEBUGFS=`mount -t debugfs | head -1 | awk '{ print $3 }'`
|
|
||||||
NOTIFIER_ERR_INJECT_DIR=$DEBUGFS/notifier-error-inject/cpu
|
|
||||||
|
|
||||||
prerequisite_extra()
|
|
||||||
{
|
|
||||||
msg="skip extra tests:"
|
|
||||||
|
|
||||||
/sbin/modprobe -q -r cpu-notifier-error-inject
|
|
||||||
/sbin/modprobe -q cpu-notifier-error-inject priority=$priority
|
|
||||||
|
|
||||||
if [ ! -d "$DEBUGFS" ]; then
|
|
||||||
echo $msg debugfs is not mounted >&2
|
|
||||||
exit $ksft_skip
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $NOTIFIER_ERR_INJECT_DIR ]; then
|
|
||||||
echo $msg cpu-notifier-error-inject module is not available >&2
|
|
||||||
exit $ksft_skip
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
prerequisite_extra
|
|
||||||
|
|
||||||
#
|
|
||||||
# Offline all hot-pluggable CPUs
|
|
||||||
#
|
|
||||||
echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_DOWN_PREPARE/error
|
|
||||||
for cpu in `hotpluggable_online_cpus`; do
|
|
||||||
offline_cpu_expect_success $cpu
|
|
||||||
done
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test CPU hot-add error handling (offline => online)
|
|
||||||
#
|
|
||||||
echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_UP_PREPARE/error
|
|
||||||
for cpu in `hotplaggable_offline_cpus`; do
|
|
||||||
online_cpu_expect_fail $cpu
|
|
||||||
done
|
|
||||||
|
|
||||||
#
|
|
||||||
# Online all hot-pluggable CPUs
|
|
||||||
#
|
|
||||||
echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_UP_PREPARE/error
|
|
||||||
for cpu in `hotplaggable_offline_cpus`; do
|
|
||||||
online_cpu_expect_success $cpu
|
|
||||||
done
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test CPU hot-remove error handling (online => offline)
|
|
||||||
#
|
|
||||||
echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_DOWN_PREPARE/error
|
|
||||||
for cpu in `hotpluggable_online_cpus`; do
|
|
||||||
offline_cpu_expect_fail $cpu
|
|
||||||
done
|
|
||||||
|
|
||||||
echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_DOWN_PREPARE/error
|
|
||||||
/sbin/modprobe -q -r cpu-notifier-error-inject
|
|
||||||
|
|
||||||
exit $retval
|
exit $retval
|
||||||
|
|
Loading…
Reference in a new issue