diff options
author | Nan Zhou <nanzhoumails@gmail.com> | 2022-03-23 19:13:46 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-03-29 04:56:21 +0300 |
commit | 9629907de7880c0853bb4d5b9c624c452a598861 (patch) | |
tree | 889c8359074c274b72692bd09e58786b3f9bbb5d /redfish-core/lib/ut | |
parent | 7772638ea777820234e6004ee63dc558e629e35e (diff) | |
download | bmcweb-9629907de7880c0853bb4d5b9c624c452a598861.tar.xz |
service root: add ProtocolFeaturesSupported
This commits adds a dummy ProtocolFeaturesSupported object in the
service root. It indicates that none of the Query Parameter is
supported. Future commits will add supports for OnlyMemberQuery,
ExpandQuery, and so on.
Tested:
1. unit test
2. passed QEMU Redfish (which contains Redfish Validator) test
This commit is split from these changes:
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/38952
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/47474
Credits to maxiaochao@inspur.com, ed@tanous.net, and
zhanghch05@inspur.com.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I81ff856514528f63a462558a8f18fefe4369edae
Diffstat (limited to 'redfish-core/lib/ut')
-rw-r--r-- | redfish-core/lib/ut/service_root_test.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/redfish-core/lib/ut/service_root_test.cpp b/redfish-core/lib/ut/service_root_test.cpp index 9e6c423215..61b0d02f9a 100644 --- a/redfish-core/lib/ut/service_root_test.cpp +++ b/redfish-core/lib/ut/service_root_test.cpp @@ -7,6 +7,7 @@ #include <string> #include "gmock/gmock.h" +#include "gtest/gtest.h" static void assertServiceRootGet(crow::Response& res) { @@ -63,7 +64,23 @@ static void assertServiceRootGet(crow::Response& res) "9a-fA-F]{4}-[0-9a-fA-F]{12}")); EXPECT_EQ(json["UpdateService"]["@odata.id"], "/redfish/v1/UpdateService"); - EXPECT_EQ(20, json.size()); + + EXPECT_EQ(json["ProtocolFeaturesSupported"].size(), 6); + EXPECT_FALSE(json["ProtocolFeaturesSupported"]["ExcerptQuery"]); + EXPECT_FALSE(json["ProtocolFeaturesSupported"]["ExpandQuery"]["ExpandAll"]); + EXPECT_FALSE(json["ProtocolFeaturesSupported"]["ExpandQuery"]["Levels"]); + EXPECT_FALSE(json["ProtocolFeaturesSupported"]["ExpandQuery"]["Links"]); + EXPECT_FALSE(json["ProtocolFeaturesSupported"]["ExpandQuery"]["NoLinks"]); + EXPECT_EQ(json["ProtocolFeaturesSupported"]["ExpandQuery"].size(), 4); + EXPECT_FALSE(json["ProtocolFeaturesSupported"]["FilterQuery"]); + EXPECT_FALSE(json["ProtocolFeaturesSupported"]["OnlyMemberQuery"]); + EXPECT_FALSE(json["ProtocolFeaturesSupported"]["SelectQuery"]); + EXPECT_FALSE( + json["ProtocolFeaturesSupported"]["DeepOperations"]["DeepPOST"]); + EXPECT_FALSE( + json["ProtocolFeaturesSupported"]["DeepOperations"]["DeepPATCH"]); + EXPECT_EQ(json["ProtocolFeaturesSupported"]["DeepOperations"].size(), 2); + EXPECT_EQ(json.size(), 21); } TEST(ServiceRootTest, ServiceRootConstructor) |