Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
monicasarbu committed Sep 24, 2015
2 parents 8ea99ed + e23799a commit 3e37e51
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ full-coverage:
make -C ./tests coverage
# Writes count mode on top of file
echo 'mode: count' > ./coverage/full.cov
# Collects all integration coverage files and skips top line with mode
# Collects all coverage files and skips top line with mode
tail -q -n +2 ./coverage/*.cov >> ./coverage/full.cov
$(GODEP) go tool cover -html=./coverage/full.cov -o coverage/full.html
4 changes: 2 additions & 2 deletions docs/gettingstarted.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Packetbeat is to try it on your own traffic.
Follow the steps to get started with your own Packetbeat setup:

* Install the Packetbeat shippers on your servers so that they capture the network traffic. <<packetbeat-installation>>
* Install Elasticsearch for storage and indexing the data. {libbeat}getting-started.html#elasticsearch-installation[More details]
* Install Elasticsearch for storage and indexing the data. {libbeat}/getting-started.html#elasticsearch-installation[More details]
* Install Kibana for the UI. {libbeat}/getting-started.html#kibana-installation[More details]
* Install optionally Logstash. {libbeat}/getting-started.html#logstash[More details]
* Install optionally Logstash. {libbeat}/getting-started.html#logstash-installation[More details]
* Load sample Kibana dashboards to get it started. <<sample-dashboards>>


Expand Down
4 changes: 2 additions & 2 deletions docs/new_protocol.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ As an example, here is the relevant code from the REDIS module:
----------------------------------------------------------------------

The following fields are required and their presence will be checked by
integration tests:
system tests:

* `timestamp`. Set this to the timestamp of the first packet from the message
and cast it to `common.Time` like in the example above.
Expand Down Expand Up @@ -571,7 +571,7 @@ there's no transaction present.
To check the coverage of your unit tests, run the `make cover` command at the
top of the repository.

==== Integration testing
==== Sytem testing

Because the main input to Packetbeat are packets and the main output are JSON
objects, a convenient way of testing its functionality is by providing PCAP
Expand Down
10 changes: 5 additions & 5 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package main

// This file is mandatory as otherwise the packetbeat.test binary is not generated correctly. Reason???
// This file is mandatory as otherwise the packetbeat.test binary is not generated correctly.

import (
"testing"
"flag"
)

var integration *bool
var systemTest *bool

func init() {
integration = flag.Bool("integration", false, "Set to true when running integration tests")
systemTest = flag.Bool("systemTest", false, "Set to true when running system tests")
}

// Test started when the test binary is started. Only calls main.
func TestIntegration(t *testing.T) {
func TestSystem(t *testing.T) {

if *integration {
if *systemTest {
main()
}
}
8 changes: 4 additions & 4 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ test:
coverage: test
mkdir -p ../coverage
# Writes count mode on top of file
echo 'mode: count' > ../coverage/integration.cov
# Collects all integration coverage files and skips top line with mode
tail -q -n +2 ./run/**/*.cov >> ../coverage/integration.cov
echo 'mode: count' > ../coverage/system.cov
# Collects all system coverage files and skips top line with mode
tail -q -n +2 ./run/**/*.cov >> ../coverage/system.cov
# Generates HTML output
go tool cover -html=../coverage/integration.cov -o ../coverage/integration.html
go tool cover -html=../coverage/system.cov -o ../coverage/system.html

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Automatic tests for Packetbeat

This repository contains the integration tests for the [Packetbeat](http://packetbeat.com)
This repository contains the system tests for the [Packetbeat](http://packetbeat.com)
project.

## Running
Expand Down
4 changes: 2 additions & 2 deletions tests/pbtests/packetbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def run_packetbeat(self, pcap,
"-I", os.path.join("pcaps", pcap),
"-c", os.path.join(self.working_dir, config),
"-t",
"-integration",
"-systemTest",
"-test.coverprofile", os.path.join(self.working_dir, "coverage.cov")
])
if extra_args:
Expand Down Expand Up @@ -95,7 +95,7 @@ def start_packetbeat(self,
args = [cmd,
"-e",
"-c", os.path.join(self.working_dir, config),
"-integration",
"-systemTest",
"-test.coverprofile", os.path.join(self.working_dir, "coverage.cov")
]
if extra_args:
Expand Down

0 comments on commit 3e37e51

Please sign in to comment.