1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 2f08c3bdfSopenharmony_ci/* 3f08c3bdfSopenharmony_ci * Copyright (c) 2018, Linux Test Project 4f08c3bdfSopenharmony_ci */ 5f08c3bdfSopenharmony_ci 6f08c3bdfSopenharmony_ci#include <stdlib.h> 7f08c3bdfSopenharmony_ci#include <unistd.h> 8f08c3bdfSopenharmony_ci#include "tst_test.h" 9f08c3bdfSopenharmony_ci#include "tst_sys_conf.h" 10f08c3bdfSopenharmony_ci 11f08c3bdfSopenharmony_cistatic void setup(void) 12f08c3bdfSopenharmony_ci{ 13f08c3bdfSopenharmony_ci SAFE_FILE_PRINTF("/proc/sys/kernel/core_pattern", "changed"); 14f08c3bdfSopenharmony_ci tst_sys_conf_dump(); 15f08c3bdfSopenharmony_ci} 16f08c3bdfSopenharmony_ci 17f08c3bdfSopenharmony_cistatic void run(void) 18f08c3bdfSopenharmony_ci{ 19f08c3bdfSopenharmony_ci tst_res(TPASS, "OK"); 20f08c3bdfSopenharmony_ci} 21f08c3bdfSopenharmony_ci 22f08c3bdfSopenharmony_cistatic struct tst_test test = { 23f08c3bdfSopenharmony_ci .needs_root = 1, 24f08c3bdfSopenharmony_ci .test_all = run, 25f08c3bdfSopenharmony_ci .setup = setup, 26f08c3bdfSopenharmony_ci .save_restore = (const struct tst_path_val[]) { 27f08c3bdfSopenharmony_ci {"/proc/nonexistent", NULL, TST_SR_SKIP}, 28f08c3bdfSopenharmony_ci {"/proc/sys/kernel/numa_balancing", NULL, TST_SR_TBROK}, 29f08c3bdfSopenharmony_ci {"/proc/sys/kernel/core_pattern", NULL, TST_SR_TCONF}, 30f08c3bdfSopenharmony_ci {} 31f08c3bdfSopenharmony_ci }, 32f08c3bdfSopenharmony_ci}; 33