Page MenuHomeFreeBSD

Replace ncat by a perl script for running an SCTP discard server
ClosedPublic

Authored by tuexen on Apr 28 2019, 10:57 AM.

Details

Summary

Some test scripts use ncat --sctp --listen port to run an SCTP discard server in the background.
However, when running in the background, stdin is closed and ncat initiates a graceful shutdown
of the SCTP association. This is not expected by the client.

Therefore, the ncat-based discard server is replaced by a perl-based one.

In addition, to remove the dependency from ncat, which needs to be installed via the nmap port, also the
code testing for a free SCTP port is changed to use the perl-based client.

This fixes:

  • common.ip.t_dtrace_contrib.tst_ipv4localsctp_ksh
  • common.ip.t_dtrace_contrib.tst_localsctpstate_ksh

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tuexen created this revision.Apr 28 2019, 10:57 AM
Herald added 1 blocking reviewer(s): gnn. · View Herald TranscriptApr 28 2019, 10:57 AM
Herald added a subscriber: imp. · View Herald Transcript
lwhsu requested changes to this revision.Apr 28 2019, 6:25 PM

I've tested test in my development environment and testvm images from artifact.ci.freebsd.org, for making these two tests passing, we also need to modify tst.localsctpstate.ksh.out to added an extra blank line at the end of the file. I think it's acceptable for now, and other .out files also have this line. I would like to check that extra blank line is generated by the test driver or these ksh test scripts later, and fix them all together.

cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh
144 ↗(On Diff #56773)

After checking with tst.ipv4localsctp.ksh.out and guessing the intent of the code, I think these 4 lines need to be changed to:

printf("ip:::send - %s\n", ipsend >= 7 ? "yes" : "no");
printf("ip:::receive - %s\n", ipreceive >= 7 ? "yes" : "no");
printf("sctp:::send - %s\n", sctpsend >= 7 ? "yes" : "no");
printf("sctp:::receive - %s\n", sctpreceive >= 7 ? "yes" : "no");
This revision now requires changes to proceed.Apr 28 2019, 6:25 PM
tuexen updated this revision to Diff 56790.Apr 28 2019, 6:46 PM

Remove debug output.

tuexen marked an inline comment as done.Apr 28 2019, 6:47 PM
tuexen added inline comments.
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh
144 ↗(On Diff #56773)

Fixed. It was debug output I used a while back and forgot to remove.

tuexen marked an inline comment as done.Apr 28 2019, 6:48 PM
lwhsu accepted this revision.Apr 28 2019, 6:50 PM

I've tested test in my development environment and testvm images from artifact.ci.freebsd.org, for making these two tests passing, we also need to modify tst.localsctpstate.ksh.out to added an extra blank line at the end of the file. I think it's acceptable for now, and other .out files also have this line. I would like to check that extra blank line is generated by the test driver or these ksh test scripts later, and fix them all together.

Just to double check: tst.ipv4localsctp.ksh.out and tst.localsctpstate.ksh.out both contain a single empty line at the end. Do you want me to add another one to tst.localsctpstate.ksh.out. This would make them inconsistent...

This revision was not accepted when it landed; it landed in state Needs Review.Apr 28 2019, 7:07 PM
This revision was automatically updated to reflect the committed changes.
lwhsu added a comment.Apr 28 2019, 7:20 PM

Just to double check: tst.ipv4localsctp.ksh.out and tst.localsctpstate.ksh.out both contain a single empty line at the end. Do you want me to add another one to tst.localsctpstate.ksh.out. This would make them inconsistent...

https://svnweb.freebsd.org/base/head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out?revision=338213&view=markup

tst.localsctpstate.ksh.out doesn't seem to have an empty line in the end.

Just to double check: tst.ipv4localsctp.ksh.out and tst.localsctpstate.ksh.out both contain a single empty line at the end. Do you want me to add another one to tst.localsctpstate.ksh.out. This would make them inconsistent...

https://svnweb.freebsd.org/base/head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out?revision=338213&view=markup
tst.localsctpstate.ksh.out doesn't seem to have an empty line in the end.

Yes, you are right. Not sure what I was looking at. Should I add the trailing empty line to get things consistent?

lwhsu added a comment.Apr 29 2019, 3:51 AM

Yes, you are right. Not sure what I was looking at. Should I add the trailing empty line to get things consistent?

Oh I just committed rS346873, let see if it helps.

Yes, you are right. Not sure what I was looking at. Should I add the trailing empty line to get things consistent?

Oh I just committed rS346873, let see if it helps.

Great, thanks. Please drop me a note if there are any other issues.