summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Stapp <mjs.ietf@gmail.com>2025-04-16 07:44:05 -0400
committerGitHub <noreply@github.com>2025-04-16 07:44:05 -0400
commita16024bd8c1f9986ea0f58923462b134dfec5695 (patch)
tree1c0d4a0055d79ce26404dc319f07b60c9b0d0bc9
parent872ace0f0711eb7b7e2272cdd087b77e5af81439 (diff)
parent452d71cd96e242caae2bc141362efa746e15414c (diff)
Merge pull request #18666 from FRRouting/mergify/bp/stable/10.3/pr-18662
tests: Fix northbound endian use in a unit-test (backport #18662)
-rw-r--r--tests/.gitignore1
-rw-r--r--tests/lib/northbound/test_oper_data.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
index 681438f4a5..51909cd81d 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -22,6 +22,7 @@ frr_northbound*
/lib/cli/test_commands
/lib/cli/test_commands_defun.c
/lib/northbound/test_oper_data
+/lib/northbound/test_oper_exists
/lib/cxxcompat
/lib/fuzz_zlog
/lib/test_assert
diff --git a/tests/lib/northbound/test_oper_data.c b/tests/lib/northbound/test_oper_data.c
index 0b334c6522..f66b78d14f 100644
--- a/tests/lib/northbound/test_oper_data.c
+++ b/tests/lib/northbound/test_oper_data.c
@@ -253,9 +253,10 @@ static enum nb_error frr_test_module_c2cont_c2value_get(const struct nb_node *nb
struct lyd_node *parent)
{
const struct lysc_node *snode = nb_node->snode;
- uint32_t value = 0xAB010203;
+ uint32_t value = htole32(0xAB010203);
LY_ERR err;
+ /* Note that this api expects 'value' to be in little-endian form */
err = lyd_new_term_bin(parent, snode->module, snode->name, &value, sizeof(value),
LYD_NEW_PATH_UPDATE, NULL);
assert(err == LY_SUCCESS);