1 // Copyright 2023 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #include "commands.hpp" 16 #include "handler_mock.hpp" 17 #include "helper.hpp" 18 #include "linux_boot_done.hpp" 19 20 #include <vector> 21 22 #include <gtest/gtest.h> 23 24 using ::testing::Return; 25 26 namespace google 27 { 28 namespace ipmi 29 { 30 31 TEST(LinuxBootDoneCommandTest, ValidResponseTest) 32 { 33 std::vector<std::uint8_t> request = {}; 34 35 HandlerMock hMock; 36 EXPECT_CALL(hMock, linuxBootDone()).Times(1); 37 38 auto reply = linuxBootDone(request, &hMock); 39 auto result = ValidateReply(reply, false); 40 auto& data = result.second; 41 42 EXPECT_EQ(0, data.size()); 43 EXPECT_EQ(SysOEMCommands::SysLinuxBootDone, result.first); 44 } 45 46 } // namespace ipmi 47 } // namespace google 48