Project

General

Profile

Actions

Task #3306

closed

TcpTransport: test suite improvement

Added by Junxiao Shi about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Faces
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

Improve TcpTransport test suite with new test cases:

  • static properties for non-local IP
  • send
  • receive normal
  • receive malformed
  • close from transport
  • close from remote socket

Related issues 3 (0 open3 closed)

Related to NFD - Task #3305: UnixStreamTransport: test suite improvementClosedEric Newberry

Actions
Blocked by NFD - Feature #3166: TcpTransportClosedYukai Tu

Actions
Blocks NFD - Task #3172: Refactor Face: completionClosedJunxiao Shi

Actions
Actions #1

Updated by Junxiao Shi about 9 years ago

Actions #2

Updated by Junxiao Shi about 9 years ago

  • Blocks Task #3172: Refactor Face: completion added
Actions #3

Updated by Junxiao Shi about 9 years ago

  • Related to Task #3305: UnixStreamTransport: test suite improvement added
Actions #4

Updated by Junxiao Shi about 9 years ago

  • Description updated (diff)
Actions #5

Updated by Junxiao Shi about 9 years ago

  • Assignee set to Eric Newberry
Actions #6

Updated by Eric Newberry about 9 years ago

  • Status changed from New to In Progress
Actions #7

Updated by Eric Newberry about 9 years ago

What address should I use for the non-local properties tests?

Actions #8

Updated by Junxiao Shi about 9 years ago

What address should I use for the non-local properties tests?

A real IP address would be needed. Using an arbitrary IP that doesn't exist on the host would result in bind failure.

There are a few options in obtaining a real IP:

SOLUTION A

Enumerate network interfaces on the host, and use one of them.

Benefit: Implementation is easy.

Drawback: Test case would be skipped if the host has no IPv4 or IPv6 interface other than loopback.

Drawback: Possible tests for MulticastUdpTransport and EthernetTransport are limited.

SOLUTION B

Create a TUN interface, and test on this interface.

Benefit: Test case does not depend on host configuration.

Benefit: It's possible to simulate remote hosts over TUN interface. Thus, there's more flexibility in what scenarios are possible.

Drawback: Test scenario depends on the availability of TUNTAP kernel module. It's available on most platforms, but unavailable by default in OpenVZ containers.

Drawback: Implementation is much harder (12 hours shared among all test suites that depend on TUN).

Current time estimation assumes SOLUTION A, but this choice needs further discussion.

Actions #9

Updated by Davide Pesavento about 9 years ago

Definitely solution A, in my opinion. And you should use listNetworkInterfaces().

Actions #10

Updated by Junxiao Shi about 9 years ago

20151117 conference call decides to use note-8 SOLUTION A.

The limitation about MulticastUdpTransport can be resolved with LOOPBACK socket option.

Actions #11

Updated by Davide Pesavento almost 9 years ago

Design question on http://gerrit.named-data.net/2612 patch set #1: do you intend to share some code between TcpTransport test suite and UnixStreamTransport test suite (some test cases will look very similar)? If so, how?

Actions #12

Updated by Eric Newberry almost 9 years ago

Davide Pesavento wrote:

Design question on http://gerrit.named-data.net/2612 patch set #1: do you intend to share some code between TcpTransport test suite and UnixStreamTransport test suite (some test cases will look very similar)? If so, how?

Currently, I have no plans to do so, as they use different transports, but I might do so if I find many similarities when implementing the UnixStreamTransport tests. I'm currently trying to get the Receive tests in TcpTransport to even work at all.

Actions #13

Updated by Davide Pesavento almost 9 years ago

Eric Newberry wrote:

Currently, I have no plans to do so, as they use different transports

Sure, but they both derive from StreamTransport, where most of the code is.

but I might do so if I find many similarities when implementing the UnixStreamTransport tests.

Ok, this is perfectly reasonable. It should make it easier to spot the similarities between the two test suites, and it'll also simplify the code review.

Actions #14

Updated by Eric Newberry almost 9 years ago

  • Status changed from In Progress to Code review
Actions #15

Updated by Junxiao Shi almost 9 years ago

  • Status changed from Code review to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF