From 5e49d287af2cdb539dfe8e9c96e44233c3512c0a Mon Sep 17 00:00:00 2001 From: Ruflin Date: Wed, 23 Sep 2015 13:01:49 +0200 Subject: [PATCH 1/2] Rename integration to system tests --- Makefile | 2 +- docs/new_protocol.asciidoc | 4 ++-- main_test.go | 10 +++++----- tests/Makefile | 8 ++++---- tests/README.md | 2 +- tests/pbtests/packetbeat.py | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 213056bf1ad..c52b776926f 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,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 diff --git a/docs/new_protocol.asciidoc b/docs/new_protocol.asciidoc index a3af730540c..33c8bae975a 100644 --- a/docs/new_protocol.asciidoc +++ b/docs/new_protocol.asciidoc @@ -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. @@ -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 diff --git a/main_test.go b/main_test.go index e1beacfe6f6..fa80deb2444 100644 --- a/main_test.go +++ b/main_test.go @@ -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() } } diff --git a/tests/Makefile b/tests/Makefile index 2bd652567d4..a14969b8271 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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: diff --git a/tests/README.md b/tests/README.md index ae06451df0d..50c60e69912 100644 --- a/tests/README.md +++ b/tests/README.md @@ -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 diff --git a/tests/pbtests/packetbeat.py b/tests/pbtests/packetbeat.py index 8ed13d1add3..8f61e11d3bd 100644 --- a/tests/pbtests/packetbeat.py +++ b/tests/pbtests/packetbeat.py @@ -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: @@ -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: From 7c0e717984f0285fe5e249bf9c763d18ead53470 Mon Sep 17 00:00:00 2001 From: Monica Sarbu Date: Thu, 24 Sep 2015 19:40:19 +0200 Subject: [PATCH 2/2] More external links fixes --- docs/gettingstarted.asciidoc | 4 ++-- docs/gettingstarted.in.asciidoc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/gettingstarted.asciidoc b/docs/gettingstarted.asciidoc index 61791fb8011..f845e1b18f3 100644 --- a/docs/gettingstarted.asciidoc +++ b/docs/gettingstarted.asciidoc @@ -16,9 +16,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. <> - * 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. <> diff --git a/docs/gettingstarted.in.asciidoc b/docs/gettingstarted.in.asciidoc index 105ca393772..c81f1781448 100644 --- a/docs/gettingstarted.in.asciidoc +++ b/docs/gettingstarted.in.asciidoc @@ -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. <> - * 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. <>