# Compiling and testing Packetbeat for protocol development

**URL:** <https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [August 1, 2016, 11:58am UTC](https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888 "2016-08-01T11:58:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jstangroome](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jstangroome/32/8654_2.png) [@jstangroome](https://discuss.elastic.co/u/jstangroome)\
**Post date:** [August 1, 2016, 11:58am UTC](https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888/1 "2016-08-01T11:58:27Z")

</div>

Hi,

I'm interested in developing new protocol support for Packetbeat. As such I've followed the beats "[CONTRIBUTING.md](http://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-tests`and `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

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [August 2, 2016, 8:17am UTC](https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888/2 "2016-08-02T08:17:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jstangroome](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jstangroome/32/8654_2.png) [@jstangroome](https://discuss.elastic.co/u/jstangroome)\
**Post date:** [August 2, 2016, 9:26am UTC](https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888/3 "2016-08-02T09:26:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [August 2, 2016, 9:59am UTC](https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888/4 "2016-08-02T09:59:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jstangroome](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jstangroome/32/8654_2.png) [@jstangroome](https://discuss.elastic.co/u/jstangroome)\
**Post date:** [August 2, 2016, 10:54am UTC](https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888/5 "2016-08-02T10:54:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [August 2, 2016, 11:22am UTC](https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888/6 "2016-08-02T11:22:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 22, 2016, 11:58am UTC](https://discuss.elastic.co/t/compiling-and-testing-packetbeat-for-protocol-development/56888/7 "2016-08-22T11:58:41Z")

</div>

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