Compiling and testing Packetbeat for protocol development

Hi,

I'm interested in developing new protocol support for Packetbeat. As such I've followed the beats "CONTRIBUTING.md" guide and the docs on "Adding a New Protocol".

I've set up my Golang environment* and I can successfully run make, make unit-testsand make integration-tests from the "packetbeat" subdirectory and see all the tests pass.

However running make system-tests separately (or part of make testsuite) simply returns "Ran 0 tests in 0.003s".

I can see the "packetbeat/tests/system/" directory contains a variety of tests. If I run . build/python-env/bin/activate ; nosetests tests/system/* directly I see "Ran 89 tests in 0.027s" but they all fail with "ImportError: No module named beat.beat".

Have I missed a step in configuring my environment for contributing?

*I'm running Ubuntu 16.04 with Golang 1.6.2, Python 2.7.12, and Docker 1.11.2. I initially had some trouble with go vet in the make scripts as it seems that the go commands do not like symlinks under the GOPATH but rsyncing is fine.

Regards,

Jason

What is the GOPATH you cloned the beats project to? What python version do you have installed?

Hi,

My GOPATH environment variable value is /home/ubuntu/go.

The beats repository is cloned to /home/ubuntu/go/src/github.com/elastic/beats/.

python --version returns Python 2.7.12.

Regards,

Jason

Strange. Can you try to run make clean and then make system-tests in the packetbeat direcotry? I assume you are using the most recent Golang version and beats from master?

UPDATE: Just saw that you are using Golang 1.6.2 above.

Thanks for taking the time to look at this.

I've just repeated my provisioning commands on a Ubuntu 16.04 instance in AWS and the system tests are running correctly there.

I'll investigate the differences between the AWS instance and my local VM and report back if I find the cause. Otherwise consider this closed.

1 Like

Good to hear. Let me know in case you hit some other issues.

This topic was automatically closed after 21 days. New replies are no longer allowed.