| | |
| | | |
| | | #include <licensecc_properties.h> |
| | | #include <licensecc_properties_test.h> |
| | | #include "../../src/library/base/StringUtils.h" |
| | | #include "../../src/library/os/network.hpp" |
| | | #include "../../src/library/os/execution_environment.hpp" |
| | | #include "../../../src/library/base/string_utils.h" |
| | | #include "../../../src/library/os/network.hpp" |
| | | #include "../../../src/library/os/execution_environment.hpp" |
| | | |
| | | namespace license { |
| | | namespace os { |
| | |
| | | |
| | | BOOST_AUTO_TEST_CASE(read_network_adapters) { |
| | | std::vector<license::os::OsAdapterInfo> adapters; |
| | | // we can suppose every test environment other than docker has at least one network interface (it's hard to |
| | | // download this source code) |
| | | // we can suppose every test environment other than docker has at least |
| | | // one network interface |
| | | FUNCTION_RETURN result = getAdapterInfos(adapters); |
| | | ExecutionEnvironment exec_env; |
| | | if (result != FUNC_RET_OK && exec_env.is_docker()) { |
| | | BOOST_TEST_INFO("detected docker environment, not having network interfaces is normal here"); |
| | | BOOST_TEST_MESSAGE("detected docker environment, not having network interfaces is normal here"); |
| | | return; |
| | | } |
| | | BOOST_CHECK_EQUAL(result, FUNC_RET_OK); |
| | | BOOST_CHECK_GT(adapters.size(),0); |
| | | for (auto& it : adapters) { |
| | | cout << "Interface found: " << string(it.description) << endl; |
| | | BOOST_CHECK_GT(strlen(it.description), 0); |