pacemaker 3.0.1-16e74fc4da
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{
26 pcmk_resource_t rsc1 = {
27 .flags = pcmk__rsc_managed,
28 };
29
30 assert_true(pcmk_resource_is_managed(&rsc1));
31}
32
33static void
34resource_is_not_managed(void **state)
35{
36 pcmk_resource_t rsc1 = {
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))
Scheduler API for resources.
bool pcmk_resource_is_managed(const pcmk_resource_t *rsc)
Definition resources.c:57
@ pcmk__rsc_managed
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)