blob: 692f60148ba06fa04156f2afc4dbe6ca942a891a [file] [log] [blame]
Junxiao Shi13546112015-10-14 19:33:07 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Eric Newberryb49313d2017-12-24 20:22:27 -07002/*
Davide Pesaventoe422f9e2022-06-03 01:30:23 -04003 * Copyright (c) 2014-2022, Regents of the University of California,
Junxiao Shi13546112015-10-14 19:33:07 -07004 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology,
9 * The University of Memphis.
10 *
11 * This file is part of NFD (Named Data Networking Forwarding Daemon).
12 * See AUTHORS.md for complete list of NFD authors and contributors.
13 *
14 * NFD is free software: you can redistribute it and/or modify it under the terms
15 * of the GNU General Public License as published by the Free Software Foundation,
16 * either version 3 of the License, or (at your option) any later version.
17 *
18 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20 * PURPOSE. See the GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along with
23 * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24 */
25
Eric Newberryf68f3782015-12-11 00:31:32 -070026#include "unix-stream-transport-fixture.hpp"
Junxiao Shi13546112015-10-14 19:33:07 -070027
Davide Pesaventoe422f9e2022-06-03 01:30:23 -040028namespace nfd::tests {
29
30using namespace nfd::face;
Junxiao Shi13546112015-10-14 19:33:07 -070031
Junxiao Shi13546112015-10-14 19:33:07 -070032BOOST_AUTO_TEST_SUITE(Face)
Eric Newberryf68f3782015-12-11 00:31:32 -070033BOOST_FIXTURE_TEST_SUITE(TestUnixStreamTransport, UnixStreamTransportFixture)
Junxiao Shi13546112015-10-14 19:33:07 -070034
35BOOST_AUTO_TEST_CASE(StaticProperties)
36{
Eric Newberryf68f3782015-12-11 00:31:32 -070037 initialize();
Junxiao Shi13546112015-10-14 19:33:07 -070038
Eric Newberryf68f3782015-12-11 00:31:32 -070039 checkStaticPropertiesInitialized(*transport);
Junxiao Shi13546112015-10-14 19:33:07 -070040
Eric Newberryf68f3782015-12-11 00:31:32 -070041 BOOST_CHECK_EQUAL(transport->getLocalUri().getScheme(), "unix");
42 BOOST_CHECK_EQUAL(transport->getLocalUri().getHost(), "");
43 BOOST_CHECK_EQUAL(transport->getLocalUri().getPath(), localEp.path());
44 BOOST_CHECK_EQUAL(transport->getRemoteUri().getScheme(), "fd");
45 BOOST_CHECK_EQUAL(transport->getScope(), ndn::nfd::FACE_SCOPE_LOCAL);
46 BOOST_CHECK_EQUAL(transport->getPersistency(), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
47 BOOST_CHECK_EQUAL(transport->getLinkType(), ndn::nfd::LINK_TYPE_POINT_TO_POINT);
48 BOOST_CHECK_EQUAL(transport->getMtu(), MTU_UNLIMITED);
Eric Newberryb49313d2017-12-24 20:22:27 -070049 BOOST_CHECK_EQUAL(transport->getSendQueueCapacity(), QUEUE_UNSUPPORTED);
Junxiao Shi13546112015-10-14 19:33:07 -070050}
51
Davide Pesavento32065652017-01-15 01:52:21 -050052BOOST_AUTO_TEST_CASE(PersistencyChange)
53{
54 initialize();
55
56 BOOST_CHECK_EQUAL(transport->canChangePersistencyTo(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND), true);
57 BOOST_CHECK_EQUAL(transport->canChangePersistencyTo(ndn::nfd::FACE_PERSISTENCY_PERSISTENT), false);
58 BOOST_CHECK_EQUAL(transport->canChangePersistencyTo(ndn::nfd::FACE_PERSISTENCY_PERMANENT), false);
59}
60
Junxiao Shi13546112015-10-14 19:33:07 -070061BOOST_AUTO_TEST_SUITE_END() // TestUnixStreamTransport
62BOOST_AUTO_TEST_SUITE_END() // Face
63
Davide Pesaventoe422f9e2022-06-03 01:30:23 -040064} // namespace nfd::tests