| #include "processor.hpp" |
| #include "async_resp.hpp" |
| #include "dbus_utility.hpp" |
| #include "snapshot_fixture.hpp" |
| |
| #include <nlohmann/json.hpp> |
| #include <gmock/gmock.h> |
| #include <gtest/gtest.h> |
| |
| namespace redfish |
| { |
| namespace |
| { |
| |
| using ::dbus::utility::MapperGetSubTreePathsResponse; |
| using ::dbus::utility::MapperGetSubTreeResponse; |
| using ::managedStore::KeyType; |
| using ::managedStore::ManagedType; |
| using ::managedStore::ValueType; |
| |
| |
| |
| TEST_F(SnapshotFixture_Platform5_Config0, GetProcessorTest) { |
| handleProcessorGet(app_, CreateRequest(), share_async_resp_, "system", "cpu0"); |
| |
| RunIoUntilDone(); |
| |
| nlohmann::json& json = share_async_resp_->res.jsonValue; |
| |
| EXPECT_EQ(json["@odata.id"].get<std::string>(), "/redfish/v1/Systems/system/Processors/cpu0"); |
| EXPECT_EQ(json["Name"].get<std::string>(), "Processor"); |
| EXPECT_EQ(json["Id"].get<std::string>(), "cpu0"); |
| |
| // cores and threads |
| EXPECT_EQ(json["TotalCores"].get<int>(), 128); |
| EXPECT_EQ(json["TotalThreads"].get<int>(), 256); |
| EXPECT_EQ(json["TotalEnabledCores"].get<int>(), 128); |
| EXPECT_EQ(share_async_resp_->res.result(), boost::beast::http::status::ok); |
| } |
| |
| |
| } // namespace |
| } // namespace redfish |