Deepak Kodihalli | 834dcf1 | 2018-08-30 05:05:46 -0500 | [diff] [blame] | 1 | #include "remote_logging_tests.hpp" |
| 2 | #include "xyz/openbmc_project/Common/error.hpp" |
| 3 | |
| 4 | namespace phosphor |
| 5 | { |
| 6 | namespace logging |
| 7 | { |
| 8 | namespace test |
| 9 | { |
| 10 | |
| 11 | using namespace sdbusplus::xyz::openbmc_project::Common::Error; |
| 12 | |
| 13 | TEST_F(TestRemoteLogging, testGoodAddress) |
| 14 | { |
| 15 | config->address("1.1.1.1"); |
| 16 | EXPECT_EQ(config->address(), "1.1.1.1"); |
Lei YU | a1c4338 | 2021-04-15 20:26:25 +0800 | [diff] [blame] | 17 | |
| 18 | config->address("abcd:ef01::01"); |
| 19 | EXPECT_EQ(config->address(), "abcd:ef01::01"); |
Deepak Kodihalli | 834dcf1 | 2018-08-30 05:05:46 -0500 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | TEST_F(TestRemoteLogging, testBadAddress) |
| 23 | { |
Andrew Geissler | 27e9f13 | 2020-03-30 15:35:56 -0500 | [diff] [blame] | 24 | EXPECT_THROW(config->address("this is not_an_IP!"), InvalidArgument); |
Deepak Kodihalli | 834dcf1 | 2018-08-30 05:05:46 -0500 | [diff] [blame] | 25 | } |
| 26 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 27 | } // namespace test |
| 28 | } // namespace logging |
| 29 | } // namespace phosphor |