Add test for interface IP detection tools

This commit is contained in:
Alexey Rybalchenko
2018-11-01 11:23:00 +01:00
committed by Dennis Klein
parent 5e4876c947
commit 0b199e779a
4 changed files with 70 additions and 60 deletions

28
test/tools/_network.cxx Normal file
View File

@@ -0,0 +1,28 @@
/********************************************************************************
* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#include <gtest/gtest.h>
#include <fairmq/Tools.h>
#include <string>
namespace
{
using namespace std;
using namespace fair::mq;
TEST(Tools, Network)
{
string interface = fair::mq::tools::getDefaultRouteNetworkInterface();
EXPECT_NE(interface, "");
string interfaceIP = fair::mq::tools::getInterfaceIP(interface);
EXPECT_NE(interfaceIP, "");
}
} /* namespace */