summaryrefslogtreecommitdiffstats
path: root/lib/pengine/tests/status
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/pengine/tests/status/Makefile.am12
-rw-r--r--lib/pengine/tests/status/pe_find_node_any_test.c6
-rw-r--r--lib/pengine/tests/status/pe_find_node_id_test.c6
-rw-r--r--lib/pengine/tests/status/pe_find_node_test.c6
-rw-r--r--lib/pengine/tests/status/pe_new_working_set_test.c10
-rw-r--r--lib/pengine/tests/status/set_working_set_defaults_test.c27
6 files changed, 35 insertions, 32 deletions
diff --git a/lib/pengine/tests/status/Makefile.am b/lib/pengine/tests/status/Makefile.am
index 3f95496..c7ddb70 100644
--- a/lib/pengine/tests/status/Makefile.am
+++ b/lib/pengine/tests/status/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2022 the Pacemaker project contributors
+# Copyright 2022-2023 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
@@ -13,10 +13,10 @@ include $(top_srcdir)/mk/unittest.mk
LDADD += $(top_builddir)/lib/pengine/libpe_status_test.la
# Add "_test" to the end of all test program names to simplify .gitignore.
-check_PROGRAMS = pe_find_node_any_test \
- pe_find_node_id_test \
- pe_find_node_test \
- pe_new_working_set_test \
- set_working_set_defaults_test
+check_PROGRAMS = pe_find_node_any_test \
+ pe_find_node_id_test \
+ pe_find_node_test \
+ pe_new_working_set_test \
+ set_working_set_defaults_test
TESTS = $(check_PROGRAMS)
diff --git a/lib/pengine/tests/status/pe_find_node_any_test.c b/lib/pengine/tests/status/pe_find_node_any_test.c
index b911424..5f5a27e 100644
--- a/lib/pengine/tests/status/pe_find_node_any_test.c
+++ b/lib/pengine/tests/status/pe_find_node_any_test.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 the Pacemaker project contributors
+ * Copyright 2022-2023 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -24,8 +24,8 @@ static void
non_null_list(void **state) {
GList *nodes = NULL;
- pe_node_t *a = calloc(1, sizeof(pe_node_t));
- pe_node_t *b = calloc(1, sizeof(pe_node_t));
+ pcmk_node_t *a = calloc(1, sizeof(pcmk_node_t));
+ pcmk_node_t *b = calloc(1, sizeof(pcmk_node_t));
a->details = calloc(1, sizeof(struct pe_node_shared_s));
a->details->uname = "cluster1";
diff --git a/lib/pengine/tests/status/pe_find_node_id_test.c b/lib/pengine/tests/status/pe_find_node_id_test.c
index 832a40a..c6b8773 100644
--- a/lib/pengine/tests/status/pe_find_node_id_test.c
+++ b/lib/pengine/tests/status/pe_find_node_id_test.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 the Pacemaker project contributors
+ * Copyright 2022-2023 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -22,8 +22,8 @@ static void
non_null_list(void **state) {
GList *nodes = NULL;
- pe_node_t *a = calloc(1, sizeof(pe_node_t));
- pe_node_t *b = calloc(1, sizeof(pe_node_t));
+ pcmk_node_t *a = calloc(1, sizeof(pcmk_node_t));
+ pcmk_node_t *b = calloc(1, sizeof(pcmk_node_t));
a->details = calloc(1, sizeof(struct pe_node_shared_s));
a->details->id = "id1";
diff --git a/lib/pengine/tests/status/pe_find_node_test.c b/lib/pengine/tests/status/pe_find_node_test.c
index 7c7ea30..305ddc9 100644
--- a/lib/pengine/tests/status/pe_find_node_test.c
+++ b/lib/pengine/tests/status/pe_find_node_test.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 the Pacemaker project contributors
+ * Copyright 2022-2023 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -22,8 +22,8 @@ static void
non_null_list(void **state) {
GList *nodes = NULL;
- pe_node_t *a = calloc(1, sizeof(pe_node_t));
- pe_node_t *b = calloc(1, sizeof(pe_node_t));
+ pcmk_node_t *a = calloc(1, sizeof(pcmk_node_t));
+ pcmk_node_t *b = calloc(1, sizeof(pcmk_node_t));
a->details = calloc(1, sizeof(struct pe_node_shared_s));
a->details->uname = "cluster1";
diff --git a/lib/pengine/tests/status/pe_new_working_set_test.c b/lib/pengine/tests/status/pe_new_working_set_test.c
index cf2df4f..b385f9c 100644
--- a/lib/pengine/tests/status/pe_new_working_set_test.c
+++ b/lib/pengine/tests/status/pe_new_working_set_test.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 the Pacemaker project contributors
+ * Copyright 2022-2023 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -19,7 +19,7 @@ calloc_fails(void **state) {
pcmk__mock_calloc = true; // calloc() will return NULL
expect_value(__wrap_calloc, nmemb, 1);
- expect_value(__wrap_calloc, size, sizeof(pe_working_set_t));
+ expect_value(__wrap_calloc, size, sizeof(pcmk_scheduler_t));
assert_null(pe_new_working_set());
pcmk__mock_calloc = false; // Use real calloc()
@@ -27,18 +27,18 @@ calloc_fails(void **state) {
static void
calloc_succeeds(void **state) {
- pe_working_set_t *data_set = pe_new_working_set();
+ pcmk_scheduler_t *scheduler = pe_new_working_set();
/* Nothing else to test about this function, as all it does is call
* set_working_set_defaults which is also a public function and should
* get its own unit test.
*/
- assert_non_null(data_set);
+ assert_non_null(scheduler);
/* Avoid calling pe_free_working_set here so we don't artificially
* inflate the coverage numbers.
*/
- free(data_set);
+ free(scheduler);
}
PCMK__UNIT_TEST(NULL, NULL,
diff --git a/lib/pengine/tests/status/set_working_set_defaults_test.c b/lib/pengine/tests/status/set_working_set_defaults_test.c
index c822278..7045a33 100644
--- a/lib/pengine/tests/status/set_working_set_defaults_test.c
+++ b/lib/pengine/tests/status/set_working_set_defaults_test.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 the Pacemaker project contributors
+ * Copyright 2023 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -10,8 +10,9 @@
#include <crm_internal.h>
#include <crm/common/unittest_internal.h>
+
+#include <crm/common/scheduler.h>
#include <crm/pengine/internal.h>
-#include <crm/pengine/pe_types.h>
#include <crm/pengine/status.h>
#include "mock_private.h"
@@ -19,27 +20,29 @@
static void
check_defaults(void **state) {
uint32_t flags;
- pe_working_set_t *data_set = calloc(1, sizeof(pe_working_set_t));
+ pcmk_scheduler_t *scheduler = calloc(1, sizeof(pcmk_scheduler_t));
- set_working_set_defaults(data_set);
+ set_working_set_defaults(scheduler);
- flags = pe_flag_stop_rsc_orphans|pe_flag_symmetric_cluster|pe_flag_stop_action_orphans;
+ flags = pcmk_sched_symmetric_cluster
+ |pcmk_sched_stop_removed_resources
+ |pcmk_sched_cancel_removed_actions;
if (!strcmp(PCMK__CONCURRENT_FENCING_DEFAULT, "true")) {
- flags |= pe_flag_concurrent_fencing;
+ flags |= pcmk_sched_concurrent_fencing;
}
- assert_null(data_set->priv);
- assert_int_equal(data_set->order_id, 1);
- assert_int_equal(data_set->action_id, 1);
- assert_int_equal(data_set->no_quorum_policy, no_quorum_stop);
- assert_int_equal(data_set->flags, flags);
+ assert_null(scheduler->priv);
+ assert_int_equal(scheduler->order_id, 1);
+ assert_int_equal(scheduler->action_id, 1);
+ assert_int_equal(scheduler->no_quorum_policy, pcmk_no_quorum_stop);
+ assert_int_equal(scheduler->flags, flags);
/* Avoid calling pe_free_working_set here so we don't artificially
* inflate the coverage numbers.
*/
- free(data_set);
+ free(scheduler);
}
PCMK__UNIT_TEST(NULL, NULL,