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