| #include "port_metrics.hpp" |
| |
| #include <gtest/gtest.h> |
| #include "http_response.hpp" |
| #include "test/redfish-core/lib/snapshot_fixture.hpp" |
| #include <nlohmann/json.hpp> |
| |
| namespace redfish { |
| namespace { |
| |
| TEST_F(SnapshotFixture, GetDedicatedNetworkPortsReturnsCorrectResponse) { |
| handleDedicatedNetworkPortMetricsGet(app_, CreateRequest(), share_async_resp_, |
| "eth1"); |
| |
| RunIoUntilDone(); |
| |
| nlohmann::json& json = share_async_resp_->res.jsonValue; |
| EXPECT_EQ(json["@odata.id"], |
| "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1/Metrics"); |
| EXPECT_EQ(json["@odata.type"], "#PortMetrics.v1_3_0.PortMetrics"); |
| EXPECT_EQ(json["Name"], "eth1 Metrics"); |
| EXPECT_EQ(json["Id"], "Metrics"); |
| EXPECT_EQ(json["Networking"]["RXDiscards"], 0); |
| EXPECT_EQ(json["Networking"]["TXDiscards"], 0); |
| } |
| |
| } // namespace |
| } // namespace redfish |