<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000000"><div>Hi Sebastian,</div><div><br data-mce-bogus="1"></div><div> Thanks for your quick reply. I'm not familiar with the nitty-gritty details of the automated builds vs. local builds but I don't see environment variables as a reliable method for separating these two cases. One option that comes to mind is trying to deduce whether dpkg-buildpackage is run from a terminal or not and implement this test inside the skip_build_environment method in <a class="moz-txt-link-freetext" href="https://github.com/certtools/intelmq/blob/5962fa9efb1c9d1ae454cc85d4aa05ddfe3d1080/intelmq/lib/test.py#L102" target="_blank" style="background: #bfe6ff; font-family: arial, helvetica, sans-serif; font-size: 13.3333px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;" rel="noopener" data-mce-href="https://github.com/certtools/intelmq/blob/5962fa9efb1c9d1ae454cc85d4aa05ddfe3d1080/intelmq/lib/test.py#L102" data-mce-style="background: #bfe6ff; font-family: arial, helvetica, sans-serif; font-size: 13.3333px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://github.com/certtools/intelmq/blob/5962fa9efb1c9d1ae454cc85d4aa05ddfe3d1080/intelmq/lib/test.py#L102</a>. I'm probably unaware of other constraints and details affecting this, so let me know if this is a bad idea.</div><div><br data-mce-bogus="1"></div><div>Br, MIka</div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"Sebastian Wagner" <wagner@cert.at><br><b>To: </b>"Mika Silander" <mika.silander@csc.fi>, "intelmq-dev" <intelmq-dev@lists.cert.at><br><b>Sent: </b>Tuesday, 5 October, 2021 12:09:16<br><b>Subject: </b>Re: [IntelMQ-dev] Building packages for intelmq 3.0.2 stumbles on two tests<br></div><div><br></div><div data-marker="__QUOTED_TEXT__"><p>Dear Mika,</p>
    <p>These two tests are known to fail in build environments. I guess
      that their intentional limitations on networking cause some
      troubles here, but I don't know the exact reason. Therefore we
      skip these two tests in such environments (see the two links) but
      a local build with dpkg-buildpackage is obviously not covered yet
      by that logic.</p>
    <p><a class="moz-txt-link-freetext" href="https://github.com/certtools/intelmq/blob/5962fa9efb1c9d1ae454cc85d4aa05ddfe3d1080/intelmq/tests/bots/collectors/tcp/test_collector.py#L68" target="_blank">https://github.com/certtools/intelmq/blob/5962fa9efb1c9d1ae454cc85d4aa05ddfe3d1080/intelmq/tests/bots/collectors/tcp/test_collector.py#L68</a><br>
<a class="moz-txt-link-freetext" href="https://github.com/certtools/intelmq/blob/5962fa9efb1c9d1ae454cc85d4aa05ddfe3d1080/intelmq/lib/test.py#L102" target="_blank">https://github.com/certtools/intelmq/blob/5962fa9efb1c9d1ae454cc85d4aa05ddfe3d1080/intelmq/lib/test.py#L102</a></p>
    <p>Do you know if there's some env variable set which we could check
      on? Then we can add that to the <span class="pl-en"><span class="pl-token active">skip_build_environment
          definition.</span></span></p>
    <p><span class="pl-en"><span class="pl-token active">Hope
          that helps</span></span></p>
    <p><span class="pl-en"><span class="pl-token active">Sebastian<br>
        </span></span></p>
    <div class="moz-cite-prefix">On 10/5/21 10:55 AM, Mika Silander
      wrote:<br>
    </div>
    <blockquote cite="mid:551416591.4228286.1633424129173.JavaMail.zimbra@csc.fi">
      <pre class="moz-quote-pre">Hi,

 Tried building the intelmq debian packages on a Ubuntu 18 LTS, python 3.6 with

dpkg-buildpackage -us -uc -b -d

 Branch was maintenance, tag 3.0.2 and the option -d above was added because Cerberus 1.3.2 was installed with pip3
and not with apt from python3-cerberus. Seems two tests make the build fail, see below.

 A known problem? Any hints for troubleshooting this? Airing this here before starting to debug on my own ...

Cheers, Mika

======================================================================
FAIL: test_multiple_bots (intelmq.tests.bots.collectors.tcp.test_collector.TestTCPCollectorBot)
Let's simulate multiple IntelMQ instances are pushing the events at once!
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mika/intelmq/intelmq/tests/bots/collectors/tcp/test_collector.py", line 175, in test_multiple_bots
    self.run_bot(iterations=client_count + 1)
  File "/home/mika/intelmq/intelmq/lib/test.py", line 361, in run_bot
    self.assertLessEqual(len(re.findall(' - ERROR - ', self.loglines_buffer)), allowed_error_count)
AssertionError: 2 not less than or equal to 0

======================================================================
FAIL: test_random_input (intelmq.tests.bots.collectors.tcp.test_collector.TestTCPCollectorBot)
Check how we handle a random input, coming from an unknown source. We should put all the data to report['raw'].
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mika/intelmq/intelmq/tests/bots/collectors/tcp/test_collector.py", line 106, in test_random_input
    self.run_bot()
  File "/home/mika/intelmq/intelmq/lib/test.py", line 363, in run_bot
    self.assertLessEqual(len(re.findall(' - WARNING - ', self.loglines_buffer)), allowed_warning_count)
AssertionError: 1 not less than or equal to 0

----------------------------------------------------------------------
Ran 1404 tests in 125.121s

FAILED (failures=2, skipped=274)
Test failed: <unittest.runner.TextTestResult run=1404 errors=0 failures=2>
error: Test failed: <unittest.runner.TextTestResult run=1404 errors=0 failures=2>
E: pybuild pybuild:336: test: plugin distutils failed with: exit code=1: python3.6 setup.py test 
dh_auto_test: pybuild --test -i python{version} -p 3.6 returned exit code 13
debian/rules:23: recipe for target 'build' failed
make: *** [build] Error 25
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
_______________________________________________
IntelMQ-dev mailing list
<a class="moz-txt-link-freetext" href="https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev" target="_blank">https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev</a>
<a class="moz-txt-link-freetext" href="https://intelmq.readthedocs.io/" target="_blank">https://intelmq.readthedocs.io/</a>
</pre>
    </blockquote>
    <pre class="moz-signature">-- 
// Sebastian Wagner <a class="moz-txt-link-rfc2396E" href="mailto:wagner@cert.at" target="_blank"><wagner@cert.at></a> - T: +43 676 898 298 7201
// CERT Austria - <a class="moz-txt-link-freetext" href="https://www.cert.at/" target="_blank">https://www.cert.at/</a>
// Eine Initiative der nic.at GmbH - <a class="moz-txt-link-freetext" href="https://www.nic.at/" target="_blank">https://www.nic.at/</a>
// Firmenbuchnummer 172568b, LG Salzburg</pre><br></div></div></body></html>