Test rig

Richard Kettlewell rjk at greenend.org.uk
Fri Jul 10 15:33:20 UTC 2015


Apologies for previous message, finger trouble.

On 2015-07-05 21:51, Julien ÉLIE wrote:
> Hi Richard,
> 
>>> https://github.com/ewxrjk/inntest
> 
> That's a pretty useful work, thanks!
> 
> 
>> Now with HTML output, for example:
>>
>> http://www.greenend.org.uk/rjk/junk/news/innfeed.html
> 
> Good to know that the outcome column is all OK.
> Regarding the response codes:
> - I think that's OK for 235 (article accepted) instead of 437 (rejected)
> for IHAVE commands in the examples you give (malformed From: and
> Expires: headers, and empty body) in order to be conservative in what
> has already been injected into Usenet.

OK, I'll change the test to accept the current behaviour.

> - Empty Followup-To: header with POST -> does the resulting article
> <4Dd2+P3h5tnpEkLjnDr9qhGr at test.terraraq.uk> contain that empty header?
> nnrpd normally removes it.

This is:

https://github.com/ewxrjk/inntest/blob/64a89a553850deac25ea6e301be4bb8e2ce73753/inntest/errors_post.py#L107

The NNTP messages are:

DEBUG:nntpbits.ClientConnection:00000000 SEND b'POST'
DEBUG:nntpbits.ClientConnection:00000000 RECV b'340 Ok, recommended
message-ID <mnoo45$gq7$6 at deodand.anjou.terraraq.org.uk>'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Message-ID:
<UQlJeAyowf3S3vIBzvH6f7cG at test.terraraq.uk>'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Newsgroups: local.test'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'From:
invalid at invalid.invalid'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Subject: [nntpbits]
empty followup test (ignore)'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Followup-To:'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Date: Fri, 10 Jul 2015
15:24:53 +0000'
DEBUG:nntpbits.ClientConnection:00000000 SEND b''
DEBUG:nntpbits.ClientConnection:00000000 SEND b'hhpR1q5Z2ftvOlk5idV8oKuE'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'.'
DEBUG:nntpbits.ClientConnection:00000000 RECV b'240 Article received
<UQlJeAyowf3S3vIBzvH6f7cG at test.terraraq.uk>'

> - Malformed From: header with POST -> could you please tell what is the
> malformed header you tried?  I think nnrpd should enforce a valid
> syntax, so this one is a real bug.

This is:

https://github.com/ewxrjk/inntest/blob/64a89a553850deac25ea6e301be4bb8e2ce73753/inntest/errors_post.py#L125

The NNTP messages are:

DEBUG:nntpbits.ClientConnection:00000000 SEND b'POST'
DEBUG:nntpbits.ClientConnection:00000000 RECV b'340 Ok, recommended
message-ID <mnoo45$gq7$9 at deodand.anjou.terraraq.org.uk>'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Message-ID:
<pyFJicVpZjRQeE39xBiUldJ3 at test.terraraq.uk>'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Newsgroups: local.test'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'From: @example.com'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Subject: [nntpbits]
malformed from test #2 (ignore)'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'Date: Fri, 10 Jul 2015
15:24:53 +0000'
DEBUG:nntpbits.ClientConnection:00000000 SEND b''
DEBUG:nntpbits.ClientConnection:00000000 SEND b'p6oh0XgoXHNjXzc5qBQDrhSu'
DEBUG:nntpbits.ClientConnection:00000000 SEND b'.'
DEBUG:nntpbits.ClientConnection:00000000 RECV b'240 Article received
<pyFJicVpZjRQeE39xBiUldJ3 at test.terraraq.uk>'

> - 435/438/439 instead of 501 to reject articles sent via
> IHAVE/CHECK/TAKETHIS is the right legacy behaviour.  Doing otherwise
> would break backwards compatibility so it shouldn't be encouraged right
> now.  Maybe in the future...

The tests here aren't about rejecting articles - they are about
malformed message IDs.

ttfn/rjk



More information about the inn-workers mailing list