tests: sync common testing infrastructure with ndn-cxx and NFD
And upgrade waf to version 2.0.21 Change-Id: Id713e0f3035badd97ca7fc03f76e50085b9a266c
This commit is contained in:
1 parent
374f4e47b5
commit
6677762595
27 files changed
+716
-520
No files matched your search
@@ -28,6 +28,7 @@
|
||||
#include "tools/chunks/catchunks/pipeline-interests.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/io-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/security/validator-null.hpp>
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
@@ -151,10 +152,9 @@ public:
|
||||
bool isPipelineRunning = false;
|
||||
};
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(RunBasic, UnitTestTimeFixture)
|
||||
BOOST_FIXTURE_TEST_CASE(RunBasic, IoFixture)
|
||||
{
|
||||
boost::asio::io_service io;
|
||||
util::DummyClientFace face(io);
|
||||
util::DummyClientFace face(m_io);
|
||||
Options options;
|
||||
Consumer consumer(security::getAcceptAllValidator());
|
||||
|
||||
@@ -166,7 +166,7 @@ BOOST_FIXTURE_TEST_CASE(RunBasic, UnitTestTimeFixture)
|
||||
BOOST_CHECK_EQUAL(pipelinePtr->isPipelineRunning, false);
|
||||
|
||||
consumer.run(std::move(discover), std::move(pipeline));
|
||||
this->advanceClocks(io, 1_ms);
|
||||
this->advanceClocks(1_ms);
|
||||
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 0); // no discovery Interests are issued
|
||||
BOOST_CHECK_EQUAL(pipelinePtr->isPipelineRunning, true);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2016-2019, Regents of the University of California,
|
||||
* Copyright (c) 2016-2020, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
*
|
||||
@@ -26,7 +26,8 @@
|
||||
#include "tools/chunks/catchunks/discover-version.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/identity-management-fixture.hpp"
|
||||
#include "tests/io-fixture.hpp"
|
||||
#include "tests/key-chain-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/metadata-object.hpp>
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
@@ -37,8 +38,7 @@ namespace tests {
|
||||
|
||||
using namespace ndn::tests;
|
||||
|
||||
class DiscoverVersionFixture : public UnitTestTimeFixture,
|
||||
public IdentityManagementFixture
|
||||
class DiscoverVersionFixture : public IoFixture, public KeyChainFixture
|
||||
{
|
||||
public:
|
||||
void
|
||||
@@ -56,14 +56,13 @@ public:
|
||||
});
|
||||
|
||||
discover->run();
|
||||
advanceClocks(io, 1_ns);
|
||||
advanceClocks(1_ns);
|
||||
}
|
||||
|
||||
protected:
|
||||
const Name name = "/ndn/chunks/test";
|
||||
const uint64_t version = 1449227841747;
|
||||
boost::asio::io_service io;
|
||||
util::DummyClientFace face{io};
|
||||
util::DummyClientFace face{m_io};
|
||||
Options opt;
|
||||
unique_ptr<DiscoverVersion> discover;
|
||||
optional<Name> discoveredName;
|
||||
@@ -113,7 +112,7 @@ BOOST_AUTO_TEST_CASE(Success)
|
||||
MetadataObject mobject;
|
||||
mobject.setVersionedName(Name(name).appendVersion(version));
|
||||
face.receive(mobject.makeData(lastInterest.getName(), m_keyChain));
|
||||
advanceClocks(io, 1_ns);
|
||||
advanceClocks(1_ns);
|
||||
|
||||
BOOST_CHECK_EQUAL(discoveredVersion.value(), version);
|
||||
}
|
||||
@@ -163,11 +162,11 @@ BOOST_AUTO_TEST_CASE(MaxRetriesExceeded)
|
||||
// timeout or nack discovery Interests
|
||||
for (int retries = 0; retries < opt.maxRetriesOnTimeoutOrNack * 2; ++retries) {
|
||||
if (retries % 2 == 0) {
|
||||
advanceClocks(io, opt.interestLifetime);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
}
|
||||
else {
|
||||
face.receive(makeNack(face.sentInterests.back(), lp::NackReason::DUPLICATE));
|
||||
advanceClocks(io, 1_ns);
|
||||
advanceClocks(1_ns);
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(isDiscoveryFinished, false);
|
||||
@@ -175,7 +174,7 @@ BOOST_AUTO_TEST_CASE(MaxRetriesExceeded)
|
||||
}
|
||||
|
||||
// timeout the last sent Interest
|
||||
advanceClocks(io, opt.interestLifetime);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
|
||||
// finish discovery process without a resolved version number
|
||||
BOOST_CHECK_EQUAL(isDiscoveryFinished, true);
|
||||
@@ -193,11 +192,11 @@ BOOST_AUTO_TEST_CASE(SuccessAfterNackAndTimeout)
|
||||
// timeout or nack discovery Interests
|
||||
for (int retries = 0; retries < opt.maxRetriesOnTimeoutOrNack * 2; ++retries) {
|
||||
if (retries % 2 == 0) {
|
||||
advanceClocks(io, opt.interestLifetime);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
}
|
||||
else {
|
||||
face.receive(makeNack(face.sentInterests.back(), lp::NackReason::DUPLICATE));
|
||||
advanceClocks(io, 1_ns);
|
||||
advanceClocks(1_ns);
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(isDiscoveryFinished, false);
|
||||
@@ -208,7 +207,7 @@ BOOST_AUTO_TEST_CASE(SuccessAfterNackAndTimeout)
|
||||
MetadataObject mobject;
|
||||
mobject.setVersionedName(Name(name).appendVersion(version));
|
||||
face.receive(mobject.makeData(face.sentInterests.back().getName(), m_keyChain));
|
||||
advanceClocks(io, 1_ns);
|
||||
advanceClocks(1_ns);
|
||||
|
||||
BOOST_CHECK_EQUAL(discoveredVersion.value(), version);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2016-2019, Regents of the University of California,
|
||||
* Copyright (c) 2016-2020, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
*
|
||||
@@ -88,12 +88,12 @@ BOOST_AUTO_TEST_CASE(SlowStart)
|
||||
|
||||
double preCwnd = pipeline->m_cwnd;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
for (uint64_t i = 0; i < nDataSegments - 1; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd - preCwnd, 1, MARGIN);
|
||||
preCwnd = pipeline->m_cwnd;
|
||||
}
|
||||
@@ -109,12 +109,12 @@ BOOST_AUTO_TEST_CASE(CongestionAvoidance)
|
||||
|
||||
double preCwnd = pipeline->m_cwnd;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
for (uint64_t i = 0; i < pipeline->m_ssthresh; ++i) { // slow start
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
preCwnd = pipeline->m_cwnd;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE(CongestionAvoidance)
|
||||
|
||||
for (uint64_t i = pipeline->m_ssthresh; i < nDataSegments - 1; ++i) { // congestion avoidance
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd - preCwnd, opt.aiStep / floor(preCwnd), MARGIN);
|
||||
preCwnd = pipeline->m_cwnd;
|
||||
}
|
||||
@@ -137,28 +137,28 @@ BOOST_AUTO_TEST_CASE(Timeout)
|
||||
BOOST_REQUIRE_CLOSE(pipeline->m_cwnd, 2, MARGIN);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
// receive segment 0, 1, and 2
|
||||
for (uint64_t i = 0; i < 3; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 3);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 4.25, MARGIN);
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 7); // request for segment 7 has been sent
|
||||
|
||||
advanceClocks(io, time::milliseconds(100));
|
||||
advanceClocks(time::milliseconds(100));
|
||||
|
||||
// receive segment 4
|
||||
face.receive(*makeDataWithSegment(4));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 5
|
||||
face.receive(*makeDataWithSegment(5));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 5);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 4.75, MARGIN);
|
||||
@@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE(Timeout)
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nCongMarks, 0);
|
||||
|
||||
// timeout segment 3 & 6
|
||||
advanceClocks(io, time::milliseconds(150));
|
||||
advanceClocks(time::milliseconds(150));
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nTimeouts, 2);
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nRetransmitted, 1);
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nLossDecr, 1);
|
||||
@@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(Timeout)
|
||||
|
||||
// receive segment 6, retransmit 3
|
||||
face.receive(*makeDataWithSegment(6));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 6);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 2.875, MARGIN); // congestion avoidance
|
||||
@@ -205,13 +205,13 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithCwa)
|
||||
BOOST_REQUIRE_CLOSE(pipeline->m_cwnd, 2, MARGIN);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
// receive segments 0 to 4
|
||||
for (uint64_t i = 0; i < 5; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 5);
|
||||
@@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithCwa)
|
||||
|
||||
// receive segment 5 with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(5));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 6);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 2.375, MARGIN); // window size drops to 1/2 of previous size
|
||||
@@ -227,7 +227,7 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithCwa)
|
||||
|
||||
// receive the last segment with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(nDataSegments - 1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, nDataSegments);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 2.375, MARGIN); // conservative window adaption (window size should not decrease)
|
||||
@@ -251,13 +251,13 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithoutCwa)
|
||||
BOOST_REQUIRE_CLOSE(pipeline->m_cwnd, 2, MARGIN);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
// receive segments 0 to 4
|
||||
for (uint64_t i = 0; i < 5; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 5);
|
||||
@@ -265,7 +265,7 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithoutCwa)
|
||||
|
||||
// receive segment 5 with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(5));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 6);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 2.375, MARGIN); // window size drops to 1/2 of previous size
|
||||
@@ -273,7 +273,7 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithoutCwa)
|
||||
|
||||
// receive the last segment with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(nDataSegments - 1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, nDataSegments);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, PipelineInterestsAdaptive::MIN_SSTHRESH,
|
||||
@@ -298,13 +298,13 @@ BOOST_AUTO_TEST_CASE(IgnoreCongestionMarks)
|
||||
BOOST_REQUIRE_CLOSE(pipeline->m_cwnd, 2, MARGIN);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
// receive segments 0 to 5
|
||||
for (uint64_t i = 0; i < 6; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 6);
|
||||
@@ -313,7 +313,7 @@ BOOST_AUTO_TEST_CASE(IgnoreCongestionMarks)
|
||||
|
||||
// receive the last segment with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(nDataSegments - 1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, nDataSegments);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 5.2, MARGIN); // window size increases
|
||||
@@ -331,13 +331,13 @@ BOOST_AUTO_TEST_CASE(Nack)
|
||||
nDataSegments = 5;
|
||||
pipeline->m_cwnd = 10.0;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
face.receive(*makeDataWithSegment(0));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
face.receive(*makeDataWithSegment(1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 2);
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 10);
|
||||
@@ -345,7 +345,7 @@ BOOST_AUTO_TEST_CASE(Nack)
|
||||
// receive a nack with NackReason::DUPLICATE for segment 1
|
||||
auto nack1 = makeNack(face.sentInterests[1], lp::NackReason::DUPLICATE);
|
||||
face.receive(nack1);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// nack1 is ignored
|
||||
BOOST_CHECK_EQUAL(hasFailed, false);
|
||||
@@ -355,7 +355,7 @@ BOOST_AUTO_TEST_CASE(Nack)
|
||||
// receive a nack with NackReason::CONGESTION for segment 2
|
||||
auto nack2 = makeNack(face.sentInterests[2], lp::NackReason::CONGESTION);
|
||||
face.receive(nack2);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// segment 2 is retransmitted
|
||||
BOOST_CHECK_EQUAL(pipeline->m_retxCount[2], 1);
|
||||
@@ -363,7 +363,7 @@ BOOST_AUTO_TEST_CASE(Nack)
|
||||
// receive a nack with NackReason::NONE for segment 3
|
||||
auto nack3 = makeNack(face.sentInterests[3], lp::NackReason::NONE);
|
||||
face.receive(nack3);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// Other types of Nack will trigger a failure
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
@@ -375,11 +375,11 @@ BOOST_AUTO_TEST_CASE(FinalBlockIdNotSetAtBeginning)
|
||||
nDataSegments = 4;
|
||||
pipeline->m_cwnd = 4;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 0 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(0, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// interests for segment 0 - 5 have been sent
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 6);
|
||||
@@ -390,7 +390,7 @@ BOOST_AUTO_TEST_CASE(FinalBlockIdNotSetAtBeginning)
|
||||
|
||||
// receive segment 1 with FinalBlockId
|
||||
face.receive(*makeDataWithSegment(1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 2);
|
||||
BOOST_CHECK_EQUAL(pipeline->m_hasFinalBlockId, true);
|
||||
|
||||
@@ -407,15 +407,15 @@ BOOST_AUTO_TEST_CASE(FailureBeforeFinalBlockIdReceived)
|
||||
nDataSegments = 4;
|
||||
pipeline->m_cwnd = 4;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 0 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(0, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 1 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(1, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// interests for segment 0 - 7 have been sent
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 8);
|
||||
@@ -423,7 +423,7 @@ BOOST_AUTO_TEST_CASE(FailureBeforeFinalBlockIdReceived)
|
||||
// receive nack with NackReason::NONE for segment 3
|
||||
auto nack = makeNack(face.sentInterests[3], lp::NackReason::NONE);
|
||||
face.receive(nack);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// error not triggered
|
||||
// pending interests for segment > 3 haven been removed
|
||||
@@ -432,7 +432,7 @@ BOOST_AUTO_TEST_CASE(FailureBeforeFinalBlockIdReceived)
|
||||
|
||||
// receive segment 2 with FinalBlockId
|
||||
face.receive(*makeDataWithSegment(2));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// error triggered since segment 3 is part of the content
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
@@ -447,15 +447,15 @@ BOOST_AUTO_TEST_CASE(SpuriousFailureBeforeFinalBlockIdReceived)
|
||||
nDataSegments = 4;
|
||||
pipeline->m_cwnd = 4;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 0 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(0, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 1 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(1, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// interests for segment 0 - 7 have been sent
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 8);
|
||||
@@ -463,7 +463,7 @@ BOOST_AUTO_TEST_CASE(SpuriousFailureBeforeFinalBlockIdReceived)
|
||||
// receive nack with NackReason::NONE for segment 4
|
||||
auto nack = makeNack(face.sentInterests[4], lp::NackReason::NONE);
|
||||
face.receive(nack);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// error not triggered
|
||||
// pending interests for segment > 3 have been removed
|
||||
@@ -472,17 +472,17 @@ BOOST_AUTO_TEST_CASE(SpuriousFailureBeforeFinalBlockIdReceived)
|
||||
|
||||
// receive segment 2 with FinalBlockId
|
||||
face.receive(*makeDataWithSegment(2));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// timeout segment 3
|
||||
advanceClocks(io, time::seconds(1));
|
||||
advanceClocks(time::seconds(1));
|
||||
|
||||
// segment 3 is retransmitted
|
||||
BOOST_CHECK_EQUAL(pipeline->m_retxCount[3], 1);
|
||||
|
||||
// receive segment 3
|
||||
face.receive(*makeDataWithSegment(3));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(hasFailed, false);
|
||||
}
|
||||
@@ -495,15 +495,15 @@ BOOST_AUTO_TEST_CASE(SegmentInfoMaintenance)
|
||||
nDataSegments = 3;
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 0
|
||||
face.receive(*makeDataWithSegment(0));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 1
|
||||
face.receive(*makeDataWithSegment(1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 3);
|
||||
|
||||
@@ -513,7 +513,7 @@ BOOST_AUTO_TEST_CASE(SegmentInfoMaintenance)
|
||||
BOOST_CHECK(it->second.state == SegmentState::FirstTimeSent);
|
||||
|
||||
// timeout segment 2 twice
|
||||
advanceClocks(io, time::milliseconds(400), 3);
|
||||
advanceClocks(time::milliseconds(400), 3);
|
||||
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 5);
|
||||
|
||||
@@ -527,7 +527,7 @@ BOOST_AUTO_TEST_CASE(SegmentInfoMaintenance)
|
||||
|
||||
// receive segment 2 the first time
|
||||
face.receive(*makeDataWithSegment(2));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// check if segment 2 was erased from m_segmentInfo
|
||||
it = pipeline->m_segmentInfo.find(2);
|
||||
@@ -538,7 +538,7 @@ BOOST_AUTO_TEST_CASE(SegmentInfoMaintenance)
|
||||
|
||||
// receive segment 2 the second time
|
||||
face.receive(*makeDataWithSegment(2));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// nothing changed
|
||||
it = pipeline->m_segmentInfo.find(2);
|
||||
@@ -582,10 +582,10 @@ BOOST_AUTO_TEST_CASE(StopsWhenFileSizeLessThanChunkSize)
|
||||
nDataSegments = 1;
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
face.receive(*makeDataWithSegment(0));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_hasFinalBlockId, true);
|
||||
BOOST_CHECK_EQUAL(pipeline->m_segmentInfo.size(), 0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2016-2019, Regents of the University of California,
|
||||
* Copyright (c) 2016-2020, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
*
|
||||
@@ -87,12 +87,12 @@ BOOST_AUTO_TEST_CASE(SlowStart)
|
||||
|
||||
double preCwnd = pipeline->m_cwnd;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
for (uint64_t i = 0; i < nDataSegments - 1; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd - preCwnd, 1, MARGIN);
|
||||
preCwnd = pipeline->m_cwnd;
|
||||
}
|
||||
@@ -107,28 +107,28 @@ BOOST_AUTO_TEST_CASE(Timeout)
|
||||
BOOST_REQUIRE_CLOSE(pipeline->m_cwnd, 2, MARGIN);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
// receive segment 0, 1, and 2
|
||||
for (uint64_t i = 0; i < 3; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 3);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 5, MARGIN);
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 8); // request for segment #7 has been sent
|
||||
|
||||
advanceClocks(io, time::milliseconds(100));
|
||||
advanceClocks(time::milliseconds(100));
|
||||
|
||||
// receive segment 4
|
||||
face.receive(*makeDataWithSegment(4));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 5
|
||||
face.receive(*makeDataWithSegment(5));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 5);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 7.0, MARGIN);
|
||||
@@ -142,7 +142,7 @@ BOOST_AUTO_TEST_CASE(Timeout)
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nCongMarks, 0);
|
||||
|
||||
// timeout segment 3 & 6
|
||||
advanceClocks(io, time::milliseconds(150));
|
||||
advanceClocks(time::milliseconds(150));
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nTimeouts, 3);
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nRetransmitted, 3);
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nLossDecr, 1);
|
||||
@@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE(Timeout)
|
||||
|
||||
// receive segment 6, retransmit 3
|
||||
face.receive(*makeDataWithSegment(6));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 6);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 4.9, MARGIN); // congestion avoidance
|
||||
@@ -174,13 +174,13 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithCwa)
|
||||
BOOST_REQUIRE_CLOSE(pipeline->m_cwnd, 2, MARGIN);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
// receive segments 0 to 4
|
||||
for (uint64_t i = 0; i < 5; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 5);
|
||||
@@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithCwa)
|
||||
|
||||
// receive segment 5 with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(5));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 6);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 4.9, MARGIN); // window size drops to 0.7x of previous size
|
||||
@@ -196,7 +196,7 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithCwa)
|
||||
|
||||
// receive the last segment with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(nDataSegments - 1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, nDataSegments);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 4.9, MARGIN); // conservative window adaption (window size should not decrease)
|
||||
@@ -219,13 +219,13 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithoutCwa)
|
||||
BOOST_REQUIRE_CLOSE(pipeline->m_cwnd, 2, MARGIN);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
// receive segments 0 to 4
|
||||
for (uint64_t i = 0; i < 5; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 5);
|
||||
@@ -233,7 +233,7 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithoutCwa)
|
||||
|
||||
// receive segment 5 with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(5));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 6);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 4.9, MARGIN); // window size drops to 0.7x of previous size
|
||||
@@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE(CongestionMarksWithoutCwa)
|
||||
|
||||
// receive the last segment with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(nDataSegments - 1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, nDataSegments);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 3.43, MARGIN); // window size should decrease, as cwa is disabled
|
||||
@@ -264,13 +264,13 @@ BOOST_AUTO_TEST_CASE(IgnoreCongestionMarks)
|
||||
BOOST_REQUIRE_CLOSE(pipeline->m_cwnd, 2, MARGIN);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
|
||||
|
||||
// receive segments 0 to 5
|
||||
for (uint64_t i = 0; i < 6; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 6);
|
||||
@@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE(IgnoreCongestionMarks)
|
||||
|
||||
// receive the last segment with congestion mark
|
||||
face.receive(*makeDataWithSegmentAndCongMark(nDataSegments - 1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, nDataSegments);
|
||||
BOOST_CHECK_CLOSE(pipeline->m_cwnd, 9.0, MARGIN); // window size increases
|
||||
@@ -297,13 +297,13 @@ BOOST_AUTO_TEST_CASE(Nack)
|
||||
nDataSegments = 5;
|
||||
pipeline->m_cwnd = 10.0;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
face.receive(*makeDataWithSegment(0));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
face.receive(*makeDataWithSegment(1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 2);
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 10);
|
||||
@@ -311,7 +311,7 @@ BOOST_AUTO_TEST_CASE(Nack)
|
||||
// receive a nack with NackReason::DUPLICATE for segment 1
|
||||
auto nack1 = makeNack(face.sentInterests[1], lp::NackReason::DUPLICATE);
|
||||
face.receive(nack1);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// nack1 is ignored
|
||||
BOOST_CHECK_EQUAL(hasFailed, false);
|
||||
@@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE(Nack)
|
||||
// receive a nack with NackReason::CONGESTION for segment 2
|
||||
auto nack2 = makeNack(face.sentInterests[2], lp::NackReason::CONGESTION);
|
||||
face.receive(nack2);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// segment 2 is retransmitted
|
||||
BOOST_CHECK_EQUAL(pipeline->m_retxCount[2], 1);
|
||||
@@ -329,7 +329,7 @@ BOOST_AUTO_TEST_CASE(Nack)
|
||||
// receive a nack with NackReason::NONE for segment 3
|
||||
auto nack3 = makeNack(face.sentInterests[3], lp::NackReason::NONE);
|
||||
face.receive(nack3);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// Other types of Nack will trigger a failure
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
@@ -341,11 +341,11 @@ BOOST_AUTO_TEST_CASE(FinalBlockIdNotSetAtBeginning)
|
||||
nDataSegments = 4;
|
||||
pipeline->m_cwnd = 4;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 0 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(0, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// interests for segment 0 - 5 have been sent
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 6);
|
||||
@@ -356,7 +356,7 @@ BOOST_AUTO_TEST_CASE(FinalBlockIdNotSetAtBeginning)
|
||||
|
||||
// receive segment 1 with FinalBlockId
|
||||
face.receive(*makeDataWithSegment(1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 2);
|
||||
BOOST_CHECK_EQUAL(pipeline->m_hasFinalBlockId, true);
|
||||
|
||||
@@ -373,15 +373,15 @@ BOOST_AUTO_TEST_CASE(FailureBeforeFinalBlockIdReceived)
|
||||
nDataSegments = 4;
|
||||
pipeline->m_cwnd = 4;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 0 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(0, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 1 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(1, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// interests for segment 0 - 7 have been sent
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 8);
|
||||
@@ -389,7 +389,7 @@ BOOST_AUTO_TEST_CASE(FailureBeforeFinalBlockIdReceived)
|
||||
// receive nack with NackReason::NONE for segment 3
|
||||
auto nack = makeNack(face.sentInterests[3], lp::NackReason::NONE);
|
||||
face.receive(nack);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// error not triggered
|
||||
// pending interests for segment > 3 haven been removed
|
||||
@@ -398,7 +398,7 @@ BOOST_AUTO_TEST_CASE(FailureBeforeFinalBlockIdReceived)
|
||||
|
||||
// receive segment 2 with FinalBlockId
|
||||
face.receive(*makeDataWithSegment(2));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// error triggered since segment 3 is part of the content
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
@@ -413,15 +413,15 @@ BOOST_AUTO_TEST_CASE(SpuriousFailureBeforeFinalBlockIdReceived)
|
||||
nDataSegments = 4;
|
||||
pipeline->m_cwnd = 4;
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 0 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(0, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 1 without FinalBlockId
|
||||
face.receive(*makeDataWithSegment(1, false));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// interests for segment 0 - 7 have been sent
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 8);
|
||||
@@ -429,7 +429,7 @@ BOOST_AUTO_TEST_CASE(SpuriousFailureBeforeFinalBlockIdReceived)
|
||||
// receive nack with NackReason::NONE for segment 4
|
||||
auto nack = makeNack(face.sentInterests[4], lp::NackReason::NONE);
|
||||
face.receive(nack);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// error not triggered
|
||||
// pending interests for segment > 3 have been removed
|
||||
@@ -438,17 +438,17 @@ BOOST_AUTO_TEST_CASE(SpuriousFailureBeforeFinalBlockIdReceived)
|
||||
|
||||
// receive segment 2 with FinalBlockId
|
||||
face.receive(*makeDataWithSegment(2));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// timeout segment 3
|
||||
advanceClocks(io, time::seconds(1));
|
||||
advanceClocks(time::seconds(1));
|
||||
|
||||
// segment 3 is retransmitted
|
||||
BOOST_CHECK_EQUAL(pipeline->m_retxCount[3], 1);
|
||||
|
||||
// receive segment 3
|
||||
face.receive(*makeDataWithSegment(3));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(hasFailed, false);
|
||||
}
|
||||
@@ -461,15 +461,15 @@ BOOST_AUTO_TEST_CASE(SegmentInfoMaintenance)
|
||||
nDataSegments = 3;
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 0
|
||||
face.receive(*makeDataWithSegment(0));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// receive segment 1
|
||||
face.receive(*makeDataWithSegment(1));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 3);
|
||||
|
||||
@@ -479,7 +479,7 @@ BOOST_AUTO_TEST_CASE(SegmentInfoMaintenance)
|
||||
BOOST_CHECK(it->second.state == SegmentState::FirstTimeSent);
|
||||
|
||||
// timeout segment 2 twice
|
||||
advanceClocks(io, time::milliseconds(400), 3);
|
||||
advanceClocks(time::milliseconds(400), 3);
|
||||
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 5);
|
||||
|
||||
@@ -493,7 +493,7 @@ BOOST_AUTO_TEST_CASE(SegmentInfoMaintenance)
|
||||
|
||||
// receive segment 2 the first time
|
||||
face.receive(*makeDataWithSegment(2));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// check if segment 2 was erased from m_segmentInfo
|
||||
it = pipeline->m_segmentInfo.find(2);
|
||||
@@ -504,7 +504,7 @@ BOOST_AUTO_TEST_CASE(SegmentInfoMaintenance)
|
||||
|
||||
// receive segment 2 the second time
|
||||
face.receive(*makeDataWithSegment(2));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
// nothing changed
|
||||
it = pipeline->m_segmentInfo.find(2);
|
||||
@@ -548,10 +548,10 @@ BOOST_AUTO_TEST_CASE(StopsWhenFileSizeLessThanChunkSize)
|
||||
nDataSegments = 1;
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
face.receive(*makeDataWithSegment(0));
|
||||
advanceClocks(io, time::nanoseconds(1));
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_hasFinalBlockId, true);
|
||||
BOOST_CHECK_EQUAL(pipeline->m_segmentInfo.size(), 0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2016-2019, Regents of the University of California,
|
||||
* Copyright (c) 2016-2020, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
*
|
||||
@@ -67,12 +67,12 @@ BOOST_AUTO_TEST_CASE(FullPipeline)
|
||||
BOOST_ASSERT(nDataSegments > opt.maxPipelineSize);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize);
|
||||
|
||||
for (uint64_t i = 0; i < nDataSegments - 1; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, i + 1);
|
||||
|
||||
if (i < nDataSegments - opt.maxPipelineSize) {
|
||||
@@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(FullPipeline)
|
||||
|
||||
BOOST_CHECK_EQUAL(hasFailed, false);
|
||||
|
||||
advanceClocks(io, ndn::DEFAULT_INTEREST_LIFETIME, opt.maxRetriesOnTimeoutOrNack + 1);
|
||||
advanceClocks(ndn::DEFAULT_INTEREST_LIFETIME, opt.maxRetriesOnTimeoutOrNack + 1);
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
}
|
||||
|
||||
@@ -102,11 +102,11 @@ BOOST_AUTO_TEST_CASE(TimeoutAllSegments)
|
||||
BOOST_ASSERT(nDataSegments > opt.maxPipelineSize);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize);
|
||||
|
||||
for (int i = 0; i < opt.maxRetriesOnTimeoutOrNack; ++i) {
|
||||
advanceClocks(io, opt.interestLifetime, 1);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize * (i + 2));
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 0);
|
||||
|
||||
@@ -117,7 +117,7 @@ BOOST_AUTO_TEST_CASE(TimeoutAllSegments)
|
||||
}
|
||||
}
|
||||
|
||||
advanceClocks(io, opt.interestLifetime, 1);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
}
|
||||
|
||||
@@ -130,23 +130,23 @@ BOOST_AUTO_TEST_CASE(TimeoutAfterFinalBlockIdReceived)
|
||||
BOOST_ASSERT(nDataSegments > opt.maxPipelineSize);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize);
|
||||
|
||||
// send a single segment for each pipeline element but not the first element
|
||||
advanceClocks(io, opt.interestLifetime, 1);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
for (uint64_t i = 1; i < opt.maxPipelineSize; ++i) {
|
||||
face.receive(*makeDataWithSegment(i));
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
// send a single data packet for each pipeline element
|
||||
advanceClocks(io, opt.interestLifetime, opt.maxRetriesOnTimeoutOrNack - 1);
|
||||
advanceClocks(opt.interestLifetime, opt.maxRetriesOnTimeoutOrNack - 1);
|
||||
for (uint64_t i = 0; i < opt.maxPipelineSize; ++i) {
|
||||
face.receive(*makeDataWithSegment(opt.maxPipelineSize + i));
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
advanceClocks(io, opt.interestLifetime, 1);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
|
||||
size_t interestAfterFailure = face.sentInterests.size();
|
||||
|
||||
@@ -154,14 +154,14 @@ BOOST_AUTO_TEST_CASE(TimeoutAfterFinalBlockIdReceived)
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
|
||||
// these new segments should not generate new interests
|
||||
advanceClocks(io, opt.interestLifetime, 1);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
for (uint64_t i = 0; i < opt.maxPipelineSize; ++i) {
|
||||
face.receive(*makeDataWithSegment(opt.maxPipelineSize * 2 + i - 1));
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
// no more interests after a failure
|
||||
advanceClocks(io, opt.interestLifetime, opt.maxRetriesOnTimeoutOrNack);
|
||||
advanceClocks(opt.interestLifetime, opt.maxRetriesOnTimeoutOrNack);
|
||||
BOOST_CHECK_EQUAL(interestAfterFailure, face.sentInterests.size());
|
||||
BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0);
|
||||
}
|
||||
@@ -175,13 +175,13 @@ BOOST_AUTO_TEST_CASE(TimeoutBeforeFinalBlockIdReceived)
|
||||
BOOST_ASSERT(nDataSegments > opt.maxPipelineSize);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize);
|
||||
|
||||
advanceClocks(io, opt.interestLifetime, 1);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
for (uint64_t i = 2; i < opt.maxPipelineSize; ++i) {
|
||||
face.receive(*makeDataWithSegment(i, false));
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
const auto& lastInterest = face.sentInterests.back();
|
||||
BOOST_CHECK_EQUAL(getSegmentFromPacket(lastInterest), opt.maxPipelineSize + i - 2);
|
||||
@@ -195,7 +195,7 @@ BOOST_AUTO_TEST_CASE(TimeoutBeforeFinalBlockIdReceived)
|
||||
|
||||
// all the pipeline elements are two retries near the timeout error, but not the
|
||||
// second (segment #1) that is only one retry near the timeout
|
||||
advanceClocks(io, opt.interestLifetime, opt.maxRetriesOnTimeoutOrNack - 1);
|
||||
advanceClocks(opt.interestLifetime, opt.maxRetriesOnTimeoutOrNack - 1);
|
||||
BOOST_CHECK_EQUAL(hasFailed, false);
|
||||
|
||||
// data for the first pipeline element (segment #0)
|
||||
@@ -210,10 +210,10 @@ BOOST_AUTO_TEST_CASE(TimeoutBeforeFinalBlockIdReceived)
|
||||
else {
|
||||
face.receive(*makeDataWithSegment(i, false));
|
||||
}
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
// timeout for the second pipeline element (segment #1), this should trigger an error
|
||||
advanceClocks(io, opt.interestLifetime, 1);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, nDataSegments - 1);
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
@@ -228,10 +228,10 @@ BOOST_AUTO_TEST_CASE(SegmentReceivedAfterTimeout)
|
||||
BOOST_ASSERT(nDataSegments > opt.maxPipelineSize);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize);
|
||||
|
||||
advanceClocks(io, opt.interestLifetime, 1);
|
||||
advanceClocks(opt.interestLifetime);
|
||||
|
||||
// nack for the first pipeline element (segment #0)
|
||||
auto nack = make_shared<lp::Nack>(face.sentInterests[opt.maxPipelineSize]);
|
||||
@@ -240,13 +240,13 @@ BOOST_AUTO_TEST_CASE(SegmentReceivedAfterTimeout)
|
||||
BOOST_CHECK_EQUAL(hasFailed, false);
|
||||
|
||||
// timeout for all the pipeline elements, but not the first (segment #0)
|
||||
advanceClocks(io, opt.interestLifetime, opt.maxRetriesOnTimeoutOrNack);
|
||||
advanceClocks(opt.interestLifetime, opt.maxRetriesOnTimeoutOrNack);
|
||||
BOOST_CHECK_EQUAL(hasFailed, false);
|
||||
|
||||
// data for the first pipeline element (segment #0), this should trigger an error because the
|
||||
// other pipeline elements failed
|
||||
face.receive(*makeDataWithSegment(0, false));
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(pipeline->m_nReceived, 1);
|
||||
BOOST_CHECK_EQUAL(hasFailed, true);
|
||||
@@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(CongestionAllSegments)
|
||||
BOOST_ASSERT(nDataSegments > opt.maxPipelineSize);
|
||||
|
||||
run(name);
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize);
|
||||
|
||||
// send nack for all the pipeline elements first interest
|
||||
@@ -266,7 +266,7 @@ BOOST_AUTO_TEST_CASE(CongestionAllSegments)
|
||||
auto nack = make_shared<lp::Nack>(face.sentInterests[i]);
|
||||
nack->setReason(lp::NackReason::CONGESTION);
|
||||
face.receive(*nack);
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
|
||||
// send nack for all the pipeline elements interests after the first
|
||||
@@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE(CongestionAllSegments)
|
||||
if (backoffTime > DataFetcher::MAX_CONGESTION_BACKOFF_TIME)
|
||||
backoffTime = DataFetcher::MAX_CONGESTION_BACKOFF_TIME;
|
||||
|
||||
advanceClocks(io, backoffTime, 1);
|
||||
advanceClocks(backoffTime);
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize * (i +1));
|
||||
|
||||
// A single retry for every pipeline element
|
||||
@@ -288,7 +288,7 @@ BOOST_AUTO_TEST_CASE(CongestionAllSegments)
|
||||
auto nack = make_shared<lp::Nack>(face.sentInterests[(opt.maxPipelineSize * i) + j]);
|
||||
nack->setReason(lp::NackReason::CONGESTION);
|
||||
face.receive(*nack);
|
||||
advanceClocks(io, time::nanoseconds(1), 1);
|
||||
advanceClocks(time::nanoseconds(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2016-2019, Regents of the University of California,
|
||||
* Copyright (c) 2016-2020, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
*
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "tools/chunks/catchunks/pipeline-interests.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/io-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
|
||||
@@ -41,7 +42,7 @@ namespace tests {
|
||||
|
||||
using namespace ndn::tests;
|
||||
|
||||
class PipelineInterestsFixture : public UnitTestTimeFixture
|
||||
class PipelineInterestsFixture : public IoFixture
|
||||
{
|
||||
protected:
|
||||
void
|
||||
@@ -78,8 +79,7 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
boost::asio::io_service io;
|
||||
util::DummyClientFace face{io};
|
||||
util::DummyClientFace face{m_io};
|
||||
Name name{"/ndn/chunks/test"};
|
||||
uint64_t nDataSegments = 0;
|
||||
bool hasFailed = false;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "tools/chunks/putchunks/producer.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/identity-management-fixture.hpp"
|
||||
#include "tests/key-chain-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/metadata-object.hpp>
|
||||
#include <ndn-cxx/security/pib/identity.hpp>
|
||||
@@ -42,7 +42,7 @@ namespace tests {
|
||||
|
||||
using namespace ndn::tests;
|
||||
|
||||
class ProducerFixture : public IdentityManagementFixture
|
||||
class ProducerFixture : public KeyChainFixture
|
||||
{
|
||||
protected:
|
||||
ProducerFixture()
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2020, Regents of the University of California,
|
||||
* Arizona Board of Regents,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University,
|
||||
* Washington University in St. Louis,
|
||||
* Beijing Institute of Technology,
|
||||
* The University of Memphis.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
*
|
||||
* ndn-tools is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "tests/clock-fixture.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
ClockFixture::ClockFixture()
|
||||
: m_steadyClock(make_shared<time::UnitTestSteadyClock>())
|
||||
, m_systemClock(make_shared<time::UnitTestSystemClock>())
|
||||
{
|
||||
time::setCustomClocks(m_steadyClock, m_systemClock);
|
||||
}
|
||||
|
||||
ClockFixture::~ClockFixture()
|
||||
{
|
||||
time::setCustomClocks(nullptr, nullptr);
|
||||
}
|
||||
|
||||
void
|
||||
ClockFixture::advanceClocks(time::nanoseconds tick, time::nanoseconds total)
|
||||
{
|
||||
BOOST_ASSERT(tick > time::nanoseconds::zero());
|
||||
BOOST_ASSERT(total >= time::nanoseconds::zero());
|
||||
|
||||
while (total > time::nanoseconds::zero()) {
|
||||
auto t = std::min(tick, total);
|
||||
m_steadyClock->advance(t);
|
||||
m_systemClock->advance(t);
|
||||
total -= t;
|
||||
|
||||
afterTick();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace tests
|
||||
} // namespace ndn
|
||||
@@ -0,0 +1,89 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2020, Regents of the University of California,
|
||||
* Arizona Board of Regents,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University,
|
||||
* Washington University in St. Louis,
|
||||
* Beijing Institute of Technology,
|
||||
* The University of Memphis.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
*
|
||||
* ndn-tools is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef NDN_TOOLS_TESTS_CLOCK_FIXTURE_HPP
|
||||
#define NDN_TOOLS_TESTS_CLOCK_FIXTURE_HPP
|
||||
|
||||
#include <ndn-cxx/util/time-unit-test-clock.hpp>
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
/** \brief A test fixture that overrides steady clock and system clock.
|
||||
*/
|
||||
class ClockFixture
|
||||
{
|
||||
public:
|
||||
virtual
|
||||
~ClockFixture();
|
||||
|
||||
/** \brief Advance steady and system clocks.
|
||||
*
|
||||
* Clocks are advanced in increments of \p tick for \p nTicks ticks.
|
||||
* afterTick() is called after each tick.
|
||||
*
|
||||
* Exceptions thrown during I/O events are propagated to the caller.
|
||||
* Clock advancement will stop in the event of an exception.
|
||||
*/
|
||||
void
|
||||
advanceClocks(time::nanoseconds tick, size_t nTicks = 1)
|
||||
{
|
||||
advanceClocks(tick, tick * nTicks);
|
||||
}
|
||||
|
||||
/** \brief Advance steady and system clocks.
|
||||
*
|
||||
* Clocks are advanced in increments of \p tick for \p total time.
|
||||
* The last increment might be shorter than \p tick.
|
||||
* afterTick() is called after each tick.
|
||||
*
|
||||
* Exceptions thrown during I/O events are propagated to the caller.
|
||||
* Clock advancement will stop in the event of an exception.
|
||||
*/
|
||||
void
|
||||
advanceClocks(time::nanoseconds tick, time::nanoseconds total);
|
||||
|
||||
protected:
|
||||
ClockFixture();
|
||||
|
||||
private:
|
||||
/** \brief Called by advanceClocks() after each clock advancement (tick).
|
||||
*
|
||||
* The base class implementation is a no-op.
|
||||
*/
|
||||
virtual void
|
||||
afterTick()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
shared_ptr<time::UnitTestSteadyClock> m_steadyClock;
|
||||
shared_ptr<time::UnitTestSystemClock> m_systemClock;
|
||||
};
|
||||
|
||||
} // namespace tests
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_TOOLS_TESTS_CLOCK_FIXTURE_HPP
|
||||
Executable → Regular
File mode changed.
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "tools/dump/ndndump.hpp"
|
||||
|
||||
#include "tests/identity-management-fixture.hpp"
|
||||
#include "tests/test-common.hpp"
|
||||
|
||||
#include <net/ethernet.h>
|
||||
@@ -66,7 +65,7 @@ private:
|
||||
std::streambuf* originalBuffer;
|
||||
};
|
||||
|
||||
class NdnDumpFixture : public IdentityManagementFixture
|
||||
class NdnDumpFixture
|
||||
{
|
||||
protected:
|
||||
NdnDumpFixture()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2018, Regents of the University of California.
|
||||
* Copyright (c) 2014-2020, Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
@@ -17,14 +17,15 @@
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "boost-test.hpp"
|
||||
#include "core/common.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <fstream>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace ndn {
|
||||
namespace tools {
|
||||
namespace tests {
|
||||
|
||||
class GlobalConfiguration
|
||||
@@ -36,19 +37,22 @@ public:
|
||||
if (envHome)
|
||||
m_home = envHome;
|
||||
|
||||
boost::filesystem::path dir{TMP_TESTS_PATH};
|
||||
dir /= "test-home";
|
||||
::setenv("HOME", dir.c_str(), 1);
|
||||
auto testHome = boost::filesystem::path(UNIT_TESTS_TMPDIR) / "test-home";
|
||||
if (::setenv("HOME", testHome.c_str(), 1) != 0)
|
||||
NDN_THROW(std::runtime_error("setenv() failed"));
|
||||
|
||||
boost::filesystem::create_directories(dir);
|
||||
std::ofstream clientConf((dir / ".ndn" / "client.conf").c_str());
|
||||
boost::filesystem::create_directories(testHome);
|
||||
|
||||
std::ofstream clientConf((testHome / ".ndn" / "client.conf").c_str());
|
||||
clientConf << "pib=pib-sqlite3" << std::endl
|
||||
<< "tpm=tpm-file" << std::endl;
|
||||
}
|
||||
|
||||
~GlobalConfiguration()
|
||||
~GlobalConfiguration() noexcept
|
||||
{
|
||||
if (!m_home.empty())
|
||||
if (m_home.empty())
|
||||
::unsetenv("HOME");
|
||||
else
|
||||
::setenv("HOME", m_home.data(), 1);
|
||||
}
|
||||
|
||||
@@ -65,5 +69,4 @@ BOOST_GLOBAL_FIXTURE(GlobalConfiguration)
|
||||
#endif
|
||||
|
||||
} // namespace tests
|
||||
} // namespace tools
|
||||
} // namespace ndn
|
||||
@@ -1,83 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2020, Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
*
|
||||
* ndn-tools is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "identity-management-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/security/certificate.hpp>
|
||||
#include <ndn-cxx/security/pib/identity.hpp>
|
||||
#include <ndn-cxx/security/pib/key.hpp>
|
||||
#include <ndn-cxx/security/pib/pib.hpp>
|
||||
#include <ndn-cxx/util/io.hpp>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
IdentityManagementFixture::IdentityManagementFixture()
|
||||
: m_keyChain("pib-memory:", "tpm-memory:")
|
||||
{
|
||||
}
|
||||
|
||||
IdentityManagementFixture::~IdentityManagementFixture()
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
for (const auto& certFile : m_certFiles) {
|
||||
boost::filesystem::remove(certFile, ec);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
IdentityManagementFixture::addIdentity(const Name& identity, const KeyParams& params)
|
||||
{
|
||||
try {
|
||||
m_keyChain.createIdentity(identity, params);
|
||||
return true;
|
||||
}
|
||||
catch (const std::runtime_error&) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
IdentityManagementFixture::saveIdentityCertificate(const Name& identity, const std::string& filename, bool wantAdd)
|
||||
{
|
||||
security::Certificate cert;
|
||||
try {
|
||||
cert = m_keyChain.getPib().getIdentity(identity).getDefaultKey().getDefaultCertificate();
|
||||
}
|
||||
catch (const security::Pib::Error&) {
|
||||
if (wantAdd && this->addIdentity(identity)) {
|
||||
return this->saveIdentityCertificate(identity, filename, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
m_certFiles.push_back(filename);
|
||||
try {
|
||||
io::save(cert, filename);
|
||||
return true;
|
||||
}
|
||||
catch (const io::Error&) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace tests
|
||||
} // namespace ndn
|
||||
@@ -1,72 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2018, Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
*
|
||||
* ndn-tools is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef NDN_TOOLS_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
|
||||
#define NDN_TOOLS_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
/** \brief a fixture providing an in-memory KeyChain
|
||||
*/
|
||||
class IdentityManagementFixture
|
||||
{
|
||||
public:
|
||||
IdentityManagementFixture();
|
||||
|
||||
/** \brief deletes saved certificate files
|
||||
*/
|
||||
~IdentityManagementFixture();
|
||||
|
||||
/** \brief add identity
|
||||
* \return whether successful
|
||||
*/
|
||||
bool
|
||||
addIdentity(const Name& identity, const KeyParams& params = KeyChain::getDefaultKeyParams());
|
||||
|
||||
/** \brief save identity certificate to a file
|
||||
* \param identity identity name
|
||||
* \param filename file name, should be writable
|
||||
* \param wantAdd if true, add new identity when necessary
|
||||
* \return whether successful
|
||||
*/
|
||||
bool
|
||||
saveIdentityCertificate(const Name& identity, const std::string& filename, bool wantAdd = false);
|
||||
|
||||
protected:
|
||||
KeyChain m_keyChain;
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_certFiles;
|
||||
};
|
||||
|
||||
/** \brief convenience base class for inheriting from both UnitTestTimeFixture
|
||||
* and IdentityManagementFixture
|
||||
*/
|
||||
class IdentityManagementTimeFixture : public UnitTestTimeFixture
|
||||
, public IdentityManagementFixture
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace tests
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_TOOLS_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
|
||||
@@ -0,0 +1,59 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2020, Regents of the University of California,
|
||||
* Arizona Board of Regents,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University,
|
||||
* Washington University in St. Louis,
|
||||
* Beijing Institute of Technology,
|
||||
* The University of Memphis.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
*
|
||||
* ndn-tools is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef NDN_TOOLS_TESTS_IO_FIXTURE_HPP
|
||||
#define NDN_TOOLS_TESTS_IO_FIXTURE_HPP
|
||||
|
||||
#include "tests/clock-fixture.hpp"
|
||||
|
||||
#include <boost/asio/io_service.hpp>
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
class IoFixture : public ClockFixture
|
||||
{
|
||||
private:
|
||||
void
|
||||
afterTick() final
|
||||
{
|
||||
if (m_io.stopped()) {
|
||||
#if BOOST_VERSION >= 106600
|
||||
m_io.restart();
|
||||
#else
|
||||
m_io.reset();
|
||||
#endif
|
||||
}
|
||||
m_io.poll();
|
||||
}
|
||||
|
||||
protected:
|
||||
boost::asio::io_service m_io;
|
||||
};
|
||||
|
||||
} // namespace tests
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_TOOLS_TESTS_IO_FIXTURE_HPP
|
||||
@@ -0,0 +1,117 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2020, Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
*
|
||||
* ndn-tools is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "tests/key-chain-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/util/io.hpp>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
using namespace ndn::security;
|
||||
|
||||
KeyChainFixture::KeyChainFixture()
|
||||
: m_keyChain("pib-memory:", "tpm-memory:")
|
||||
{
|
||||
}
|
||||
|
||||
KeyChainFixture::~KeyChainFixture()
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
for (const auto& certFile : m_certFiles) {
|
||||
boost::filesystem::remove(certFile, ec); // ignore error
|
||||
}
|
||||
}
|
||||
|
||||
Certificate
|
||||
KeyChainFixture::makeCert(const Key& key, const std::string& issuer, const Key& signingKey)
|
||||
{
|
||||
Certificate cert;
|
||||
cert.setName(Name(key.getName())
|
||||
.append(issuer)
|
||||
.appendVersion());
|
||||
|
||||
// set metainfo
|
||||
cert.setContentType(tlv::ContentType_Key);
|
||||
cert.setFreshnessPeriod(1_h);
|
||||
|
||||
// set content
|
||||
cert.setContent(key.getPublicKey().data(), key.getPublicKey().size());
|
||||
|
||||
// set signature info
|
||||
ndn::SignatureInfo info;
|
||||
auto now = time::system_clock::now();
|
||||
info.setValidityPeriod(ValidityPeriod(now - 30_days, now + 30_days));
|
||||
|
||||
m_keyChain.sign(cert, signingByKey(signingKey ? signingKey : key).setSignatureInfo(info));
|
||||
return cert;
|
||||
}
|
||||
|
||||
bool
|
||||
KeyChainFixture::saveCert(const Data& cert, const std::string& filename)
|
||||
{
|
||||
m_certFiles.push_back(filename);
|
||||
try {
|
||||
ndn::io::save(cert, filename);
|
||||
return true;
|
||||
}
|
||||
catch (const ndn::io::Error&) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
KeyChainFixture::saveIdentityCert(const Identity& identity, const std::string& filename)
|
||||
{
|
||||
Certificate cert;
|
||||
try {
|
||||
cert = identity.getDefaultKey().getDefaultCertificate();
|
||||
}
|
||||
catch (const Pib::Error&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return saveCert(cert, filename);
|
||||
}
|
||||
|
||||
bool
|
||||
KeyChainFixture::saveIdentityCert(const Name& identityName, const std::string& filename,
|
||||
bool allowCreate)
|
||||
{
|
||||
Identity id;
|
||||
try {
|
||||
id = m_keyChain.getPib().getIdentity(identityName);
|
||||
}
|
||||
catch (const Pib::Error&) {
|
||||
if (allowCreate) {
|
||||
id = m_keyChain.createIdentity(identityName);
|
||||
}
|
||||
}
|
||||
|
||||
if (!id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return saveIdentityCert(id, filename);
|
||||
}
|
||||
|
||||
} // namespace tests
|
||||
} // namespace ndn
|
||||
@@ -0,0 +1,93 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2020, Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
*
|
||||
* ndn-tools is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef NDN_TOOLS_TESTS_KEY_CHAIN_FIXTURE_HPP
|
||||
#define NDN_TOOLS_TESTS_KEY_CHAIN_FIXTURE_HPP
|
||||
|
||||
#include <ndn-cxx/security/key-chain.hpp>
|
||||
#include <ndn-cxx/security/signing-helpers.hpp>
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
/**
|
||||
* @brief A fixture providing an in-memory KeyChain.
|
||||
*
|
||||
* Test cases can use this fixture to create identities. Identities, certificates, and
|
||||
* saved certificates are automatically removed during test teardown.
|
||||
*/
|
||||
class KeyChainFixture
|
||||
{
|
||||
protected:
|
||||
using Certificate = ndn::security::Certificate;
|
||||
using Identity = ndn::security::Identity;
|
||||
using Key = ndn::security::Key;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Creates and returns a certificate for a given key
|
||||
* @param key The key for which to make a certificate
|
||||
* @param issuer The IssuerId to include in the certificate name
|
||||
* @param signingKey The key with which to sign the certificate; if not provided, the
|
||||
* certificate will be self-signed
|
||||
*/
|
||||
Certificate
|
||||
makeCert(const Key& key, const std::string& issuer, const Key& signingKey = Key());
|
||||
|
||||
/**
|
||||
* @brief Saves an NDN certificate to a file
|
||||
* @return true if successful, false otherwise
|
||||
*/
|
||||
bool
|
||||
saveCert(const Data& cert, const std::string& filename);
|
||||
|
||||
/**
|
||||
* @brief Saves the default certificate of @p identity to a file
|
||||
* @return true if successful, false otherwise
|
||||
*/
|
||||
bool
|
||||
saveIdentityCert(const Identity& identity, const std::string& filename);
|
||||
|
||||
/**
|
||||
* @brief Saves the default certificate of the identity named @p identityName to a file
|
||||
* @param identityName Name of the identity
|
||||
* @param filename File name, must be writable
|
||||
* @param allowCreate If true, create the identity if it does not exist
|
||||
* @return true if successful, false otherwise
|
||||
*/
|
||||
bool
|
||||
saveIdentityCert(const Name& identityName, const std::string& filename,
|
||||
bool allowCreate = false);
|
||||
|
||||
protected:
|
||||
KeyChainFixture();
|
||||
|
||||
~KeyChainFixture();
|
||||
|
||||
protected:
|
||||
ndn::KeyChain m_keyChain;
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_certFiles;
|
||||
};
|
||||
|
||||
} // namespace tests
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_TOOLS_TESTS_KEY_CHAIN_FIXTURE_HPP
|
||||
+14
-14
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2019, Arizona Board of Regents.
|
||||
* Copyright (c) 2014-2020, Arizona Board of Regents.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "tools/peek/ndnpeek/ndnpeek.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/io-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
|
||||
@@ -63,7 +64,7 @@ makeDefaultOptions()
|
||||
return opt;
|
||||
}
|
||||
|
||||
class NdnPeekFixture : public UnitTestTimeFixture
|
||||
class NdnPeekFixture : public IoFixture
|
||||
{
|
||||
protected:
|
||||
void
|
||||
@@ -73,8 +74,7 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
boost::asio::io_service io;
|
||||
ndn::util::DummyClientFace face{io};
|
||||
ndn::util::DummyClientFace face{m_io};
|
||||
output_test_stream output;
|
||||
unique_ptr<NdnPeek> peek;
|
||||
};
|
||||
@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Default, OutputCheck, OutputChecks)
|
||||
{
|
||||
CoutRedirector redir(output);
|
||||
peek->start();
|
||||
this->advanceClocks(io, 25_ms, 4);
|
||||
this->advanceClocks(25_ms, 4);
|
||||
face.receive(*data);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(NonDefault, OutputCheck, OutputChecks)
|
||||
{
|
||||
CoutRedirector redir(output);
|
||||
peek->start();
|
||||
this->advanceClocks(io, 25_ms, 4);
|
||||
this->advanceClocks(25_ms, 4);
|
||||
face.receive(*data);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(ReceiveNackWithReason, OutputCheck, OutputChecks)
|
||||
{
|
||||
CoutRedirector redir(output);
|
||||
peek->start();
|
||||
this->advanceClocks(io, 25_ms, 4);
|
||||
this->advanceClocks(25_ms, 4);
|
||||
nack = makeNack(face.sentInterests.at(0), lp::NackReason::NO_ROUTE);
|
||||
face.receive(nack);
|
||||
}
|
||||
@@ -224,7 +224,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(ReceiveNackWithoutReason, OutputCheck, OutputCheck
|
||||
{
|
||||
CoutRedirector redir(output);
|
||||
peek->start();
|
||||
this->advanceClocks(io, 25_ms, 4);
|
||||
this->advanceClocks(25_ms, 4);
|
||||
nack = makeNack(face.sentInterests.at(0), lp::NackReason::NONE);
|
||||
face.receive(nack);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE(ApplicationParameters)
|
||||
initialize(options);
|
||||
|
||||
peek->start();
|
||||
this->advanceClocks(io, 25_ms, 4);
|
||||
this->advanceClocks(25_ms, 4);
|
||||
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.back().getCanBePrefix(), false);
|
||||
@@ -262,12 +262,12 @@ BOOST_AUTO_TEST_CASE(NoTimeout)
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
|
||||
|
||||
peek->start();
|
||||
this->advanceClocks(io, 100_ms, 9);
|
||||
this->advanceClocks(100_ms, 9);
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 1);
|
||||
BOOST_CHECK_EQUAL(face.getNPendingInterests(), 1);
|
||||
BOOST_CHECK(peek->getResult() == NdnPeek::Result::UNKNOWN);
|
||||
|
||||
this->advanceClocks(io, 100_ms, 2);
|
||||
this->advanceClocks(100_ms, 2);
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 1);
|
||||
BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0);
|
||||
BOOST_CHECK(peek->getResult() == NdnPeek::Result::TIMEOUT);
|
||||
@@ -283,7 +283,7 @@ BOOST_AUTO_TEST_CASE(TimeoutLessThanLifetime)
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
|
||||
|
||||
peek->start();
|
||||
this->advanceClocks(io, 25_ms, 6);
|
||||
this->advanceClocks(25_ms, 6);
|
||||
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 1);
|
||||
BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0);
|
||||
@@ -300,7 +300,7 @@ BOOST_AUTO_TEST_CASE(TimeoutGreaterThanLifetime)
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
|
||||
|
||||
peek->start();
|
||||
this->advanceClocks(io, 25_ms, 4);
|
||||
this->advanceClocks(25_ms, 4);
|
||||
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 1);
|
||||
BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0);
|
||||
@@ -314,7 +314,7 @@ BOOST_AUTO_TEST_CASE(OversizedPacket)
|
||||
initialize(options);
|
||||
|
||||
peek->start();
|
||||
BOOST_CHECK_THROW(this->advanceClocks(io, 1_ms, 10), Face::OversizedPacketError);
|
||||
BOOST_CHECK_THROW(this->advanceClocks(1_ms, 10), Face::OversizedPacketError);
|
||||
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
|
||||
}
|
||||
|
||||
+21
-21
@@ -26,7 +26,8 @@
|
||||
#include "tools/peek/ndnpoke/ndnpoke.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/identity-management-fixture.hpp"
|
||||
#include "tests/io-fixture.hpp"
|
||||
#include "tests/key-chain-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
|
||||
@@ -37,7 +38,7 @@ namespace tests {
|
||||
using namespace ndn::tests;
|
||||
|
||||
template<bool WANT_PREFIX_REG_REPLY = true>
|
||||
class NdnPokeFixture : public IdentityManagementTimeFixture
|
||||
class NdnPokeFixture : public IoFixture, public KeyChainFixture
|
||||
{
|
||||
protected:
|
||||
NdnPokeFixture()
|
||||
@@ -60,8 +61,7 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
boost::asio::io_service io;
|
||||
ndn::util::DummyClientFace face{io, m_keyChain, {true, WANT_PREFIX_REG_REPLY}};
|
||||
ndn::util::DummyClientFace face{m_io, m_keyChain, {true, WANT_PREFIX_REG_REPLY}};
|
||||
std::stringstream payload{"Hello, world!\n"};
|
||||
unique_ptr<NdnPoke> poke;
|
||||
};
|
||||
@@ -74,14 +74,14 @@ BOOST_AUTO_TEST_CASE(Basic)
|
||||
initialize();
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
// Check for prefix registration
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register");
|
||||
|
||||
face.receive(*makeInterest("/poke/test"));
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
|
||||
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
|
||||
@@ -102,16 +102,16 @@ BOOST_AUTO_TEST_CASE(NoMatch)
|
||||
initialize();
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
face.receive(*makeInterest("/poke/test/foo"));
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::UNKNOWN);
|
||||
BOOST_CHECK_EQUAL(face.sentData.size(), 0);
|
||||
|
||||
face.receive(*makeInterest("/poke/test"));
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
|
||||
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
|
||||
@@ -125,10 +125,10 @@ BOOST_AUTO_TEST_CASE(FreshnessPeriod)
|
||||
initialize(options);
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
face.receive(*makeInterest("/poke/test"));
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
|
||||
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
|
||||
@@ -146,10 +146,10 @@ BOOST_AUTO_TEST_CASE(FinalBlockId)
|
||||
initialize(options);
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
face.receive(*makeInterest(options.name));
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
|
||||
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
|
||||
@@ -167,10 +167,10 @@ BOOST_AUTO_TEST_CASE(DigestSha256)
|
||||
initialize(options);
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
face.receive(*makeInterest("/poke/test"));
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
|
||||
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
|
||||
@@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(Unsolicited)
|
||||
initialize(options);
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
|
||||
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
|
||||
@@ -204,13 +204,13 @@ BOOST_AUTO_TEST_CASE(Timeout)
|
||||
initialize(options);
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
// Check for prefix registration
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register");
|
||||
|
||||
this->advanceClocks(io, 1_s, 4);
|
||||
this->advanceClocks(1_s, 4);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::TIMEOUT);
|
||||
BOOST_CHECK_EQUAL(face.sentData.size(), 0);
|
||||
@@ -225,13 +225,13 @@ BOOST_FIXTURE_TEST_CASE(PrefixRegTimeout, NdnPokeFixture<false>)
|
||||
initialize();
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
// Check for prefix registration
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
|
||||
BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register");
|
||||
|
||||
this->advanceClocks(io, 1_s, 10);
|
||||
this->advanceClocks(1_s, 10);
|
||||
|
||||
BOOST_CHECK(poke->getResult() == NdnPoke::Result::PREFIX_REG_FAIL);
|
||||
BOOST_CHECK_EQUAL(face.sentData.size(), 0);
|
||||
@@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(OversizedPacket)
|
||||
initialize();
|
||||
|
||||
poke->start();
|
||||
this->advanceClocks(io, 1_ms, 10);
|
||||
this->advanceClocks(1_ms, 10);
|
||||
|
||||
face.receive(*makeInterest("/poke/test"));
|
||||
BOOST_CHECK_THROW(face.processEvents(), Face::OversizedPacketError);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2019, Arizona Board of Regents.
|
||||
* Copyright (c) 2014-2020, Arizona Board of Regents.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "tools/ping/client/ping.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/io-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
|
||||
namespace ndn {
|
||||
@@ -34,20 +36,18 @@ BOOST_AUTO_TEST_SUITE(TestPing)
|
||||
|
||||
using ping::client::Ping;
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(Basic, UnitTestTimeFixture)
|
||||
BOOST_FIXTURE_TEST_CASE(Basic, IoFixture)
|
||||
{
|
||||
util::DummyClientFace face(m_io, {true, true});
|
||||
Options pingOptions;
|
||||
pingOptions.prefix = "ndn:/test-prefix";
|
||||
pingOptions.prefix = "/test-prefix";
|
||||
pingOptions.shouldAllowStaleData = false;
|
||||
pingOptions.shouldGenerateRandomSeq = false;
|
||||
pingOptions.shouldPrintTimestamp = false;
|
||||
pingOptions.nPings = 4;
|
||||
pingOptions.interval = time::milliseconds(100);
|
||||
pingOptions.timeout = time::milliseconds(2000);
|
||||
pingOptions.interval = 100_ms;
|
||||
pingOptions.timeout = 2_s;
|
||||
pingOptions.startSeq = 1000;
|
||||
|
||||
boost::asio::io_service io;
|
||||
util::DummyClientFace face(io, {true, true});
|
||||
Ping ping(face, pingOptions);
|
||||
|
||||
int nFinishSignals = 0;
|
||||
@@ -73,29 +73,24 @@ BOOST_FIXTURE_TEST_CASE(Basic, UnitTestTimeFixture)
|
||||
|
||||
ping.start();
|
||||
|
||||
this->advanceClocks(io, time::milliseconds(1), 500);
|
||||
this->advanceClocks(1_ms, 500);
|
||||
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 4);
|
||||
|
||||
auto data = makeData("/test-prefix/ping/1000");
|
||||
data->setFreshnessPeriod(1_s);
|
||||
face.receive(*data);
|
||||
|
||||
lp::Nack nack(face.sentInterests[1]);
|
||||
nack.setReason(lp::NackReason::DUPLICATE);
|
||||
face.receive(nack);
|
||||
face.receive(makeNack(face.sentInterests[1], lp::NackReason::DUPLICATE));
|
||||
|
||||
data = makeData("/test-prefix/ping/1002");
|
||||
data->setFreshnessPeriod(1_s);
|
||||
face.receive(*data);
|
||||
|
||||
this->advanceClocks(io, time::milliseconds(100), 20);
|
||||
this->advanceClocks(100_ms, 20);
|
||||
|
||||
// ndn:/test-prefix/ping/1003 is unanswered and will timeout
|
||||
// /test-prefix/ping/1003 is unanswered and will timeout
|
||||
|
||||
BOOST_CHECK_EQUAL(nFinishSignals, 1);
|
||||
|
||||
face.shutdown();
|
||||
io.stop();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END() // TestPing
|
||||
|
||||
+20
-18
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2015-2018, Arizona Board of Regents.
|
||||
* Copyright (c) 2015-2020, Arizona Board of Regents.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
@@ -17,10 +17,13 @@
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "tools/ping/server/ping-server.hpp"
|
||||
#include "tools/ping/client/ping.hpp"
|
||||
#include "tools/ping/server/ping-server.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/io-fixture.hpp"
|
||||
#include "tests/key-chain-fixture.hpp"
|
||||
|
||||
#include "tests/identity-management-fixture.hpp"
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
|
||||
namespace ndn {
|
||||
@@ -29,25 +32,25 @@ namespace tests {
|
||||
|
||||
using namespace ndn::tests;
|
||||
|
||||
class PingIntegratedFixture : public IdentityManagementTimeFixture
|
||||
class PingIntegratedFixture : public IoFixture, public KeyChainFixture
|
||||
{
|
||||
public:
|
||||
PingIntegratedFixture()
|
||||
: serverFace(io, m_keyChain, {false, true})
|
||||
, clientFace(io, m_keyChain, {false, true})
|
||||
: serverFace(m_io, m_keyChain, {false, true})
|
||||
, clientFace(m_io, m_keyChain, {false, true})
|
||||
, wantLoss(false)
|
||||
{
|
||||
serverFace.onSendInterest.connect([this] (const Interest& interest) {
|
||||
io.post([=] { if (!wantLoss) { clientFace.receive(interest); } });
|
||||
m_io.post([=] { if (!wantLoss) { clientFace.receive(interest); } });
|
||||
});
|
||||
clientFace.onSendInterest.connect([this] (const Interest& interest) {
|
||||
io.post([=] { if (!wantLoss) { serverFace.receive(interest); } });
|
||||
m_io.post([=] { if (!wantLoss) { serverFace.receive(interest); } });
|
||||
});
|
||||
serverFace.onSendData.connect([this] (const Data& data) {
|
||||
io.post([=] { if (!wantLoss) { clientFace.receive(data); } });
|
||||
m_io.post([=] { if (!wantLoss) { clientFace.receive(data); } });
|
||||
});
|
||||
clientFace.onSendData.connect([this] (const Data& data) {
|
||||
io.post([=] { if (!wantLoss) { serverFace.receive(data); } });
|
||||
m_io.post([=] { if (!wantLoss) { serverFace.receive(data); } });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,11 +58,10 @@ public:
|
||||
{
|
||||
serverFace.shutdown();
|
||||
clientFace.shutdown();
|
||||
io.stop();
|
||||
m_io.stop();
|
||||
}
|
||||
|
||||
public:
|
||||
boost::asio::io_service io;
|
||||
util::DummyClientFace serverFace;
|
||||
util::DummyClientFace clientFace;
|
||||
std::unique_ptr<server::PingServer> server;
|
||||
@@ -92,11 +94,11 @@ BOOST_FIXTURE_TEST_CASE(Normal, PingIntegratedFixture)
|
||||
clientOpts.timeout = 2_s;
|
||||
clientOpts.startSeq = 1000;
|
||||
client = make_unique<client::Ping>(clientFace, clientOpts);
|
||||
client->afterFinish.connect(bind(&PingIntegratedFixture::onFinish, this));
|
||||
client->afterFinish.connect([this] { onFinish(); });
|
||||
client->start();
|
||||
|
||||
advanceClocks(io, 1_ms, 400);
|
||||
io.run();
|
||||
advanceClocks(1_ms, 400);
|
||||
m_io.run();
|
||||
|
||||
BOOST_CHECK_EQUAL(4, server->getNPings());
|
||||
}
|
||||
@@ -125,11 +127,11 @@ BOOST_FIXTURE_TEST_CASE(Timeout, PingIntegratedFixture)
|
||||
clientOpts.timeout = 500_ms;
|
||||
clientOpts.startSeq = 1000;
|
||||
client = make_unique<client::Ping>(clientFace, clientOpts);
|
||||
client->afterFinish.connect(bind(&PingIntegratedFixture::onFinish, this));
|
||||
client->afterFinish.connect([this] { onFinish(); });
|
||||
client->start();
|
||||
|
||||
advanceClocks(io, 1_ms, 1000);
|
||||
io.run();
|
||||
advanceClocks(1_ms, 1000);
|
||||
m_io.run();
|
||||
|
||||
BOOST_CHECK_EQUAL(0, server->getNPings());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2018, Arizona Board of Regents.
|
||||
* Copyright (c) 2014-2020, Arizona Board of Regents.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
@@ -20,7 +20,8 @@
|
||||
#include "tools/ping/server/ping-server.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "../../identity-management-fixture.hpp"
|
||||
#include "tests/io-fixture.hpp"
|
||||
#include "tests/key-chain-fixture.hpp"
|
||||
|
||||
#include <ndn-cxx/util/dummy-client-face.hpp>
|
||||
|
||||
@@ -34,11 +35,11 @@ using namespace ndn::tests;
|
||||
BOOST_AUTO_TEST_SUITE(Ping)
|
||||
BOOST_AUTO_TEST_SUITE(TestPingServer)
|
||||
|
||||
class CreatePingServerFixture : public IdentityManagementTimeFixture
|
||||
class CreatePingServerFixture : public IoFixture, public KeyChainFixture
|
||||
{
|
||||
protected:
|
||||
CreatePingServerFixture()
|
||||
: face(io, m_keyChain, {false, true})
|
||||
: face(m_io, m_keyChain, {false, true})
|
||||
, pingOptions(makeOptions())
|
||||
, pingServer(face, m_keyChain, pingOptions)
|
||||
{
|
||||
@@ -72,7 +73,6 @@ private:
|
||||
}
|
||||
|
||||
protected:
|
||||
boost::asio::io_service io;
|
||||
util::DummyClientFace face;
|
||||
Options pingOptions;
|
||||
PingServer pingServer;
|
||||
@@ -83,12 +83,12 @@ BOOST_FIXTURE_TEST_CASE(CreatePingServer, CreatePingServerFixture)
|
||||
BOOST_REQUIRE_EQUAL(0, pingServer.getNPings());
|
||||
pingServer.start();
|
||||
|
||||
advanceClocks(io, 1_ms, 200);
|
||||
advanceClocks(1_ms, 200);
|
||||
|
||||
face.receive(makePingInterest(1000));
|
||||
face.receive(makePingInterest(1001));
|
||||
|
||||
io.run();
|
||||
m_io.run();
|
||||
|
||||
BOOST_CHECK_EQUAL(2, pingServer.getNPings());
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
//#include "unit-under-test.hpp"
|
||||
|
||||
#include "tests/test-common.hpp"
|
||||
#include "tests/io-fixture.hpp" // optional, for IoFixture
|
||||
//#include "tests/key-chain-fixture.hpp" // optional, for KeyChainFixture
|
||||
|
||||
namespace ndn {
|
||||
namespace tool_name {
|
||||
@@ -46,12 +48,11 @@ BOOST_AUTO_TEST_CASE(Test1)
|
||||
BOOST_CHECK_EQUAL(i, 1);
|
||||
}
|
||||
|
||||
// Use UnitTestTimeFixture to mock clocks.
|
||||
BOOST_FIXTURE_TEST_CASE(Test2, UnitTestTimeFixture)
|
||||
// Use ClockFixture or IoFixture to mock clocks.
|
||||
BOOST_FIXTURE_TEST_CASE(Test2, IoFixture)
|
||||
{
|
||||
// advanceClocks() increments mock clocks.
|
||||
boost::asio::io_service io;
|
||||
this->advanceClocks(io, time::milliseconds(500));
|
||||
advanceClocks(500_ms);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
+9
-54
@@ -23,64 +23,20 @@
|
||||
* ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "test-common.hpp"
|
||||
|
||||
#include <ndn-cxx/security/signature-sha256-with-rsa.hpp>
|
||||
#include "tests/test-common.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
UnitTestTimeFixture::UnitTestTimeFixture()
|
||||
: steadyClock(make_shared<time::UnitTestSteadyClock>())
|
||||
, systemClock(make_shared<time::UnitTestSystemClock>())
|
||||
{
|
||||
time::setCustomClocks(steadyClock, systemClock);
|
||||
}
|
||||
|
||||
UnitTestTimeFixture::~UnitTestTimeFixture()
|
||||
{
|
||||
time::setCustomClocks(nullptr, nullptr);
|
||||
}
|
||||
|
||||
void
|
||||
UnitTestTimeFixture::advanceClocks(boost::asio::io_service& io,
|
||||
time::nanoseconds tick, size_t nTicks)
|
||||
{
|
||||
this->advanceClocks(io, tick, tick * nTicks);
|
||||
}
|
||||
|
||||
void
|
||||
UnitTestTimeFixture::advanceClocks(boost::asio::io_service& io,
|
||||
time::nanoseconds tick, time::nanoseconds total)
|
||||
{
|
||||
BOOST_ASSERT(tick > time::nanoseconds::zero());
|
||||
BOOST_ASSERT(total >= time::nanoseconds::zero());
|
||||
|
||||
time::nanoseconds remaining = total;
|
||||
while (remaining > time::nanoseconds::zero()) {
|
||||
if (remaining >= tick) {
|
||||
steadyClock->advance(tick);
|
||||
systemClock->advance(tick);
|
||||
remaining -= tick;
|
||||
}
|
||||
else {
|
||||
steadyClock->advance(remaining);
|
||||
systemClock->advance(remaining);
|
||||
remaining = time::nanoseconds::zero();
|
||||
}
|
||||
|
||||
if (io.stopped())
|
||||
io.reset();
|
||||
io.poll();
|
||||
}
|
||||
}
|
||||
|
||||
shared_ptr<Interest>
|
||||
makeInterest(const Name& name, bool canBePrefix, time::milliseconds lifetime,
|
||||
makeInterest(const Name& name, bool canBePrefix, optional<time::milliseconds> lifetime,
|
||||
optional<Interest::Nonce> nonce)
|
||||
{
|
||||
auto interest = make_shared<Interest>(name, lifetime);
|
||||
auto interest = std::make_shared<Interest>(name);
|
||||
interest->setCanBePrefix(canBePrefix);
|
||||
if (lifetime) {
|
||||
interest->setInterestLifetime(*lifetime);
|
||||
}
|
||||
interest->setNonce(nonce);
|
||||
return interest;
|
||||
}
|
||||
@@ -88,16 +44,15 @@ makeInterest(const Name& name, bool canBePrefix, time::milliseconds lifetime,
|
||||
shared_ptr<Data>
|
||||
makeData(const Name& name)
|
||||
{
|
||||
auto data = make_shared<Data>(name);
|
||||
auto data = std::make_shared<Data>(name);
|
||||
return signData(data);
|
||||
}
|
||||
|
||||
Data&
|
||||
signData(Data& data)
|
||||
{
|
||||
ndn::SignatureSha256WithRsa fakeSignature;
|
||||
fakeSignature.setValue(ndn::encoding::makeEmptyBlock(tlv::SignatureValue));
|
||||
data.setSignature(fakeSignature);
|
||||
data.setSignatureInfo(SignatureInfo(tlv::NullSignature));
|
||||
data.setSignatureValue(std::make_shared<Buffer>());
|
||||
data.wireEncode();
|
||||
return data;
|
||||
}
|
||||
|
||||
+29
-50
@@ -26,73 +26,36 @@
|
||||
#ifndef NDN_TOOLS_TESTS_TEST_COMMON_HPP
|
||||
#define NDN_TOOLS_TESTS_TEST_COMMON_HPP
|
||||
|
||||
#include "boost-test.hpp"
|
||||
#include "core/common.hpp"
|
||||
|
||||
#include <ndn-cxx/util/time-unit-test-clock.hpp>
|
||||
#include "tests/boost-test.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace tests {
|
||||
|
||||
/** \brief a test fixture that overrides steady clock and system clock
|
||||
*/
|
||||
class UnitTestTimeFixture
|
||||
{
|
||||
protected:
|
||||
UnitTestTimeFixture();
|
||||
|
||||
~UnitTestTimeFixture();
|
||||
|
||||
/** \brief advance steady and system clocks
|
||||
*
|
||||
* Clocks are advanced in increments of \p tick for \p nTicks ticks.
|
||||
* After each tick, the supplied io_service is polled to process pending I/O events.
|
||||
*
|
||||
* Exceptions thrown during I/O events are propagated to the caller.
|
||||
* Clock advancing would stop in case of an exception.
|
||||
*/
|
||||
void
|
||||
advanceClocks(boost::asio::io_service& io,
|
||||
time::nanoseconds tick, size_t nTicks = 1);
|
||||
|
||||
/** \brief advance steady and system clocks
|
||||
*
|
||||
* Clocks are advanced in increments of \p tick for \p total time.
|
||||
* The last increment might be shorter than \p tick.
|
||||
* After each tick, the supplied io_service is polled to process pending I/O events.
|
||||
*
|
||||
* Exceptions thrown during I/O events are propagated to the caller.
|
||||
* Clock advancing would stop in case of an exception.
|
||||
*/
|
||||
void
|
||||
advanceClocks(boost::asio::io_service& io,
|
||||
time::nanoseconds tick, time::nanoseconds total);
|
||||
|
||||
protected:
|
||||
shared_ptr<time::UnitTestSteadyClock> steadyClock;
|
||||
shared_ptr<time::UnitTestSystemClock> systemClock;
|
||||
};
|
||||
|
||||
/** \brief create an Interest
|
||||
/**
|
||||
* \brief Create an Interest
|
||||
*/
|
||||
shared_ptr<Interest>
|
||||
makeInterest(const Name& name, bool canBePrefix = false,
|
||||
time::milliseconds lifetime = DEFAULT_INTEREST_LIFETIME,
|
||||
optional<time::milliseconds> lifetime = nullopt,
|
||||
optional<Interest::Nonce> nonce = nullopt);
|
||||
|
||||
/** \brief create a Data with fake signature
|
||||
* \note Data may be modified afterwards without losing the fake signature.
|
||||
* If a real signature is desired, sign again with KeyChain.
|
||||
/**
|
||||
* \brief Create a Data with a null (i.e., empty) signature
|
||||
*
|
||||
* If a "real" signature is desired, use KeyChainFixture and sign again with `m_keyChain`.
|
||||
*/
|
||||
shared_ptr<Data>
|
||||
makeData(const Name& name);
|
||||
|
||||
/** \brief add a fake signature to Data
|
||||
/**
|
||||
* \brief Add a null signature to \p data
|
||||
*/
|
||||
Data&
|
||||
signData(Data& data);
|
||||
|
||||
/** \brief add a fake signature to Data
|
||||
/**
|
||||
* \brief Add a null signature to \p data
|
||||
*/
|
||||
inline shared_ptr<Data>
|
||||
signData(shared_ptr<Data> data)
|
||||
@@ -101,11 +64,27 @@ signData(shared_ptr<Data> data)
|
||||
return data;
|
||||
}
|
||||
|
||||
/** \brief create a Nack
|
||||
/**
|
||||
* \brief Create a Nack
|
||||
*/
|
||||
lp::Nack
|
||||
makeNack(Interest interest, lp::NackReason reason);
|
||||
|
||||
/**
|
||||
* \brief Replace a name component in a packet
|
||||
* \param[inout] pkt the packet
|
||||
* \param index the index of the name component to replace
|
||||
* \param args arguments to name::Component constructor
|
||||
*/
|
||||
template<typename Packet, typename ...Args>
|
||||
void
|
||||
setNameComponent(Packet& pkt, ssize_t index, Args&& ...args)
|
||||
{
|
||||
Name name = pkt.getName();
|
||||
name.set(index, name::Component(std::forward<Args>(args)...));
|
||||
pkt.setName(name);
|
||||
}
|
||||
|
||||
} // namespace tests
|
||||
} // namespace ndn
|
||||
|
||||
|
||||
+2
-2
@@ -5,11 +5,11 @@ def build(bld):
|
||||
if not bld.env.WITH_TESTS:
|
||||
return
|
||||
|
||||
tmp_path = 'TMP_TESTS_PATH="%s"' % bld.bldnode.make_node('tmp-files')
|
||||
tmpdir = 'UNIT_TESTS_TMPDIR="%s"' % bld.bldnode.make_node('tmp-files')
|
||||
bld.program(
|
||||
target='../unit-tests',
|
||||
name='unit-tests',
|
||||
source=bld.path.ant_glob(['*.cpp'] + ['%s/**/*.cpp' % tool for tool in bld.env.BUILD_TOOLS]),
|
||||
use=['core-objects'] + ['%s-objects' % tool for tool in bld.env.BUILD_TOOLS],
|
||||
defines=[tmp_path],
|
||||
defines=[tmpdir],
|
||||
install_path=None)
|
||||
@@ -32,13 +32,13 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import os, sys, inspect
|
||||
|
||||
VERSION="2.0.19"
|
||||
REVISION="1f3c580272b15a03d2566843c5fe872a"
|
||||
GIT="61ee22b598cf80e260beb64e475966f58b304d0d"
|
||||
VERSION="2.0.21"
|
||||
REVISION="16cd196b0fc7b4eebe195ce20396f3d1"
|
||||
GIT="86eea788e3210f6681a827cda931089da04e06c1"
|
||||
INSTALL=''
|
||||
C1='#6'
|
||||
C2='#.'
|
||||
C3='#%'
|
||||
C1='#2'
|
||||
C2='#/'
|
||||
C3='#-'
|
||||
cwd = os.getcwd()
|
||||
join = os.path.join
|
||||
|
||||
@@ -168,6 +168,6 @@ if __name__ == '__main__':
|
||||
Scripting.waf_entry_point(cwd, VERSION, wafdir)
|
||||
|
||||
#==>
|
||||
#BZh91AY&SY9 ½´\¥ÿÿÿ³DPÿÿÿÿÿÿÿÿÿÿÿm (¬#%0�0e€(b÷/mЀ#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%öÞúzómmkîÖZžÞæ—²U#.´[iÚ¾î�õ¹±µ–ú:¥'kd‹î7{ÛïoºµÛ¶ÖµK“¹]Øvµ'ÛßO¾ö¸gv÷s½÷¶N)#.Q+Ù½íp·µÞ�]/{mš»<{guÒ‹@Ýó{§«�vo;¾ø;ŸvÎiîáÉî44lºï{ß|ûëËßÚU9íõÝŸÝšî·¯y½÷½x#%#%@(}ìh#%` ï²€=â�wfí˜:4§[aÓ¹½ y©³A¦€‡¸ê»´ö4=¦öìd+Ö¨ª)ífš0#6 *”¢”{ƒ’�Q$#%#6#%YJ�zÚV½ƒ%çÍíîæ}»�j½êºa’ïjÚØá3TTf˦Iv×]s}6óu7¾÷z:#.ÎxûÝW_=³ÛzÖåZ;Û»ÍÝÛ}Þsy¾¯³»ß{¸ûížÖîiÉÔ÷Ëzõ¶§rç>^æû}ñ¾íóÛa zúz{x¹-ì�z̀ݳֲ4÷³¼ÛÞ÷fÞÏs¬ô`u¡ÒãF°Û"’EE7w¼#%(J*’OCÀ#%lîè•=÷n{Ywº¹½»ÐdÜöï>}Ü[vÇGÐ`>†ÛEmk®¥ÑMã�W`×LæyÛãÚ^u½#%}�÷aŽît;o¶û}|{mçO—vpòǼ΀Šo·*WµíƘܶ2>öí®®òÏŸwÖõ»]´î;ºjîí9QÚt×·Zt“ž>÷»Ü®¨ÜÙu÷‡ß|}í«×ܬ‰&ÞíN«îq\îû½:¾Ã.ñŽ^ÙéyaC§¶Ó¶Û›—³®÷Ð¥&nCzî¤|öilöͶíÝîвë[¸˜÷»³Ûºû5ÖkoX«èqØ—nöÐlîõÞÞ/`{´žó½wÌ>ï†Ðê¥PJªPTT´jB¹7uÐv�&i¶vÜèº]vú‰Ý›:kÛkÔØëUUܘ{x÷š)º¼»HЃºÚɯfw€#%7ZI#%#%;Ü^êåÉÎó²û3ÊF-Ÿm½ÜözÔíÝ™Üì_U.us[›¶õv]]ó¸|˜Hû†,ÍqÑ»ÝÁæñ{c;úŒçvåJº{+¹éÔ²õ§l÷+ªWg¡»`úùÛÙ;{n#î²Ç]÷}çww»{»»xîvÛ#.¾Øú½mÝEfù‡"sž¼ï¯¼ùÚÀ°ËlÐú$/g¬íÑ”x<ïÜë°VØ6EÇ‘µÞ®ÚGxO{×>öø½ïwÞ´#%À*×Û;Fªµíí7¶;g�<�ÂÀëu´oSk´ÝëÓmï 9.ó’®Ú×ݬ»Ý¾çwÅówwtåvë¥Þç:#.[.ëwc Ó‚àéÕhÁ”gu“½Þ^ïŸnØu¼�ÓÐŒ…/=ÝÚ4#%•c�¹éî½Mö{ÜàìJ…U )½{xW»´×`ï{®ñÝÊäÅÖÃV¶•U[}÷IzovƒuÇH*Ší·u$ëIÒÖªîúãÞncÚ[ÓµŽÛ× &Æ»»}öøø‡½óí·³acÜ| ìÁ“G»îñÌͼÜ&:·»}½í6µî�Ðíç;ï¹ßvÛRÀîï·Ÿw}-âò�ó[ãnh€ &€#%&€ £CBa0š#.#%‰ä™PÏTz†Ðš#%õ§’{SÔõA) B @†@©©á$zzI☠é4#%#%#%#%#%#%#%‚D! M5TÿMŠoU<ÔôzTý(òÔõ)é¨mG¨#%#%Ñ£@#%#%'ªRD!4dÐODõ$ÙOFž¡£õM#.€ò@#.Sj#%#%#%#%#%#%$!#%&@bh&M#%M#.4SÓiˆŒ4 ¢ #%h#%#%#%I¨ˆ L˜#Až€&Œ¦�=&”õmêˆ{SIé” h#%d4#%È#%—ÿÓ?£Uirê\ÕQWwk¹úµZvhʃ>5Zu!LA³ ,L•Q*"€)æ°Pcõ§óü Zü“•5OùÓ¦¸ üæJt¦î£Ä‘8•WoT"¢]^SÌÆ´_3ý†os2ìÀlDs‚4;m»qE6›®ñ‘ÎÊ´ÚMí˜ÖØ`Vd…â]jíâ—˜•5o‚# åñ÷UŒI7wD¼áÌKUå¦/žÝ~«oÔB�äE"ªSº»U¦ÖÖ5k3khÈ‹ €7#%H*-E Õ:¥”$HŠ&� ˆ" HåP° !ß#%hŠ–‚¡#%ª$@dPÉ@mªfL…’ŒÍCLÓd@M$Rj6Ñ35–25)F”Sm&‰š$ÐJ2Zš�Q°h[Fi,ši¢Z!#.F)iM€F¥�#.1eM£DRl–�¨Š–ZSMh�ˆYi#.š ƒ(ÌÌcRF£Qµ&ƒJl†BjcI@˜hÒËHÆR›F¦›"[M¶³U´i˜’ÆfLÈM&²m¦ÛM6�5%)-5±–¦Û3fZL“1‘f´ÄÑd¢‚™l‰B!Qf‘´R`4TH!`ؤ©„f•Jb0lB ‘X�hdFIR&B4±ClÍ’&)BF�RÊËf$@ÒYŠY5“ccE�#6‘d†K) -)¦ ±%&EDš2hhɉIF‘(�$@VAM�Eˆ¢fRÒ¦`›É؉1MÍ‚ab6¤Ø–V‹$”›‚$´”PRD•’%¤Q0Ea�ÆIL# ”&RJME™±£XHÒjH’b iM�$"H²[bË2ŠFÌ’‰²™3bdE(Í‘˜&U4Ä�‹)A³Q`,�i¦†Æ"5+%’6(”R"šIˆ&¤a³L�cI¡ &¤–Q”Ôi3HÚ("šh¢kP,&YA¤²2‹%&DÐM2‘*4f6”)1¨6ÄÊA! "“1�F4,�Ë ŠÙ&TÌÕ˜£l¥±(‰™#.H¦!HŒØÐ¡YM$QF¤É&ÉØÆJšF¦h±b2’™˜²2³i„¬D`ˆ¢JM52i™!Œ¢)#.š1Sb‹5*R’š)#.‘“2)´…HÅ(ÊHR"‹E$˜’M)´i5DŠFÀ˜Œh&Ti¦DÚ#.ƒ,„Òe‹DÈY‘¦ÉJb”D!f™ k6lmd°$4–Ld5EPZ XR$Ècc1 Â2ƒRXÔY¤J&ŒE©M(Z˜hI™IŠ$2ɲ#)‚E,Ñ¥1„5„²e"$4M¶¦¶´`™BjfŒ¦F&”RLȈ¥6À¥š,Å&‘”%–TÙ¢-L¬-”bC؈RˆšD#HJm~Ãk¢¦©aˆÍ¢ŒlVƶ*6L¥4ÔR¤š44´…¨ØFÉ5Y†¡¦c(ÉS*H¶D‰™¦[%´Q‰IKQµ…£&˜D±5˜±acR#6e¥™2eI´*Ò4TÙB+dË"©TÒT›63š¶,Y“L¬‰S,¦ÖJ²ÙJSL�l�’‘µ)¬±%¤2RÔZ ªŒ!¨Õ£%AEVMd£jŠÅEH”kDÑ$m‹hÅŠÔl2ѵ�€´™0°U@i€”R £F2™&•¦±Æ�¦&±‹d‹i Õª–µ–* ”ÍKY4IR1!M¤lY"¶¥Y¶1Jm*–R¦YaZšDF¶•K"e5MM¶„”Êk,Xl²k+,…lÓ ¨ÒD…�bÃ4˜‰!´…-£T%¢†KQY&š6LšJ,ˆ&ËŠl¤#."+,‚E1”ÌJ”lÓ4AE¢Ó$&Fm6“F6ÆÈS¦™cE%bHÌÔ#!4LÔQ¢JdR�–P5BTÀ4˜Ó J™²Bj-#636£)F̤’Œ�£!HbÊkÃi4F5&Éa$YP…-4)Äš4Y”©””²•˜d¬aš,‘±jE¨Õ5£4ECF¥)6b¥�fQj4 2ÆA¦&Ä•%I”1Ršcd�¤Ía)ME`Û0Ù¤²lf“E�˜‰CJ2Zfµ‘hTÍ2–H’l£0D2hªih�¬Òl”Ä,LDÒRBAh´[ Q¨ÔQŠÆ-–ÃI†’M#6L�ŒRˆ#b��-f›C2ˆ6*2%,¤©‘Ñ´k£TI¢„Ë5EŠ$Ôš£PdðŒj”¡kA¥4Ë!E$ЦIh‚5Eˆ±JÛ"¥F±¤ÁdÑÌ¡jQHfJ$©±(‰•j#V#.2,Y*6Œ)‹4¢Ù2V-&)+)¶D¶M�¡¢T’™R¢Âƒccd£dÑ&#¶H�ÔRLÁ¬ÉƒA#6�)³6&"𯍩•“Y‘¤)¤šŠ¢Š&›RV-”’ÆÉˆ£F‚4˜2JÔˆÑie£he¨’Ñjб”£i5² …Q¶5%)ЙÈ̌ƚ‘�LÙ&kDlU%‹hÔ•,«&´LÚ�1lj £cc$UE2©¥XÚ6��¶1mI˜ÊQ f²±-F+iQµ´©QJV”f*šB(4X"J�&ØÖ,Ê’+I[M²“+F�bbÑI�E[l¶¬R&T*&$¢1PÀ"CF�Ši&ÔÃ%XÛØ´Í[F5¬´•42ÖÊY6ÔÔÛ!mI¦¬ME26’QA°ÖjMI™²Êˆ B¢LI&RLˆÈÄd"Ù-¢Ñ‚±“þn··ýÔ¥C)þB51jÄÿTqôe+(a(Æh”‡÷!þ§ ûbåÕ LÿL$hÒlùNzí¿Îó±½9¿‹øºô·¦SUIPª?ë[ŒlÈŸÎÿ·ÖYLâsÈ †ßùë;�L(0\:8À¥‰pÁI äˆd˜*ƒ‰Ãß±¢rý*¤çÿœ3ÿ³ôZÑÿÊI(R×+ˆ½”g™,$b/Í0ÿ-‹npz%ZM‡¼íõâ8ßwB¹ÁŒ¨d~ËÕ‹NØœ“ÆZþ,3cRR(l“ŠrrXˆþúݳf¤áV…cÈÌ`I¥Û"lÆLhƒcôzç““G]“¼î�˜Þ¹w§¥^¥ã\³�Ë/âuçåu™Í\‚LŠëP¦"W‹4LªvcK™@¥JAF&Ä“M‚ê×bÈ‹Ò3ˆ(êñç]¨eñnY½74h6m`Ù—(c2@sªªzoþÝ(‘ 7p‡Êc#6Gv…)†ì,`¼rÂü®R[ŒR}ßÒëdzçgsÅéšÐN×VÄQL0¦Ð¤Y;ùd«Ïô8$ÚÍÏ£˜ØÐØžj¤Ï(%?·râƒþ°Ãµ“ºÀ¡…†JÅxžß÷k¶Œ¶cÂx-›2KËw%€•¬C°UyáyÜ–íÞw^QŽr車esn–CQW6éçqllO²ëå5¼Z4EA¯»ºŸ?_ÆW‹ò-ȦWÅȶÆåÈIºÕø¼u‘¨Û?Go*„Èyùæ|m<™b#4L9cuPEX°ž«©#.¹t@#6A�!´ä#ñÆ#.¯)ÎãÂHˆÃz”^+›Ý\Ѩ8šë•ÞwcrŽ•Ë™(Ë®é$s™5öø‘ZA„�ÿhÿŒJrÈ.YÚlCÙ’,0!MðÛtÉÈe«#6ýR�‹ÁÃ79ô,ýפ�¾ìÉþ˜FtÃÏxV¬@Gô¡€dž%lþ «p’—<kìÄ9 c£ðÐÃ|¶Ç™“#tE]HP0îT[æÈ؃Ù_#¨½—zírH ȦwâÔŠŽÍW†7mxþVYê?)Ärvj³oQžwE¦m„e#.¿ÂdÔ‚™ç™×¶b²àþN!ïe §&¢”øuû/ÑÏKà`ö§nínœšùT)"*�¤#6d9#c*w&é�ƒbÛ†ÉðfR6zš®:'ï�.àûì¥k,YL#6N�*}±ÆyÞ>ÇãŠ�UË"õÖ�“UO«pi)8ª—â”+ñ §Ó¬,‰±Èj[þv¼‹lQôÇôa™1Kèë¯Ç×FÌ÷¿SªÄ7Ím‰Z½”*‰£NŒ¼Pâ-#6¬AË@‰�*•{iX<ÙZøW÷»(Éðâ»EEE¼nY5ÆÕ͵þ—ìw’�>ÇS6½•ß‹«¦öøÿM‡fhŠF¨%2+zmýW!†�ŒbSQIðîÜ®÷uVé(i%"�÷@Xš'+¬¥&D§)J²‹šå¢¶/]öï^¯"R¬•k¹bÑ_·-×»±öõÆ*Š|ý{ü=o÷îèë˜ØÔl›|ÏÀÞ1¨4–üŽ�‹>õÝŒ>¬žýóL—ÖȲ"4£�~"U�ä¨ræPaŒLÖ¶jϹ$Â![ÙùzÛ²†F²lWßî«âøùÑÊW=ì¼4D‰Áa«l—AHÒPŤ'Ò'mBµ§…C×Gƒ¶éE2„R]U¥"»wÕ¬�ü*ÔðХ߲œœ²ôî²Á‹¨ÀS�E#6lÃQMZH"JuœëJ»*”Ó#6I¢L²íãe—¥Â„S²ŠŸ$+�bLine truncated
|
||||
#BZh91AY&SYTÛ¶ñ^îÿÿÿ°dPÿÿÿÿÿÿÿÿÿÿÿm ¨Â,#-40�E0m b¼÷)#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-¥÷Ó\ÊV¾æ»Yc½Û½Úl¥Cf–ÎÜ´ºûwY¬Û¬w¶U:fÖÉÖ»zt¾{vÚÖ%Ñܬš�<Ÿ|ûäÂolÙÝ·G»dÅ!ª;nìó½p¼›×»^ƒïa»<zÞ÷C¤ô:íõÛÚN&Y®mïCs‡]××q‰îg°½ì÷½÷Ûï¾Wo|m¶4Þo¯£Àocš½Ý;øà#-#-#-#-A7¸#->4=hà÷f€yà#/›»y€=µnÒw;Ðtô{¾ööµ°i #-i“Ó»]—^Š:º#-íÐØl…z4Uö°Q€P()T¥È2ª‚ŠÐ#/uèzz€UèuÀé£Ï¾íz÷»‰Øí]ŸuEnñÛÍÕ©3#/RTm‹L’íÍÍôö�®_wÞ^·»ØûîŽö¼öí´�mìó¹çxúÉí¾ûzó{;vÏnºûìÉlÛy5<ûž“íñßYêmËÇxíïpò€ èó²´#2AUR�{6›Ù¤ë]µÝ›µ™v={¼nï9Ö:Ô�´<¯yÈöìÌÔˆ¤§o9L§#-Q‰DP=Øg¡Ð½ÁÑOGo;¼g¼Ôö·½�Jªû�w¼Ï™—³"Š#-õ¥¦)kk_]K§Û;ã�W{�ïiæ}öö;ÁèV÷·µào}nw²·�Ãèi[Üð}ã¦}×sÔöãÝ�#-ºÓïgÓÛv©�p2_föº»ËO¾ß[Ç]\]Ë´ÕÍÒï®=§»W×7�$ç—Ü÷/nv¾ïuìç¼;½>ó«ì¥#/vt¦œîm>Úõ]>Ì9|'s|šÞ,({k’î¹ÏmÛãà×»*Ïvêfùîîún½ŽÙ±÷�¾Î^Û;›C–ÕK}Ý%ë�÷d{»Ýdòœwpç+µÓy#-Ý9^ózï˜}Þ#/:ÎRŠ(#2ìÊB.…˜Ùr‚¶ZÖÛggCêÜ®—BAï¹›±:UÃcÛBW]²¼¼{e"ÝvöÔƒ»æuÝ�#-#-mìë´€‹Ðöósr;¼ívZªKW¶l¾Ýæiîkbn»ÜÙnQêæäTôévÁO³:ù8ön�½515ÇDBÞ²“¼^ìyîú}íïq¸ø +™Jó[ž�Aí›Ö�§:¤žG¤›{+¡Ï¶â>ë}‡r[ºu½Ã½î^Õçm¬Wۃã»��zvL§�ÙÎǦ–›j[[(z/wéÞÞL£>¼{àíºè5k ¢qòίCU™Â÷žûß}µ>sì@UïjáUG9J[×y�{º8îõ\î.0©Úfì*Í7׃٫6½·m�}µ—a½ï}ÏwŸU»�ÒTËJ½ÎtiwXÒîšô÷Zí‡4ð\º ƒt8éÇ{¼»¾µ¶¾o iè°ú+é˜=À#-9W“Wn¬û¬v{€:¢�¶¥Ú×{Þ»Û#-ì^Úqo+¶çwWLX½·ë{¤lغܻ¤¨¡Œm¦ÙÖ•Ùm— õÆ}Ï»ÇvÜ}¥½1{Xì÷zͪæ¾ûxø‡½ó¾ë\ÀžÇÏFôÇlC&NëîñÛÍÁ¡mqïsîï-½Þ÷¼ó¸ôÖ^ù÷;/²µ�ÝݸÖókíﯓàkSå_,ᦈ#-€#-&€#CA0 ¡¡0‰äBO#/¨ÈQ z@òGµ4Ÿª M@�#-š¥<&1&FÑOÒFÒPÈF™#-#-#-#-#-#- &A2a4§â‰?#2›ÒŸéSñ=Q=OQ£j=zž“@Ð4#-#-#-#-OT¤ˆA4ôÊ1)æ£ÑGêƒF'êž�P#-#/šƒÔ4M#-#-#-#-D#-M#-€&™4ÔÍ551‰¦ ¡3I�š@#-#-#-€$ÔD ˆ4h�4Õ3)õQè�({I¨ÓOSÔ#-h#- #->_ÿIþ�U¥sùñʵ;µÛöª´ó4™¨3ãU§bB˜“Td` ˆ*%@@|–"Qú/Óø¨ý?¨»ýTøØ xƒ50èµ+,S¾šSTboéêê`‰þ£_#ývos2ìÀkWdD$ AÔÔ] ÔDd‘ÊÞd¾*ꉗŽqs…OˆW4]Z¬aâí•FQ1‰Ãâ1wŒ(˜‹˜¸Ça†ñåøúˆVâ#2‘V#2F @¨€‘EF1E$E@A@n#-�TZŠ”å,¬‰"Asha@0Š�#ŒQBÀ$Dl@„×çUºm¯-kim©Wt[н¦ÔUUo}¶µµLÉ�²Q™¨išlˆ £ŠJ�´LÍB%Œ€MJQ¥ÛI°¢f�2M£%©¨Õ…´f’ɤˆÑ-†£‰´¦‚@#/£RƆ˜²¦Ñ¢)6KE¨Š–ZSKh�ˆYi#/š ƒ(ÌÌcRF£Qj“A¥6C¡51¤ L4Ye¤c)M£SM‘-¦ÛYjÚ4ÌIc3&d&ˆ“Y6Óm¦›@š’�”–šØËSm™²–“$ÌE@dY14Y( ¦E"FЈTY¤m˜#/X6)*a¥DAR˜Œ„($D– Z’FÔ‰��,DÛ3C$‰ŠP‘†d²²Á™‰4–F"–MdØØÑb‰…H²C%”„�Ji‚lII‘FQ&ŒšL˜�T”iˆÒH�ScD‘b(™”´‚)˜&ƲC6"LSC3`˜X�i6%•„"À‰%&Æ¢"KIE$IQ "Q ŠEP`&d”Â0™Be$¤ÔY›5„�&¤‰&!–”ÙB$‹%±&,³(¤lÉ(›)‘±6&DRŒÙ‚eSLI²”†ÍE€²A¦šˆÔ¬–HØ¢QHLŠi& š�†Í2�&! &¤–Q”Ôi3HÚ("šh¢kP,&YA¤²2‹%&DÐM2‘*4f6”)1¨6ÄÊA! "“1�F4,�Ë ŠÙ&TÌÕ˜£l¥±(‰™#/H¦!HŒØÐ¡YM$QF¤É&ÉØÆJšF¦h±b2’™˜²2³i„¬D`ˆ¢JM52i™!Œ¢)#/š"¦ÅjT¥%4R#&2dSi#2,‘ŠQ”�¤E*ŠI1$šShÒj4‰4ÆÀ˜Œh&Ti¦DÚ#/ƒ,„Òe‹DÈY‘¦ÉJb”D!f™ k6lmd°$4–Ld5EPZ XR$Ècc1 Â2ƒRXÔY¤J&ŒE©M(Z˜hI™IŠ$2ɲ#)‚E,Ñ¥1„5„²e"$4J5µ£ÊS4e214¢’fDEh5)¶,Ñf)4Œ¡,²¦Íjeal£Sb!J"i�!)µüV×D%MR"ÛE؊بÙ2”ÓQJ’hÐÒÒ£a$ÔmdF†™Œ£$l¦T‘lˆ33L¶Kh£’–£j)FM0ššÌX°±©2ÒÌ™2¤Ú#2�•i*l¡²e‘TªY*aM›ŒÍ[,ˆ“L¬‰S,¦ÖJ²ÙJSL‹l�’‘µ)¬±%¤2RÔZ ªŒHj5hÉPQU“Y(Ú¢±QR%Ñ4DÉbÄZ1bµ´mc`-&L(ÁU¦QH&�ÈZdšV–Ä[6˜šÆ-’,m¢Z©kYb¡�™LÔµ“D•#4ÚFÅ’+jU›c¦Ò©e*e–©¤DkiT²&RÔÔѱhIL¦²Å†Ë&²²ÈVË1BAC*4‘!cDX°Í&"Dˆm„Æ!KhÕ @„¨¡’ÔVI¦�“&’‹" ²Å"›)FÈŠË ‘Le3…%4ÍQh´É ‘›M¤Å�±²Â)¦@Ä…ÑIE†˜’2j‰#/�ƒ &j(Ñ%2)F‚Ë(¡*`�Li„¥LÙ!5Œ„FfÔe(Ù”’Q�4d)YKb"˜m&ˆÆ¤Ù,"‚ÉXBŒ–ІbM,ÊTÊJYJÌ2V0‚ÍH؆5"Ôj�šÑš"¡£R”›#/1RÆÙ”–£@‘�“ LdblIRT™BŠ”Ó$…&k Jj+Ù†Í%“c4š,lÄM4£%¦FÕ‘hTÍ2–H’l£0D2hªih�¬Òl”Ä,LDÒRBAh´[ Q¨ÔQŠÆ-–ÃI†’M#2L�ŒRˆ#b��-f›C2ˆ6*2FÉK)*dE´mƨÕh¡2ÍQAb‚ 5&¨Ô0Ä,#¥(mch4¦™d(£D‘TÉ-F¨±#)[dT¢¨Ö4˜",š"™”-J)ÉD•6%2DjÁ¢¦E‹%FÑ…1f”[&Jŵ¤Å%e6Ȗɱ´4J’S ÊTX@�lll”lš$Äb6ÉŠI˜ Õ™0h!Q¥6fÄÄSXÕ2²k24…4“QAQDÓjJŲ’XÙ1h �&’µ"4ZYhÚj$´Z¢¬e(ÚMlˆ!Tm�IEŠE4&E23#1¦¤F%#/LÙ&kDlU%‹hÔ•,«&´LÚ�1lj £cc$UE2©¥XÚ6��¶1mI˜ÊQ f²±-F+iQµ´©QJV”f*šB(4X"J�&ØÖ,Ê’+I[M²“+F�bbÑI�F¶[V)*Q¨`!£FÅ4“jaŒ“mbÛ™«hƵ–’¦†ZÙK&Úš›d-©4Õ‰£(¢#FFÒJ(6ÍI©™›,¨Š*$Ä’e$ÈŒŒFB6Éme¶EÿƒÄÿ} èš?ÁXf³ô#?Ï£¥†ØJ0åÛ•üÅò9ì¿“�wÅ[›û<½*#/MŸ4ç®Ûüï;Ó›ø?ƒ¯Kze7q˨ÿ]òeŇõÏôüK�Õ‡~…rÿ©Zà#2dAE‡G±.)$‘#/·¹‰ÃåÚÑ9þJ¤³ýAŸüÿZ?é$”)k•Ä^ÊpVP±ˆ¾§4ÃýkÜàóJ´›i×çˆã}�#2ç2¡‘úXwf¬ZvÄä�ò×õ0ÕJ"†É8¡·'%ˆƒüµ»fÍIÂD##1�$v—l‰³1¢#/�Í¢:>MvNóºBczåÞž•z—�rÎw,¿�ן�Ög5r 6#2…1š¼Y¢eS³\Ê*S I’$b„ÞíºP®‘€‰�h”…ãλPËâܲ3znhÐl‚ÁS‹&*�î\r¿ö,°þwp̦0Q`¤whR˜nÂÆnX_wµÊKb1ŠOËü=xö|íÜñzf´µÕ±S)´)NþY*Ì�Á&Ön|9���&ÄóU&xA(ñý›—(?àv¡brwBØ0¡ÂiX¯Ûþjí£-˜ðžË@æÌ’òÝÉA %kìQáyÜ–íÞw^QŽr車esn–CQW6éçqllGÀ£q„¶A`¢€«uP<hø!kë[‘L¯‹‘m�Ë�þëWçxë#Q¶~|("!ãã˜Añ´òeˆŒÑ0å�ÕAbÂz®¤4råÑ#-)i#/§!7Ž0mxNwDFÔ£¼W7º¹£Pq5×+¼îÆå+—2Q—]ÒHç2>kíòIa�?ìê’œ²–A¶›öB$ÆÑ�#2hg†ØË��ËV,öQJ>´š~ÆŒi[v—_'³2<PD¯õQIº4Áj°T?І�>¼J6:jÀ\$¥‘7£þRÁ½8&V¾Û%AÆgØ¢…2Ia;•ù²6 öWÄÈê/eÞË\’(3)¡øµ"¢…+ö¼~û,ò>ü)Äruj³oQ�ß#/wE¦m„e#/¿ÂdÔ‚™ç™×¶b²àþN ø2�S“QJ|:ý—èç¥ð0{S·v·NM|ª² âÕÊßDlònß}|—·»´Kn'¹™HÙäÕqÑ?l wÛe+Zie0):4¨ôRÄGçxûŽ*uW,MùqY„�¿µ21¤Úy"¾ÖP¯¼&ŸGXYc�Ô·ü¬=Y4Ø£ƒÇó�a™1Kèë¯Öë£f{ß›«Èæ¶Ä^ˆ�ŒJDѧF^(q…V å DÇ•J½´¬l|+ûÝ”euâ»EEE¼nY5ÆÕÌ�ÿ‡ì«X>#/¡^41Xý¾?ÉaÙš"‘ª L‚#2Å^›EÈa„EF1‰ME'ûr»ÝÕ[¦á¤”ŠwÝbhœ®²”™œ¥*�5ËEl^»íÞ½^D¥Y*×rÅ¢¿¥–ëÝØûzãE ¾~½þ·Š{÷tuÌlj6M¾gÝoÔK}n�,ø/»æÆ,žÝóL—Í‘dDiGÜD«ë�åÌ Â#™lÕŸrI„B>¶£éD•V"Â#"‡Z 6vº’W=ü¼ôë,±®h×Áão:¹9tÇ!8¶‘;jå<(šº<·J)”"’ê)Ù¥®úµ‘¿¦O#/#2]ü+)ÉË/N뼦5„Ô_5×Eñká+ÅðrÓ£áxLC%¡GîŠ4whŒ[bÓV¾ÖYz\(E;(©òB¸ñ°¶*ŠÄêÃÍ–±ä�¥ÑÒŠœ�£Â©æLine truncated
|
||||
#<==
|
||||
#-----BEGIN PGP SIGNATURE-----\n\niQIzBAABCgAdFiEEivIt5aBoIuNHTzxwSbTGfAUneqoFAl3aW3cACgkQSbTGfAUn\neqruqA//Y9oJ46ZR8W7YB/e45bfrYxGbN7NnkvkwSPNziObYur+n1QpQEOaPTn/U\n5kFtPWHXRJzaG/A9poKn7pl1Xd7Edcu1aalfoEazZbuD37VOxIp9lnrefCAeICqj\nGv0SD96Zac91CbA+b20Q4xnqxKMi3LSI4NPjfFGy62FkSk3MS4p6Rdp0/WAKwwNj\nw7WEjQCNmLb37z+FGSzXg28aljYeteBZEthsVmGJ5QqVwMBwgj2+y5FOTzFfxmqB\nrWgjFYS0l85kgYRZv9yzdNmFs5SScwafwpT8Xmdr49tFn/+0LxXyRxX+rdODgrpV\nY4EOiQz0fd6mMMnaTDXlLSXls3JyVYmbTjeNL/9gcHmnStzJ851CJQfyQg7A+JoC\nc7nz0HbiFyTgB+PUZr1OhGj3A7287o8XQ0tqR3oa7jXIOX0OynrGplMQKr++0jE1\nBgKzjLoE9CTbjkQfICLG+aUy3S1ZyDk/BcO+5+Ytbru+qXuDsIgAdVosMfNSv9jJ\nXvOINsbRMekdejYMZv8fIkn5OEjCFHVhNpobEsCb768bjB3p7alQGECBvjHCm6dy\nXZPzl9cBMWIXcBjPTS+GZj+PIXGcu76pbsx6HBHWf+uJ+4xgOsUCVu//0AV09jvA\n0MjtLWwQ8mdRH6Wt4hsp4HKtSvQrhmljf2OnuYBgaFmcdJkN1zI=\n=C0oT\n-----END PGP SIGNATURE-----\n
|
||||
#-----BEGIN PGP SIGNATURE-----\n\niQIzBAABCgAdFiEECzlystnjLqtCPS4PIr4MYv+/pUgFAl+oTtQACgkQIr4MYv+/\npUhzmhAAqNeBRQuz2Z2EvWjxH/EARVKUe499ZPLsiJpl79NX3r0LWeLjf1kNAdxi\n7pR36XY8RdRwQaqNQiJ7UWzKRYXGCix71gaDyq/Qk6eZko6ts3DdicG8m12i7abi\navAtSgKzwE7o4rMqKG3iZe4AXxhCtijjIZY8Kli22XNCpY0YqUjXSNYPlhsZBWrK\nkKSmfcYxqHGrH6AKGwEJV/GbLIivYCQi6KWFfJwSOcid+479EXBuMiK8piVl6uhs\nvWGI/FcbR7cWA46Mkw7JGqJcdoyX9r8fHXrkbdIrojvQ1b4YdALZvgG6jzENCD8s\nk1KPQw+nLcC5Bax9aNO8QEn2O7vkQ5OAq19RV7ezaup2ptwe2XLuolkD3TAXr+jz\njDp0Ktc24IuVmArOyz6KZXQSIxKN3vZ8NJfdRD112/HBO/gxuZCdRQgD4c8WX9EV\nCbgrgxy02pKQdvTva/ffNgFBDOY7esRhrLLzH8lIo/556aAx6NIUy8ekAXTaFfKL\n+UenHhsYzuemapaTMhbBjqzAeiczB/fhWRr9NUajQ2x3+NDJ52/V40/fnZvYbkRx\nmvw28wCXslOh2kxQM7GgLfke8rmHN9Kek6SwHJx7RQ5OnCMKPHAo2Vb/VMx01qX4\nWeNIX9df34mD+Zy+iqJ5neXERGARPAIPeb3xYhCemgyRdWEUwvc=\n=/5DR\n-----END PGP SIGNATURE-----\n
|
||||
Reference in new issue
Block a user