poke: exit with status 3 on timeout
Change-Id: Idb021fe1fa1c3d40dbcfc87d4b1dadbea6cb28f6
diff --git a/manpages/ndnpoke.rst b/manpages/ndnpoke.rst
index d92ba43..f5ae345 100644
--- a/manpages/ndnpoke.rst
+++ b/manpages/ndnpoke.rst
@@ -50,6 +50,8 @@
2: Malformed command line
+3: No Interests received before the timeout
+
5: Prefix registration failed
Example
diff --git a/tests/peek/ndnpoke.t.cpp b/tests/peek/ndnpoke.t.cpp
index 46f445d..cdcd262 100644
--- a/tests/peek/ndnpoke.t.cpp
+++ b/tests/peek/ndnpoke.t.cpp
@@ -195,7 +195,7 @@
this->advanceClocks(io, 1_s, 4);
- BOOST_CHECK(poke->getResult() == NdnPoke::Result::UNKNOWN);
+ BOOST_CHECK(poke->getResult() == NdnPoke::Result::TIMEOUT);
BOOST_CHECK_EQUAL(face.sentData.size(), 0);
// Check for prefix unregistration
diff --git a/tools/peek/ndnpoke/ndnpoke.cpp b/tools/peek/ndnpoke/ndnpoke.cpp
index e6730cf..0d04efa 100644
--- a/tools/peek/ndnpoke/ndnpoke.cpp
+++ b/tools/peek/ndnpoke/ndnpoke.cpp
@@ -61,6 +61,7 @@
},
[this] (auto&&) {
m_timeoutEvent = m_scheduler.schedule(m_options.timeout, [this] {
+ m_result = Result::TIMEOUT;
m_registeredPrefix.cancel();
});
},