Patch: Allow the socket-wrapper stuff to work with net ads dns register etc

Richard Sharpe realrichardsharpe at gmail.com
Wed May 11 14:54:12 UTC 2016


On Wed, May 11, 2016 at 7:10 AM, Richard Sharpe
<realrichardsharpe at gmail.com> wrote:
> On Wed, May 11, 2016 at 12:52 AM, Andreas Schneider <asn at samba.org> wrote:
>> On Tuesday, May 10, 2016 09:06:14 PM Richard Sharpe wrote:
>>> On Tue, May 10, 2016 at 1:39 AM, Andreas Schneider <asn at samba.org> wrote:
>>> > On Monday, May 09, 2016 08:17:43 AM Richard Sharpe wrote:
>>> >> Hi folks,
>>> >
>>> > Hi Richard,
>>> >
>>> >> Attached is a preliminary patch to the socket wrapper code to help
>>> >> with self tests of things like net ads dns ...
>>> >>
>>> >> I will write a test for this, but wanted to let people know what I was
>>> >> thinking of.
>>> >
>>> > could you please create a patch against the socket_wrapper repository?
>>> >
>>> > You can find it here:
>>> >         https://git.samba.org/?p=socket_wrapper.git;a=summary
>>> >
>>> > Please also provide a testcase! You could add a test to:
>>> >
>>> > https://git.samba.org/?p=socket_wrapper.git;a=blob;f=tests/test_echo_udp_s
>>> > endto_recvfrom.c;h=79948ced4718668cec037a0d2efb3a72704f08ac;hb=refs/heads/
>>> > master
>>> >
>>> > For developing the test you can run it without socket_wrapper first. How
>>> > you do that is described here:
>>> >
>>> > https://git.samba.org/?p=socket_wrapper.git;a=blob;f=tests/README;h=26bf1f
>>> > bb5b53cfaec2ff2dabe1487b440245f9e8;hb=refs/heads/master
>>> >
>>> > After that it should work with socket_wrapper after applying your patch.
>>>
>>> OK, I seem to have some code that tests OK when run as you suggest above:
>>>
>>> [==========] Running 3 test(s).
>>> [ RUN      ] test_sendto_recvfrom_ipv4
>>> WARNING the echo server is still running!
>>> [       OK ] test_sendto_recvfrom_ipv4
>>> [ RUN      ] test_connect_sendto_recvfrom_ipv4
>>> [       OK ] test_connect_sendto_recvfrom_ipv4
>>> [ RUN      ] test_sendto_recvfrom_ipv6
>>> [       OK ] test_sendto_recvfrom_ipv6
>>> [==========] 3 test(s) run.
>>> [  PASSED  ] 3 test(s).
>>>
>>> Here is a patch for the test ... If it looks OK, I will send it as a
>>> git format-patch patch
>>
>> Does it also work if you run 'make test' when your patch is applied? If yes,
>> please send it as git format patch!
>
> Well, there was a minor mislabeling of the new test case and the old
> test case, but I am concerned that when I run make test with my new
> test case and without the changes to the socket_wrapper code that I
> have developed, nothing fails.
>
> Is that because I have to manually define SOCKET_WRAPPER_DIR or is it
> because my test case is not correct?

After getting some more info from Andreas and looking at my test case
again I realized that it was wrong.

I now have a test case that simulates what net ads dns gethostbyname
is doing and fails in an unmodified version of the socket wrapper
code.

The Rubicon is in sight.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)



More information about the samba-technical mailing list