[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running 'pkd' in Nightly and Coverage Builds


On Monday 26 January 2015 08:07:45 Jon Simons wrote:
> >> How would I go about getting the 'pkd_hello' testcase running in the
> >> nightly and code coverage builds as found at https://test.libssh.org? 
> >> Is this a matter of modifying some set of CMakefiles?  I'd be happy to
> >> help get this test enabled in CI by default, including any fixups it may
> >> need to run in that environment.
> > 
> > for this we need support for cwrap [1]. I've started to implement one test
> > with socket_wrapper. This allows us to start sshd with the config options
> > we need.
> 
> Ah, I am confused here: why would we need either cwrap or 'sshd' for doing
> the testing that 'pkd_hello' already does?  'pkd' implements the
> server-side half of libssh-based pubkey auth and simple data transmission. 
> There shouldn't be any reason to need to use preload-based testing here or
> to deal with any 'sshd', for the codepaths that 'pkd' tests.

A ssh server needs to open a port. This port is normally port 22 which can 
only be opened a root. We do not really want to use another port, we can't be 
sure that this port is in use on a system another developer runs the test.

socket_wrapper makes it possible to run on port 22 on each Unix machine out 
there. You guarantee the same testing environment on each developer machine 
and get the same test setup.

It even works on systems without network interfaces, e.g. like safe build 
environments.

> > Idea for pkd_hello:
> > 
> > Create a tests/server directory. Move the pkd server to that directory and
> > start it with socket_wrapper. Then implement tests with cmocka ...
> 
> The 'pkd' tests are already written using the cmocka headers and
> init/teardown functions:
> 
>   http://git.libssh.org/projects/libssh.git/tree/tests/pkd/pkd_hello.c#n405
> 
> It's not clear to me what we would gain by using a socket_wrapper to hook
> socket calls here?  Just trying to understand the suggestion: why would we
> use that for this test?

We get a consistent test setup on every machine.


Cheers,


	-- andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx


Follow-Ups:
Re: Running 'pkd' in Nightly and Coverage BuildsJon Simons <jon@xxxxxxxxxxxxx>
References:
Running 'pkd' in Nightly and Coverage BuildsJon Simons <jon@xxxxxxxxxxxxx>
Re: Running 'pkd' in Nightly and Coverage BuildsAndreas Schneider <asn@xxxxxxxxxxxxxx>
Re: Running 'pkd' in Nightly and Coverage BuildsJon Simons <jon@xxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org