To prevent core dump file generation, the new functions allow to clear and restore the /proc/sys/kernel/core_pattern definition.
Reviewed-by: Michael Mueller <m...@linux.vnet.ibm.com> Signed-off-by: Mao Chuan Li <maoch...@linux.vnet.ibm.com> --- tests/qemu-iotests/common.rc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 9c49deb..87edf36 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -478,5 +478,22 @@ _die() exit 1 } +core_pattern_file="/proc/sys/kernel/core_pattern" + +_erase_core_pattern() +{ + saved_pattern=$(cat $core_pattern_file) + + echo > "$core_pattern_file" + if [ $? != 0 ]; then + exit 1 + fi +} + +_restore_core_pattern() +{ + echo $saved_pattern > $core_pattern_file +} + # make sure this script returns success /bin/true -- 1.9.3