face: allow enabling/disabling congestion marking through config file
refs #4465
Change-Id: I888b83b1fdbe8e3fc36a902bf7af52147807d829
diff --git a/tests/daemon/face/face-system.t.cpp b/tests/daemon/face/face-system.t.cpp
index 2bb5a1f..1ecf33a 100644
--- a/tests/daemon/face/face-system.t.cpp
+++ b/tests/daemon/face/face-system.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -49,7 +49,8 @@
processConfig(OptionalConfigSection configSection,
FaceSystem::ConfigContext& context) override
{
- processConfigHistory.push_back({configSection, context.isDryRun});
+ processConfigHistory.push_back({configSection, context.isDryRun,
+ context.generalConfig.wantCongestionMarking});
if (!context.isDryRun) {
this->providedSchemes = this->newProvidedSchemes;
}
@@ -75,6 +76,7 @@
{
OptionalConfigSection configSection;
bool isDryRun;
+ bool wantCongestionMarking;
};
std::vector<ProcessConfigArgs> processConfigHistory;
@@ -91,6 +93,10 @@
const std::string CONFIG = R"CONFIG(
face_system
{
+ general
+ {
+ enable_congestion_marking yes
+ }
f1
{
key v1
@@ -104,18 +110,22 @@
parseConfig(CONFIG, true);
BOOST_REQUIRE_EQUAL(f1->processConfigHistory.size(), 1);
- BOOST_CHECK_EQUAL(f1->processConfigHistory.back().isDryRun, true);
+ BOOST_CHECK(f1->processConfigHistory.back().isDryRun);
+ BOOST_CHECK(f1->processConfigHistory.back().wantCongestionMarking);
BOOST_CHECK_EQUAL(f1->processConfigHistory.back().configSection->get<std::string>("key"), "v1");
BOOST_REQUIRE_EQUAL(f2->processConfigHistory.size(), 1);
- BOOST_CHECK_EQUAL(f2->processConfigHistory.back().isDryRun, true);
+ BOOST_CHECK(f2->processConfigHistory.back().isDryRun);
+ BOOST_CHECK(f2->processConfigHistory.back().wantCongestionMarking);
BOOST_CHECK_EQUAL(f2->processConfigHistory.back().configSection->get<std::string>("key"), "v2");
parseConfig(CONFIG, false);
BOOST_REQUIRE_EQUAL(f1->processConfigHistory.size(), 2);
- BOOST_CHECK_EQUAL(f1->processConfigHistory.back().isDryRun, false);
+ BOOST_CHECK(!f1->processConfigHistory.back().isDryRun);
+ BOOST_CHECK(f1->processConfigHistory.back().wantCongestionMarking);
BOOST_CHECK_EQUAL(f1->processConfigHistory.back().configSection->get<std::string>("key"), "v1");
BOOST_REQUIRE_EQUAL(f2->processConfigHistory.size(), 2);
- BOOST_CHECK_EQUAL(f2->processConfigHistory.back().isDryRun, false);
+ BOOST_CHECK(!f2->processConfigHistory.back().isDryRun);
+ BOOST_CHECK(f2->processConfigHistory.back().wantCongestionMarking);
BOOST_CHECK_EQUAL(f2->processConfigHistory.back().configSection->get<std::string>("key"), "v2");
}
diff --git a/tests/daemon/face/tcp-channel-fixture.hpp b/tests/daemon/face/tcp-channel-fixture.hpp
index a64cd48..ed91aee 100644
--- a/tests/daemon/face/tcp-channel-fixture.hpp
+++ b/tests/daemon/face/tcp-channel-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -43,7 +43,7 @@
if (port == 0)
port = getNextPort();
- return make_unique<TcpChannel>(tcp::Endpoint(addr, port));
+ return make_unique<TcpChannel>(tcp::Endpoint(addr, port), false);
}
void
diff --git a/tests/daemon/face/udp-channel-fixture.hpp b/tests/daemon/face/udp-channel-fixture.hpp
index 43f912d..ddf22f7 100644
--- a/tests/daemon/face/udp-channel-fixture.hpp
+++ b/tests/daemon/face/udp-channel-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -44,7 +44,7 @@
if (port == 0)
port = getNextPort();
- return make_unique<UdpChannel>(udp::Endpoint(addr, port), time::seconds(2));
+ return make_unique<UdpChannel>(udp::Endpoint(addr, port), time::seconds(2), false);
}
void
diff --git a/tests/daemon/face/unix-stream-channel.t.cpp b/tests/daemon/face/unix-stream-channel.t.cpp
index c602f97..8e20a26 100644
--- a/tests/daemon/face/unix-stream-channel.t.cpp
+++ b/tests/daemon/face/unix-stream-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -48,7 +48,7 @@
unique_ptr<UnixStreamChannel>
makeChannel() final
{
- return make_unique<UnixStreamChannel>(listenerEp);
+ return make_unique<UnixStreamChannel>(listenerEp, false);
}
void