Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Ashlesh Gawande | 30d96e4 | 2021-03-21 19:15:33 -0700 | [diff] [blame] | 2 | /* |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 3 | * Copyright (c) 2014-2024, The University of Memphis, |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 4 | * Regents of the University of California, |
| 5 | * Arizona Board of Regents. |
| 6 | * |
| 7 | * This file is part of NLSR (Named-data Link State Routing). |
| 8 | * See AUTHORS.md for complete list of NLSR authors and contributors. |
| 9 | * |
| 10 | * NLSR is free software: you can redistribute it and/or modify it under the terms |
| 11 | * of the GNU General Public License as published by the Free Software Foundation, |
| 12 | * either version 3 of the License, or (at your option) any later version. |
| 13 | * |
| 14 | * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE. See the GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License along with |
| 19 | * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
Ashlesh Gawande | 30d96e4 | 2021-03-21 19:15:33 -0700 | [diff] [blame] | 20 | */ |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 21 | |
| 22 | #include "communication/sync-logic-handler.hpp" |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 23 | #include "nlsr.hpp" |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 24 | |
Davide Pesavento | 8de8a8b | 2022-05-12 01:26:43 -0400 | [diff] [blame] | 25 | #include "tests/io-key-chain-fixture.hpp" |
| 26 | #include "tests/test-common.hpp" |
| 27 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 28 | namespace nlsr::test { |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 29 | |
Davide Pesavento | 8de8a8b | 2022-05-12 01:26:43 -0400 | [diff] [blame] | 30 | class SyncLogicFixture : public IoKeyChainFixture |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 31 | { |
| 32 | public: |
| 33 | SyncLogicFixture() |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 34 | { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 35 | m_keyChain.createIdentity(opts.routerPrefix); |
| 36 | } |
| 37 | |
| 38 | SyncLogicHandler& |
| 39 | getSync() |
| 40 | { |
| 41 | if (m_sync == nullptr) { |
| 42 | m_sync.reset(new SyncLogicHandler(face, m_keyChain, testIsLsaNew, opts)); |
| 43 | } |
| 44 | return *m_sync; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | void |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 48 | receiveUpdate(const ndn::Name& prefix, uint64_t seqNo) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 49 | { |
| 50 | this->advanceClocks(ndn::time::milliseconds(1), 10); |
| 51 | face.sentInterests.clear(); |
| 52 | |
Ashlesh Gawande | 30d96e4 | 2021-03-21 19:15:33 -0700 | [diff] [blame] | 53 | std::vector<psync::MissingDataInfo> updates; |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 54 | updates.push_back({prefix, 0, seqNo, 0}); |
| 55 | getSync().m_syncLogic.onPSyncUpdate(updates); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 56 | |
| 57 | this->advanceClocks(ndn::time::milliseconds(1), 10); |
| 58 | } |
| 59 | |
| 60 | public: |
Junxiao Shi | 43f37a0 | 2023-08-09 00:09:00 +0000 | [diff] [blame] | 61 | ndn::DummyClientFace face{m_io, m_keyChain}; |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 62 | SyncLogicHandler::IsLsaNew testIsLsaNew = [] (auto&&...) { return true; }; |
| 63 | SyncLogicOptions opts{ |
| 64 | SyncProtocol::PSYNC, |
| 65 | ndn::Name("/ndn/nlsr/sync").appendVersion(ConfParameter::SYNC_VERSION), |
| 66 | "/localhop/ndn/nlsr/LSA/site/%C1.Router/this-router", |
| 67 | ndn::time::milliseconds(SYNC_INTEREST_LIFETIME_DEFAULT), |
| 68 | "/ndn/site/%C1.Router/this-router", |
| 69 | HYPERBOLIC_STATE_OFF |
| 70 | }; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 71 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 72 | ndn::Name otherRouter = "/localhop/ndn/nlsr/LSA/site/%C1.Router/other-router"; |
Davide Pesavento | 8de8a8b | 2022-05-12 01:26:43 -0400 | [diff] [blame] | 73 | const std::vector<Lsa::Type> lsaTypes{Lsa::Type::NAME, |
| 74 | Lsa::Type::ADJACENCY, |
| 75 | Lsa::Type::COORDINATE}; |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 76 | |
| 77 | private: |
| 78 | std::unique_ptr<SyncLogicHandler> m_sync; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 79 | }; |
| 80 | |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 81 | BOOST_FIXTURE_TEST_SUITE(TestSyncLogicHandler, SyncLogicFixture) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 82 | |
| 83 | /* Tests that when SyncLogicHandler receives an LSA of either Name or |
| 84 | Adjacency type that appears to be newer, it will emit to its signal |
| 85 | with those LSA details. |
| 86 | */ |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 87 | BOOST_AUTO_TEST_CASE(UpdateForOtherLS) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 88 | { |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 89 | size_t nCallbacks = 0; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 90 | uint64_t syncSeqNo = 1; |
| 91 | |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 92 | for (auto lsaType : {Lsa::Type::NAME, Lsa::Type::ADJACENCY}) { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 93 | auto updateName = makeLsaUserPrefix(otherRouter, lsaType); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 94 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 95 | ndn::signal::ScopedConnection connection = getSync().onNewLsa.connect( |
Alexander Afanasyev | 135288c | 2022-04-23 23:06:56 -0400 | [diff] [blame] | 96 | [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 97 | BOOST_CHECK_EQUAL(updateName, routerName); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 98 | BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 99 | ++nCallbacks; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 100 | }); |
| 101 | |
| 102 | this->receiveUpdate(updateName, syncSeqNo); |
| 103 | } |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 104 | |
| 105 | BOOST_CHECK_EQUAL(nCallbacks, 2); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | /* Tests that when SyncLogicHandler in HR mode receives an LSA of |
| 109 | either Coordinate or Name type that appears to be newer, it will |
| 110 | emit to its signal with those LSA details. |
| 111 | */ |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 112 | BOOST_AUTO_TEST_CASE(UpdateForOtherHR) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 113 | { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 114 | opts.hyperbolicState = HYPERBOLIC_STATE_ON; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 115 | |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 116 | size_t nCallbacks = 0; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 117 | uint64_t syncSeqNo = 1; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 118 | |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 119 | for (auto lsaType : {Lsa::Type::NAME, Lsa::Type::COORDINATE}) { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 120 | auto updateName = makeLsaUserPrefix(otherRouter, lsaType); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 121 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 122 | ndn::signal::ScopedConnection connection = getSync().onNewLsa.connect( |
Alexander Afanasyev | 135288c | 2022-04-23 23:06:56 -0400 | [diff] [blame] | 123 | [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 124 | BOOST_CHECK_EQUAL(updateName, routerName); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 125 | BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 126 | ++nCallbacks; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 127 | }); |
| 128 | |
| 129 | this->receiveUpdate(updateName, syncSeqNo); |
| 130 | } |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 131 | |
| 132 | BOOST_CHECK_EQUAL(nCallbacks, 2); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | /* Tests that when SyncLogicHandler in HR-dry mode receives an LSA of |
| 136 | any type that appears to be newer, it will emit to its signal with |
| 137 | those LSA details. |
| 138 | */ |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 139 | BOOST_AUTO_TEST_CASE(UpdateForOtherHRDry) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 140 | { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 141 | opts.hyperbolicState = HYPERBOLIC_STATE_DRY_RUN; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 142 | |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 143 | size_t nCallbacks = 0; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 144 | uint64_t syncSeqNo = 1; |
| 145 | |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 146 | for (auto lsaType : this->lsaTypes) { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 147 | auto updateName = makeLsaUserPrefix(otherRouter, lsaType); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 148 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 149 | ndn::signal::ScopedConnection connection = getSync().onNewLsa.connect( |
Alexander Afanasyev | 135288c | 2022-04-23 23:06:56 -0400 | [diff] [blame] | 150 | [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 151 | BOOST_CHECK_EQUAL(updateName, routerName); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 152 | BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 153 | ++nCallbacks; |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 154 | }); |
| 155 | |
| 156 | this->receiveUpdate(updateName, syncSeqNo); |
| 157 | } |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 158 | |
| 159 | BOOST_CHECK_EQUAL(nCallbacks, 3); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | /* Tests that when SyncLogicHandler receives an update for an LSA with |
| 163 | details matching this router's details, it will *not* emit to its |
| 164 | signal those LSA details. |
| 165 | */ |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 166 | BOOST_AUTO_TEST_CASE(NoUpdateForSelf) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 167 | { |
| 168 | const uint64_t sequenceNumber = 1; |
| 169 | |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 170 | for (auto lsaType : this->lsaTypes) { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 171 | auto updateName = makeLsaUserPrefix(opts.routerPrefix, lsaType); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 172 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 173 | ndn::signal::ScopedConnection connection = getSync().onNewLsa.connect( |
Alexander Afanasyev | 135288c | 2022-04-23 23:06:56 -0400 | [diff] [blame] | 174 | [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 175 | BOOST_FAIL("Updates for self should not be emitted!"); |
| 176 | }); |
| 177 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 178 | this->receiveUpdate(updateName, sequenceNumber); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 179 | } |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 180 | |
| 181 | // avoid "test case [...] did not check any assertions" message from Boost.Test |
| 182 | BOOST_CHECK(true); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | /* Tests that when SyncLogicHandler receives an update for an LSA with |
| 186 | details that do not match the expected format, it will *not* emit |
| 187 | to its signal those LSA details. |
| 188 | */ |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 189 | BOOST_AUTO_TEST_CASE(MalformedUpdate) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 190 | { |
| 191 | const uint64_t sequenceNumber = 1; |
| 192 | |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 193 | for (auto lsaType : this->lsaTypes) { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 194 | auto updateName = makeLsaUserPrefix("/site/%C1.Router/this-router", lsaType); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 195 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 196 | ndn::signal::ScopedConnection connection = getSync().onNewLsa.connect( |
Alexander Afanasyev | 135288c | 2022-04-23 23:06:56 -0400 | [diff] [blame] | 197 | [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 198 | BOOST_FAIL("Malformed updates should not be emitted!"); |
| 199 | }); |
| 200 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 201 | this->receiveUpdate(updateName, sequenceNumber); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 202 | } |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 203 | |
| 204 | // avoid "test case [...] did not check any assertions" message from Boost.Test |
| 205 | BOOST_CHECK(true); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | /* Tests that when SyncLogicHandler receives an update for an LSA with |
| 209 | details that do not appear to be new, it will *not* emit to its |
| 210 | signal those LSA details. |
| 211 | */ |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 212 | BOOST_AUTO_TEST_CASE(LsaNotNew) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 213 | { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 214 | testIsLsaNew = [] (const ndn::Name& routerName, const Lsa::Type& lsaType, |
| 215 | const uint64_t& sequenceNumber, uint64_t incomingFaceId) { |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 216 | return false; |
| 217 | }; |
| 218 | |
| 219 | const uint64_t sequenceNumber = 1; |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 220 | ndn::signal::ScopedConnection connection = getSync().onNewLsa.connect( |
Davide Pesavento | 1954a0c | 2022-09-30 15:56:04 -0400 | [diff] [blame] | 221 | [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { |
| 222 | BOOST_FAIL("An update for an LSA with non-new sequence number should not emit!"); |
| 223 | }); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 224 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 225 | auto updateName = makeLsaUserPrefix(otherRouter, Lsa::Type::NAME); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 226 | this->receiveUpdate(updateName, sequenceNumber); |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 227 | |
| 228 | // avoid "test case [...] did not check any assertions" message from Boost.Test |
| 229 | BOOST_CHECK(true); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | /* Tests that SyncLogicHandler successfully concatenates configured |
| 233 | variables together to form the necessary prefixes to advertise |
Ashlesh Gawande | 30d96e4 | 2021-03-21 19:15:33 -0700 | [diff] [blame] | 234 | through sync. |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 235 | */ |
Davide Pesavento | d1f1df8 | 2022-03-12 16:40:37 -0500 | [diff] [blame] | 236 | BOOST_AUTO_TEST_CASE(UpdatePrefix) |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 237 | { |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 238 | BOOST_CHECK_EQUAL(getSync().m_nameLsaUserPrefix, |
| 239 | ndn::Name(opts.userPrefix).append(boost::lexical_cast<std::string>(Lsa::Type::NAME))); |
| 240 | BOOST_CHECK_EQUAL(getSync().m_adjLsaUserPrefix, |
| 241 | ndn::Name(opts.userPrefix).append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY))); |
| 242 | BOOST_CHECK_EQUAL(getSync().m_coorLsaUserPrefix, |
| 243 | ndn::Name(opts.userPrefix).append(boost::lexical_cast<std::string>(Lsa::Type::COORDINATE))); |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 244 | } |
| 245 | |
Ashlesh Gawande | 85998a1 | 2017-12-07 22:22:13 -0600 | [diff] [blame] | 246 | BOOST_AUTO_TEST_SUITE_END() |
| 247 | |
Junxiao Shi | f467467 | 2024-01-06 02:27:36 +0000 | [diff] [blame] | 248 | } // namespace nlsr::test |