I am unable to run python tests for packetbeat or any other beats.
Here's what I've done:
- in the packetbeat dir i ran
make python-dev
- then navigated to the tests/system folder and ran
nosetests -x -v
. Getting the following error:
❯ nosetests -x -v
Failure: ImportError (No module named beat.beat) ... ERROR
======================================================================
ERROR: Failure: ImportError (No module named beat.beat)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home//Projects/beats/packetbeat/tests/system/test_0001_mysql_spaces.py", line 1, in <module>
from packetbeat import BaseTest
File "/home//Projects/beats/packetbeat/tests/system/packetbeat.py", line 5, in <module>
from beat.beat import TestCase
ImportError: No module named beat.beat
In addition to that python code navigation does not work in either intellij or vscode for same reason:
❯ /home//Projects/beats/packetbeat/build/python-env/bin/python3 /home//Projects/beats/packetbeat/tests/system/test_0005_mysql_integration.py
Traceback (most recent call last):
File "/home//Projects/beats/packetbeat/tests/system/test_0005_mysql_integration.py", line 1, in <module>
from packetbeat import BaseTest
File "/home//Projects/beats/packetbeat/tests/system/packetbeat.py", line 5, in <module>
from beat.beat import TestCase
ModuleNotFoundError: No module named 'beat'