<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>In the Ubuntu 18.04 package builds 1404 tests are running, with
      skipped=285
(<a class="moz-txt-link-freetext" href="https://build.opensuse.org/public/build/home:sebix:intelmq/xUbuntu_18.04/x86_64/intelmq/_log">https://build.opensuse.org/public/build/home:sebix:intelmq/xUbuntu_18.04/x86_64/intelmq/_log</a>
      at 617s), so the numbers are perfectly legit.</p>
    <p>To detect if the tests are running inside the dpkg-buildpackage
      environment, I extended the detection logic by checking for
      DEB_BUILD_ARCH:
<a class="moz-txt-link-freetext" href="https://github.com/certtools/intelmq/commit/7ebb8e16d821c372a44b077dd18a151c07f75807">https://github.com/certtools/intelmq/commit/7ebb8e16d821c372a44b077dd18a151c07f75807</a></p>
    <p>Sebastian<br>
    </p>
    <div class="moz-cite-prefix">On 10/5/21 2:31 PM, Mika Silander
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:149854406.4383810.1633437078428.JavaMail.zimbra@csc.fi">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <div style="font-family: arial, helvetica, sans-serif; font-size:
        10pt; color: #000000">
        <div>Hi,</div>
        <div><br data-mce-bogus="1">
        </div>
        <div> Answering myself here: I got the below going by checking
          the availability of the terminal inside
          skip_build_environment, so manual builds from a CLI with
          dpkg-buildpackage seem to succeed for branch maintenance, tag
          3.0.2. Build stats included 1404 tests run, 286 skipped ok
          (for various reasons). Let me know if those numbers are not
          reasonable.</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>Br, Mika</div>
        <hr id="zwchr" data-marker="__DIVIDER__">
        <div data-marker="__HEADERS__"><b>From: </b>"Mika Silander"
          <a class="moz-txt-link-rfc2396E" href="mailto:mika.silander@csc.fi"><mika.silander@csc.fi></a><br>
          <b>To: </b>"intelmq-dev" <a class="moz-txt-link-rfc2396E" href="mailto:intelmq-dev@lists.cert.at"><intelmq-dev@lists.cert.at></a><br>
          <b>Sent: </b>Tuesday, 5 October, 2021 12:25:50<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__">
          <div style="font-family: arial, helvetica, sans-serif;
            font-size: 10pt; color: #000000">
            <div>Hi Sebastian,</div>
            <br>
            <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"
                moz-do-not-send="true">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>
            <br>
            <div>Br, MIka</div>
            <br>
            <hr id="zwchr">
            <div><b>From: </b>"Sebastian Wagner" <a class="moz-txt-link-rfc2396E" href="mailto:wagner@cert.at"><wagner@cert.at></a><br>
              <b>To: </b>"Mika Silander" <a class="moz-txt-link-rfc2396E" href="mailto:mika.silander@csc.fi"><mika.silander@csc.fi></a>,
              "intelmq-dev" <a class="moz-txt-link-rfc2396E" href="mailto:intelmq-dev@lists.cert.at"><intelmq-dev@lists.cert.at></a><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>
            <br>
            <div>
              <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" moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev</a>
<a class="moz-txt-link-freetext" href="https://intelmq.readthedocs.io/" target="_blank" moz-do-not-send="true">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" moz-do-not-send="true"><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" moz-do-not-send="true">https://www.cert.at/</a>
// Eine Initiative der nic.at GmbH - <a class="moz-txt-link-freetext" href="https://www.nic.at/" target="_blank" moz-do-not-send="true">https://www.nic.at/</a>
// Firmenbuchnummer 172568b, LG Salzburg</pre>
              <br>
            </div>
          </div>
          <br>
          _______________________________________________<br>
          IntelMQ-dev mailing list<br>
          <a class="moz-txt-link-freetext" href="https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev">https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev</a><br>
          <a class="moz-txt-link-freetext" href="https://intelmq.readthedocs.io/">https://intelmq.readthedocs.io/</a><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
IntelMQ-dev mailing list
<a class="moz-txt-link-freetext" href="https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev">https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev</a>
<a class="moz-txt-link-freetext" href="https://intelmq.readthedocs.io/">https://intelmq.readthedocs.io/</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
// Sebastian Wagner <a class="moz-txt-link-rfc2396E" href="mailto:wagner@cert.at"><wagner@cert.at></a> - T: +43 676 898 298 7201
// CERT Austria - <a class="moz-txt-link-freetext" href="https://www.cert.at/">https://www.cert.at/</a>
// Eine Initiative der nic.at GmbH - <a class="moz-txt-link-freetext" href="https://www.nic.at/">https://www.nic.at/</a>
// Firmenbuchnummer 172568b, LG Salzburg</pre>
  </body>
</html>