[haiku-gsoc] Re: [HCD08] ICMP functional test
- From: <philippe.houdoin@xxxxxxx>
- To: Yin Qiu <allenchue@xxxxxxxxx>
- Date: Thu, 7 Aug 2008 10:52:45 +0200
Hi Yin,
> Now I want to perform test on my code. Currently I want to do these two
> things following Axel's suggestions:
> 1. Write a simple program that sends UDP datagrams to a port that does
> not
> exist. We want to get an unreachable message.
> 2. Send a big datagram with DF bit set. We also would like to receive an
> unreachable message.
Try to test unreachable port for TCP stream too.
Check it works thru loopback and actual ethernet interface(s) too.
> However I don't quite know where to do this. I mean,
> I noticed there was a "tests" folder in src/, which contains several test
> cases. Should I implement my own test cases in the corresponding folder?
Yes, that's where every tests should be.
At first, it was supposed to contains only unit tests (CppUnit), but it has
evolved into the root folder for all kind of testing code, from CppUnit-based
ones to third-party test framework (netperf) and whatever collection of simple
testing programs.
Your will find a warm home here, under src/tests/kits/net/
> If so, would you give me some advice?
Create some "icmp_tests" folder under src/tests/kits/net/ and put your two
testing apps there.
You could look the already there testing programs and take inspiration, in
particular to write the Jamfiles to build yours.
For the second test, maybe you should look at ping code
(src/bin/network/ping/ping.c) to see how to setup a raw IP datagram, the
fragment offset and flags in particular.
> Or shall I just write the program in the haiku VM with gcc installed?
No, not "just". Tests are very valuable, and should be kept and available for
everyone under src/tests/... in order to allow them to see test conditions,
update them, run them for non-regression purpose, etc.
Nothing forbid you to write directly them under Haiku, but you *must* send
their source code along ICMP new code.
The best way to do that is to create them under your
src/tests/kit/net/icmp_tests working copy and include them in your
patch/zipfile.
Oh. That's off topic, but have a great Olympic Games.
Bye,
Philippe.
- Follow-Ups:
- [haiku-gsoc] Re: unit-tests vs. test apps (was: Re: [HCD08] ICMP functional test)
- From: Axel Dörfler
- [haiku-gsoc] Re: [HCD08] ICMP functional test
- From: Yin Qiu
Other related posts:
- » [haiku-gsoc] Re: [HCD08] ICMP functional test
- » [haiku-gsoc] Re: [HCD08] ICMP functional test
- [haiku-gsoc] Re: unit-tests vs. test apps (was: Re: [HCD08] ICMP functional test)
- From: Axel Dörfler
- [haiku-gsoc] Re: [HCD08] ICMP functional test
- From: Yin Qiu