Compiling and testing Packetbeat for protocol development

(Jason Stangroome) #1


I'm interested in developing new protocol support for Packetbeat. As such I've followed the beats "" 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.



(ruflin) #2

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

(Jason Stangroome) #3


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

The beats repository is cloned to /home/ubuntu/go/src/

python --version returns Python 2.7.12.



(ruflin) #4

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.

(Jason Stangroome) #5

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.

(ruflin) #6

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

(system) #7

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