Project

General

Profile

Task #3740

ndnpoke: add unit testing

Added by Junxiao Shi almost 4 years ago. Updated about 2 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

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

Actions
#1

Updated by Junxiao Shi almost 4 years ago

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

Updated by Junxiao Shi almost 4 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
#3

Updated by Junxiao Shi almost 4 years ago

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

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

#5

Updated by Davide Pesavento almost 4 years ago

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

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

#7

Updated by Eric Newberry over 2 years ago

  • Assignee set to Eric Newberry

Holding this task per request from Beichuan

#8

Updated by Eric Newberry over 2 years ago

  • Assignee changed from Eric Newberry to Ping Hsu
#9

Updated by Ping Hsu over 2 years ago

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

#10

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

#11

Updated by Ping Hsu over 2 years ago

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

What is the specified identity?

#12

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

#13

Updated by Ping Hsu over 2 years ago

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

#14

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

#15

Updated by Eric Newberry about 2 years ago

  • Assignee changed from Ping Hsu to Eric Newberry
#16

Updated by Eric Newberry about 2 years ago

  • Status changed from New to In Progress
#17

Updated by Eric Newberry about 2 years ago

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

Updated by Eric Newberry about 2 years ago

  • Status changed from Code review to Closed

Also available in: Atom PDF