History log of /openbmc/bmcweb/test/redfish-core/include/redfish_test.cpp (Results 1 – 3 of 3)
Revision Date Author Comments
# 9838eb20 29-Jan-2025 Ed Tanous <etanous@nvidia.com>

Move io context to singleton

The way we pass around io contexts is somewhat odd. Boost maintainers
in slack recommended that we just have a method that returns an io
context, and from there we can

Move io context to singleton

The way we pass around io contexts is somewhat odd. Boost maintainers
in slack recommended that we just have a method that returns an io
context, and from there we can control this (context link lost years
ago).

The new version of clang claims the singleton pattern of passing in an
io_context pattern is a potential nullptr dereference. It's technically
correct, as calling the singleton without immediately initializing the
io context will lead to a crash.

This commit implements what the boost maintainers suggested, having a
single method that returns "the context" that should be used. This also
helps to maintain isolation, as some pieces are no longer tied directly
to dbus to get their reactor.

Tested: WIP

Change-Id: Ifaa11335ae00a3d092ecfdfb26a38380227e8576
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# e9f12014 08-Oct-2024 Ed Tanous <etanous@nvidia.com>

Add unit test for trailing slashes

Common error #9 requires that most urls end in a trailing slash. Given
the redfish standard, we know that all redfish routes need to end in a
trailing slash, so w

Add unit test for trailing slashes

Common error #9 requires that most urls end in a trailing slash. Given
the redfish standard, we know that all redfish routes need to end in a
trailing slash, so write a unit test that verifies that is true.

Despite code review, this appears to have snuck into the codebase in 4
different handlers. Fix those at the same time so the tests pass.

Tested: Unit tests pass.

Change-Id: I0299a7231662725a7100d5308b3977a549b49253
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# 15b6f9f9 30-May-2024 Ed Tanous <ed@tanous.net>

Write test to ensure that redfish validates

Dependent on configuration options, we might have overlapping paths, as
what had to be fixed in:
36a59eafed32c0063d444fc0722f899c0024092d
and
5ffd11f248f1

Write test to ensure that redfish validates

Dependent on configuration options, we might have overlapping paths, as
what had to be fixed in:
36a59eafed32c0063d444fc0722f899c0024092d
and
5ffd11f248f155614bf30b498cb01a4e2065094d

We should be able to catch these in a unit test, so this commit adds a
test that initializes the Redfish tree, and ensures that the router
validates. In theory this will catch any misconfigurations we might
have.

Tested: Unit tests pass.

Change-Id: I8721380c96301b57e40819f5ae2e725057ea1bb7
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...