Re: [tcpdump-workers] tcpdump testsuite and Perl

2020-02-04 Thread Francois-Xavier Le Bail via tcpdump-workers
--- Begin Message ---
On 03/02/2020 03:17, Guy Harris wrote:
>> And remove the yaml stuff.
> ...which, it appears, is not being used; we're still using the old plain-text 
> TESTLIST file, and have no YAML files for tests yet.
> 
> What YAML would provide would be easier extensibility, in that you can just 
> add another key if you need another per-test value.  The question is whether 
> that's worth adding a dependency or not.

I like the #821 PR. It provides extensibility without YAML.

-- 
Francois-Xavier
--- End Message ---
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] tcpdump testsuite and Perl

2020-02-02 Thread Francois-Xavier Le Bail via tcpdump-workers
--- Begin Message ---
On 02/02/2020 04:24, Francois-Xavier Le Bail wrote:
> On 31/01/2020 17:19, Michael Richardson wrote:
>>
>> Francois-Xavier Le Bail via tcpdump-workers wrote:
>> > On 28/01/2020 23:17, Denis Ovsienko via tcpdump-workers wrote:
>> >> The new dependency makes it more difficult to run tests and will break
>> >> package builds downstream (thus penalising people that cared enough to
>> >> make "make check" a part of the build). Maybe the cost of the solution
>> >> does not justify the problem it solves (which it would be nice to
>> >> state)?
>>
>> > Why not just keep the TESTLIST file as it is, a text file with test 
>> lines and comments?
>>
>> Because it does not live alone actually.
>>
>> It has a series of foo.sh files do that do annoying testing based upon what
>> is configured, and I'd like to do more of the process of testing things that
>> are configured, or when they are not configured.
>> I don't want to write more shell scripts.
> 
> We could add a "type" field in TESTLIST and do the process following this 
> type.
> 
> std: standard test.
> crypto: need ssl library.
> gcc: need GCC compiler.
> etc.
> 
> Like in:
> https://github.com/the-tcpdump-group/tcpdump/commit/745cd41b98feff4228783501be37889f7a473e5b
> (test branch:  typed-tests)

Typo fixed in:
https://github.com/the-tcpdump-group/tcpdump/commit/23848a19458970c4127d5a0364f690767362c3b6

(This is just a first step for showing the idea, the 'crypto' and 'gcc' tests 
could be move in
TESTLIST for a processing based on the field 'type')
-- 
Francois-Xavier
--- End Message ---
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] tcpdump testsuite and Perl

2020-02-01 Thread Francois-Xavier Le Bail via tcpdump-workers
--- Begin Message ---
On 02/02/2020 04:24, Francois-Xavier Le Bail via tcpdump-workers wrote:
> We could add a "type" field in TESTLIST and do the process following this 
> type.
> 
> std: standard test.
> crypto: need ssl library.
> gcc: need GCC compiler.
> etc.
> 
> Like in:
> https://github.com/the-tcpdump-group/tcpdump/commit/745cd41b98feff4228783501be37889f7a473e5b
> (test branch:  typed-tests)

And remove the yaml stuff.

-- 
Francois-Xavier
--- End Message ---
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] tcpdump testsuite and Perl

2020-02-01 Thread Francois-Xavier Le Bail via tcpdump-workers
--- Begin Message ---
On 31/01/2020 17:19, Michael Richardson wrote:
> 
> Francois-Xavier Le Bail via tcpdump-workers wrote:
> > On 28/01/2020 23:17, Denis Ovsienko via tcpdump-workers wrote:
> >> The new dependency makes it more difficult to run tests and will break
> >> package builds downstream (thus penalising people that cared enough to
> >> make "make check" a part of the build). Maybe the cost of the solution
> >> does not justify the problem it solves (which it would be nice to
> >> state)?
> 
> > Why not just keep the TESTLIST file as it is, a text file with test 
> lines and comments?
> 
> Because it does not live alone actually.
> 
> It has a series of foo.sh files do that do annoying testing based upon what
> is configured, and I'd like to do more of the process of testing things that
> are configured, or when they are not configured.
> I don't want to write more shell scripts.

We could add a "type" field in TESTLIST and do the process following this type.

std: standard test.
crypto: need ssl library.
gcc: need GCC compiler.
etc.

Like in:
https://github.com/the-tcpdump-group/tcpdump/commit/745cd41b98feff4228783501be37889f7a473e5b
(test branch:  typed-tests)
-- 
Francois-Xavier
--- End Message ---
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] tcpdump testsuite and Perl

2020-01-29 Thread Denis Ovsienko via tcpdump-workers
--- Begin Message ---
On Wed, 29 Jan 2020 10:59:14 +0100
Francois-Xavier Le Bail  wrote:

> On 28/01/2020 23:17, Denis Ovsienko via tcpdump-workers wrote:
> > The new dependency makes it more difficult to run tests and will
> > break package builds downstream (thus penalising people that cared
> > enough to make "make check" a part of the build). Maybe the cost of
> > the solution does not justify the problem it solves (which it would
> > be nice to state)?  
> 
> Why not just keep the TESTLIST file as it is, a text file with test
> lines and comments?

The matter is, the current text file does not allow conditional tests,
that's why the actual list of tests consists of the long text file
_and_ at least three smaller lists hidden inside shell scripts. This
makes counting of tests and formatting of results convoluted and
fragile.

Maybe this is not the best problem statement, additional input is
welcome.

-- 
Denis Ovsienko
--- End Message ---
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] tcpdump testsuite and Perl

2020-01-29 Thread Francois-Xavier Le Bail via tcpdump-workers
--- Begin Message ---
On 28/01/2020 23:17, Denis Ovsienko via tcpdump-workers wrote:
> The new dependency makes it more difficult to run tests and will break
> package builds downstream (thus penalising people that cared enough to
> make "make check" a part of the build). Maybe the cost of the solution
> does not justify the problem it solves (which it would be nice to
> state)?

Why not just keep the TESTLIST file as it is, a text file with test lines and 
comments?

-- 
Francois-Xavier
--- End Message ---
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] tcpdump testsuite and Perl

2020-01-28 Thread Denis Ovsienko via tcpdump-workers
--- Begin Message ---
> Currently on OpenCSW Solaris 10:
> 
> "./tests/TESTrun
> TESTrun needs YAML.pm. apt install libyaml-perl/yum install
> per-YAML/cpanm YAML at ./tests/TESTrun line 10.
> gmake: *** [Makefile:448: check] Error 2"
> 
> Missing package?

The new dependency makes it more difficult to run tests and will break
package builds downstream (thus penalising people that cared enough to
make "make check" a part of the build). Maybe the cost of the solution
does not justify the problem it solves (which it would be nice to
state)?

But if the problem is worth it, maybe the solution could use a very
small subset of YAML, which could be implemented in a couple screens of
self-supplied code. After all, it is only one file that the script
needs to process, and it is only the script that processes the input
file, and they both live in the same repository. So it could be any
format that works out of the box, including plain Perl code, which would
easily accommodate the props for conditional tests and validation along
the following lines:


my $can_test_openssl = compiled_with_openssl();

my %testlist = (
'bgp-4byte-asn' => {
'pcap' => 'bgp-4byte-asn.pcap',
'text' => 'bgp-4byte-asn.out',
'args' => '-v',
},
'bgp-4byte-asdot' => {
'pcap' => 'bgp-4byte-asn.pcap',
'text' => 'bgp-4byte-asdot.out',
'args' => '-vb',
},
'edsa' => {
'pcap' => 'edsa.pcap',
'text' => 'edsa.out',
},
'edsa-e' => {
'pcap' => 'edsa.pcap',
'text' => 'edsa-e.out',
'args' => '-e',
},
'isakmp4' => {
'pcap' => 'isakmp4500.pcap',
'text' => 'isakmp4.out',
'args' => "-E \"file ${testsdir}/esp-secrets.txt\"",
'when' => $can_test_openssl,
},
);

Does it make sense?

-- 
Denis Ovsienko
--- End Message ---
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] tcpdump testsuite and Perl

2020-01-28 Thread Francois-Xavier Le Bail via tcpdump-workers
--- Begin Message ---
On 28/01/2020 18:45, Michael Richardson wrote:
> 
> Francois-Xavier Le Bail  wrote:
> >> I noticed that the testsuite of tcpdump recently fails with
> >> "make_path" is not exported by the File::Path module
> >> "remove_tree" is not exported by the File::Path module
> >> Can't continue after import errors at ./tests/TESTrun line 8
> >> BEGIN failed--compilation aborted at ./tests/TESTrun line 8.
> >> as can bee seen in the log at
> >> 
> https://buildfarm.opencsw.org/buildbot/builders/tcpdump-solaris10-amd64/builds/2960/steps/shell_3/logs/stdio
> >>
> >> This is because the system Perl on Solaris 10 is Perl 5.8.4 which uses
> >> the slighly different mkpath and rmtree
> >> https://perldoc.perl.org/5.8.4/File/Path.html
> 
> okay.
> 
> >>
> >> Even in recent Perl 5.30 the legacy functions mkpath and rmtree are 
> still in:
> >> https://perldoc.perl.org/File/Path.html
> 
> So if I use "mkpath" (I actually don't need "rmtree" yet), then I'll be good
> across all versions?
> 
> I have done this now.

Currently on OpenCSW Solaris 10:

"./tests/TESTrun
TESTrun needs YAML.pm. apt install libyaml-perl/yum install per-YAML/cpanm YAML 
at ./tests/TESTrun
line 10.
gmake: *** [Makefile:448: check] Error 2"

Missing package?
-- 
Francois-Xavier
--- End Message ---
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers