Task #3740
closedndnpoke: add unit testing
Added by Junxiao Shi over 8 years ago. Updated over 6 years ago.
100%
Description
Add unit testing for ndnpoke
program.
Refactor this programs as necessary.
Updated by Junxiao Shi over 8 years ago
- Related to Task #3558: ndnpeek: add unit testing added
Updated by Junxiao Shi over 8 years ago
I suggest having at least these test cases:
- prepare Data, sign as default, reply to Interest
- prepare Data with
FinalBlockId
, sign as default, reply to Interest - prepare Data with FreshnessPeriod set to a positive value, sign as default, reply to Interest
- prepare Data with FreshnessPeriod set to zero, sign as default, reply to Interest
- prepare Data, sign with
DigestSha256
, reply to Interest - prepare Data, sign with specified identity, reply to Interest
- prepare Data, sign as default, wait for specified timeout, Interest doesn't arrive
- prepare Data, send Data without waiting for Interest
- Data size exceeds
MAX_NDN_PACKET_SIZE
Updated by Junxiao Shi over 8 years ago
- Start date deleted (
08/14/2016) - Estimated time changed from 3.00 h to 4.00 h
Updated by Davide Pesavento over 8 years ago
I agree with note-2, except that I don't think we need to distinguish between FreshnessPeriod > 0
and FreshnessPeriod == 0
. There's no conditional in ndnpoke that would be affected by that. Just do one test with a specified FreshnessPeriod (i.e. >= 0
).
Updated by Davide Pesavento about 8 years ago
- Status changed from New to Code review
- % Done changed from 0 to 50
Updated by Junxiao Shi over 7 years ago
- Status changed from Code review to New
- Assignee deleted (
Zhuo Li) - % Done changed from 50 to 0
Zhuo has left University of Arizona.
Updated by Eric Newberry about 7 years ago
- Assignee set to Eric Newberry
Holding this task per request from Beichuan
Updated by Eric Newberry about 7 years ago
- Assignee changed from Eric Newberry to Ping Hsu
Updated by Ping Hsu almost 7 years ago
Hi,
what does the ninth test case compare? "Data size exceeds MAX_NDN_PACKET_SIZE"
Can someone clarify?
Updated by Junxiao Shi almost 7 years ago
Data size exceeds
MAX_NDN_PACKET_SIZE
If size of the prepared Data packet exceeds the practical limit of NDN packet size, ndnpoke should quit with an appropriate error, and must not send this Data packet.
Updated by Ping Hsu almost 7 years ago
Thanks, also one more thing-- test case 6 "prepare Data, sign with specified identity, reply to Interest"
What is the specified identity?
Updated by Junxiao Shi almost 7 years ago
prepare Data, sign with specified identity, reply to Interest
This is equivalent to command dd if=/dev/urandom bs=4K count=1 | ndnpoke -i /identity /A/$RANDOM
.
What is the specified identity?
“/identity” in the example above.
Updated by Ping Hsu almost 7 years ago
How would I provide input to ndnpoke for the data packet content?
Updated by Davide Pesavento almost 7 years ago
Have you looked at the (now abandoned) change mentioned above? You should probably resume from there rather than start from scratch.
How would I provide input to ndnpoke for the data packet content?
The NdnPoke
class needs to accept a parameter of type std::istream&
through which the packet payload can be read. main()
will pass std::cin
, while in the unit tests you can pass whatever, e.g. an instance of std::stringstream
containing the test data.
Updated by Eric Newberry over 6 years ago
- Assignee changed from Ping Hsu to Eric Newberry
Updated by Eric Newberry over 6 years ago
- Status changed from New to In Progress
Updated by Eric Newberry over 6 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
Updated by Eric Newberry over 6 years ago
- Status changed from Code review to Closed