pacemaker 2.1.8-2.1.8
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
pcmk_resource_is_managed_test.c
Go to the documentation of this file.
1/*
2 * Copyright 2024 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU General Public License version 2
7 * or later (GPLv2+) WITHOUT ANY WARRANTY.
8 */
9
10#include <crm_internal.h>
11
12#include <stdio.h> // NULL
13
16
17static void
18null_resource(void **state)
19{
20 assert_false(pcmk_resource_is_managed(NULL));
21}
22
23static void
24resource_is_managed(void **state)
25{
28 };
29
30 assert_true(pcmk_resource_is_managed(&rsc1));
31}
32
33static void
34resource_is_not_managed(void **state)
35{
37 .flags = 0,
38 };
39
40 assert_false(pcmk_resource_is_managed(&rsc1));
41}
42
43PCMK__UNIT_TEST(NULL, NULL,
44 cmocka_unit_test(null_resource),
45 cmocka_unit_test(resource_is_managed),
46 cmocka_unit_test(resource_is_not_managed))
pcmk_resource_t rsc1
Scheduler API for resources.
@ pcmk_rsc_managed
Definition resources.h:88
bool pcmk_resource_is_managed(const pcmk_resource_t *rsc)
Definition resources.c:41
unsigned long long flags
Definition resources.h:428
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)