pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
crm_meta_name_test.c
Go to the documentation of this file.
1/*
2 * Copyright 2022-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
13#include <crm/common/xml.h>
14
15static void
16empty_params(void **state)
17{
19}
20
21static void
22standard_usage(void **state)
23{
24 char *s = NULL;
25
27 assert_string_equal(s, "CRM_meta_notify");
28 free(s);
29
31 assert_string_equal(s, "CRM_meta_resource_stickiness");
32 free(s);
33
34 s = crm_meta_name("blah");
35 assert_string_equal(s, "CRM_meta_blah");
36 free(s);
37}
38
39PCMK__UNIT_TEST(NULL, NULL,
40 cmocka_unit_test(empty_params),
41 cmocka_unit_test(standard_usage))
char * crm_meta_name(const char *field)
Get the environment variable equivalent of a meta-attribute name.
Definition nvpair.c:525
#define PCMK_META_RESOURCE_STICKINESS
Definition options.h:112
#define PCMK_META_NOTIFY
Definition options.h:98
#define pcmk__assert_asserts(stmt)
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
Wrappers for and extensions to libxml2.