Project

General

Profile

Actions

Task #3740

closed

ndnpoke: add unit testing

Added by Junxiao Shi over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
Due date:
% Done:

100%

Estimated time:
4.00 h

Description

Add unit testing for ndnpoke program.
Refactor this programs as necessary.


Related issues 1 (0 open1 closed)

Related to ndn-tools - Task #3558: ndnpeek: add unit testingClosedZhuo Li04/12/2016

Actions
Actions #1

Updated by Junxiao Shi over 7 years ago

  • Related to Task #3558: ndnpeek: add unit testing added
Actions #2

Updated by Junxiao Shi over 7 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
Actions #3

Updated by Junxiao Shi over 7 years ago

  • Start date deleted (08/14/2016)
  • Estimated time changed from 3.00 h to 4.00 h
Actions #4

Updated by Davide Pesavento over 7 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).

Actions #5

Updated by Davide Pesavento over 7 years ago

  • Status changed from New to Code review
  • % Done changed from 0 to 50
Actions #6

Updated by Junxiao Shi almost 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.

Actions #7

Updated by Eric Newberry over 6 years ago

  • Assignee set to Eric Newberry

Holding this task per request from Beichuan

Actions #8

Updated by Eric Newberry over 6 years ago

  • Assignee changed from Eric Newberry to Ping Hsu
Actions #9

Updated by Ping Hsu about 6 years ago

Hi,
what does the ninth test case compare? "Data size exceeds MAX_NDN_PACKET_SIZE"
Can someone clarify?

Actions #10

Updated by Junxiao Shi about 6 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.

Actions #11

Updated by Ping Hsu about 6 years ago

Thanks, also one more thing-- test case 6 "prepare Data, sign with specified identity, reply to Interest"

What is the specified identity?

Actions #12

Updated by Junxiao Shi about 6 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.

Actions #13

Updated by Ping Hsu about 6 years ago

How would I provide input to ndnpoke for the data packet content?

Actions #14

Updated by Davide Pesavento about 6 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.

Actions #15

Updated by Eric Newberry almost 6 years ago

  • Assignee changed from Ping Hsu to Eric Newberry
Actions #16

Updated by Eric Newberry almost 6 years ago

  • Status changed from New to In Progress
Actions #17

Updated by Eric Newberry almost 6 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
Actions #18

Updated by Eric Newberry almost 6 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF