mushorg / conpot

ICS/SCADA honeypot
GNU General Public License v2.0
1.21k stars 410 forks source link

Testing using GH Actions #529

Closed glaslos closed 3 years ago

glaslos commented 3 years ago

Switching tests from Travis to GH Actions.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 1273


Files with Coverage Reduction New Missed Lines %
conpot/protocols/ftp/ftp_base_handler.py 12 77.85%
conpot/protocols/ipmi/fakebmc.py 15 56.25%
conpot/protocols/ftp/ftp_handler.py 20 79.3%
conpot/protocols/ipmi/ipmi_server.py 153 23.37%
conpot/protocols/ipmi/fakesession.py 176 9.42%
<!-- Total: 376 -->
Totals Coverage Status
Change from base Build 1271: -4.9%
Covered Lines: 5173
Relevant Lines: 7532

💛 - Coveralls
glaslos commented 3 years ago

@srenfo any idea why the IPMI tests are failing here? Seems to fail with 3.7 and 3.8

srenfo commented 3 years ago

@srenfo any idea why the IPMI tests are failing here? Seems to fail with 3.7 and 3.8

It's because the IPMI tests hardcode localhost as the server name:

https://github.com/mushorg/conpot/blob/237b1563eeffc42c8741d5a078a2fa22b1dff772/conpot/tests/test_ipmi_server.py#L32-L35

...and at least on my machine, localhost resolved to IPv6 ::1 while the test server was bound to IPv4 127.0.0.1. :facepalm:

This is compounded by the fact that the tests hide stderr, making this impossible to debug from just CI output.

The error went away when I forced IPv4 by adding -4 to the ipmitool command line. The proper fix is to just get the address from the server. I'm preparing a PR.