1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 2f08c3bdfSopenharmony_ci/* 3f08c3bdfSopenharmony_ci * Copyright (c) 2021, BELLSOFT. All rights reserved. 4f08c3bdfSopenharmony_ci * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. 5f08c3bdfSopenharmony_ci * AUTHOR: Saji Kumar.V.R <saji.kumar@wipro.com> 6f08c3bdfSopenharmony_ci */ 7f08c3bdfSopenharmony_ci 8f08c3bdfSopenharmony_ci/*\ 9f08c3bdfSopenharmony_ci * [Description] 10f08c3bdfSopenharmony_ci * 11f08c3bdfSopenharmony_ci * Basic test for sched_setparam(2) 12f08c3bdfSopenharmony_ci * 13f08c3bdfSopenharmony_ci * Call sched_setparam(2) with pid=0 so that it will 14f08c3bdfSopenharmony_ci * set the scheduling parameters for the calling process 15f08c3bdfSopenharmony_ci */ 16f08c3bdfSopenharmony_ci 17f08c3bdfSopenharmony_ci#include "tst_test.h" 18f08c3bdfSopenharmony_ci#include "tst_sched.h" 19f08c3bdfSopenharmony_ci 20f08c3bdfSopenharmony_cistatic void run(void) 21f08c3bdfSopenharmony_ci{ 22f08c3bdfSopenharmony_ci struct sched_variant *tv = &sched_variants[tst_variant]; 23f08c3bdfSopenharmony_ci struct sched_param p = { .sched_priority = 0 }; 24f08c3bdfSopenharmony_ci 25f08c3bdfSopenharmony_ci TST_EXP_PASS(tv->sched_setparam(0, &p), "sched_setparam(0, 0)"); 26f08c3bdfSopenharmony_ci} 27f08c3bdfSopenharmony_ci 28f08c3bdfSopenharmony_cistatic void setup(void) 29f08c3bdfSopenharmony_ci{ 30f08c3bdfSopenharmony_ci tst_res(TINFO, "Testing %s variant", sched_variants[tst_variant].desc); 31f08c3bdfSopenharmony_ci} 32f08c3bdfSopenharmony_ci 33f08c3bdfSopenharmony_cistatic struct tst_test test = { 34f08c3bdfSopenharmony_ci .setup = setup, 35f08c3bdfSopenharmony_ci .test_variants = ARRAY_SIZE(sched_variants), 36f08c3bdfSopenharmony_ci .test_all = run, 37f08c3bdfSopenharmony_ci}; 38