Commit Graph

74 Commits (e2c557cfdb48ac13ed535ee672d49d58b5a772c5)

Author SHA1 Message Date
Victor Julien bc2b53f10b parsing: s/strtok/strtok_r/g
Remove all strtok uses and replace them by strtok_r.

Do the same for Windows builds. Cygwin builds fine with strtok_r.

Add strtok to banned function list.
10 years ago
Eric Leblond da98b0b84f coccinelle: update struct flags test 10 years ago
Eric Leblond f7a25f2b24 prscript: rework option logic
Handle cleanly the case where user start docker handling command
without having the dependency installed. The help message does
now say:

```
  -d, --docker          use docker based testing
  -C, --create          create docker container (disabled)
  -s, --start           start docker container (disabled)
  -S, --stop            stop docker container (disabled)

You need to install Python docker module to enable docker container handling
options.
```

And running a disabled options says:

```
$ qa/prscript.py -s
You need to install python docker to use docker handling features.
```
10 years ago
Eric Leblond 0b64b992c9 prscript: fix error message in non local test
Indicate to user that non local test needs a github user.
10 years ago
Eric Leblond 8a0ebc4ade prscript: improve command line
You can now directly access to docker related command:

 qa/prscript.py -C # create container
 qa/prscript.py -s # start container
 qa/prscript.py -S # stop container

The build option does not change:

 qa/prscript.pu -l -d MY_BRANCH # build test of branch MY_BRANCH
10 years ago
Eric Leblond fe45f2a342 prscript: add notification system
If Python pynotify is installed, prscript can now send notification
via the -n flag.
10 years ago
Eric Leblond ef627816cc prscript: improve wordings 10 years ago
Eric Leblond a3c921f0a6 prscript: suppress useless message
No build run faster than 2 seconds.
10 years ago
Eric Leblond fbe5db500c prscript: iterate on builds when checking status
This patch is changing the logic when using docker mode. We are
iterating over each builds so we know when one build is over in
the 5 seconds following the event instead of getting the result
when the builds that are checked before are others.

On OISF's build system, the two builds comes out in order so there
is no problem.
10 years ago
Eric Leblond f12e6fdcda prscript: read buildbot config from source
This patch change the logic of the Docker buildbot system. The
buildbot configuration is now the one available in qa/docker
directory.

This way, developers can test features in docker buildbot that
could require some specific flags to be set. They just need to
edit the buildbot.cfg for instance to enable a new feature.

In the same way, the tested pcap files are the one which are in
the qa/docker/pcaps/ directory. So to test some private ones it is
enough to put them in that directory.

To take into consideration a buildbot.cfg modification or a new
pcap, it is enough to stop and restart the container:

 sudo qa/prscript.py -l -d -S master
 sudo qa/prscript.py -l -d -s master

This patch also fixes the container update issue. A local modification
to the buildbot will be kept. It is also fixing the issue when working
on old code that could possibly not support the same build flag as
the one of buildbot. Here the configuration will remains in sync.
10 years ago
Eric Leblond be473fa712 prscript: add a comment on the SELinux issue 10 years ago
Eric Leblond 1180fc1ac7 prscript: add docker handling support
You can now create the docker image necessary to run a
suricata builbot in docker. To do that you need to have
docker and python-docker installed on the system.

Then you can go to the qa directory.

You need to run once the creattion procedure:
 sudo ./prscript.py  -C -d master  -l
This will create a container named 'suri-buildbot'.

You can start it with:
 sudo ./prscript.py  -s -d master  -l

And stop it with:
 sudo ./prscript.py  -S -d master  -l

To start a test, you can do:
 ./prscript.py -d my_branch -l
10 years ago
Eric Leblond dd6f9a6298 prscript: refactor for docker
With the current work in progress on docker we need to update the
script to handle this case.

This patch adds two options:
 - -d to run in docker mode. In that case the build is started in
 the local dockerized buildbot instance
 - -l to not test the tested branch synchronization with github.

The -l option allows user to run a complete test without publishing
the code on github and without Internet access.
10 years ago
Jason Ish 754ea3d849 prscript - fallback to json is simplejson not available. 10 years ago
Victor Julien 4c73631f95 Suppress ARM valgrind warning
Not Suricata related, so suppress.
10 years ago
Eric Leblond 4b9eecc7f6 prscript: update URL
Buildbot server has been moved to another box.
10 years ago
Eric Leblond d7982fae8c coccinelle: fix problem with coccinelle 1.0rc21
coccinelle 1.0rc21 has a problem with regular expression handling.
This result in a Fatal Error when test system detects an coding
error.

This patch fixes the problem by using a simple blob inside
semantic patch instead of using a regular expression to define
the function.

It also fixes add an optimization on matching suppressing a
useless <.. ..> construction.

Fixes have been suggested by Julia Lawall.
10 years ago
Victor Julien 7ee2aa9c90 Add initial travis-ci integration. 10 years ago
Victor Julien a9282ed7f7 valgrind/magic: add suppression for known issue
Add suppression for Ubuntu 14.04 64bit.
10 years ago
Victor Julien c8d2a1e417 drmemory: remove bug 978 suppression
Bug is fixed, so suppression is no longer needed.

Bug #978.
11 years ago
Victor Julien 385c04164b Updated banned function cocci check
Added: strndup and strchrnul

Both are not supported on OS X 10.6. It's rather old, but it's the
only Mac QA box I have, so for now it'll have to do.
11 years ago
Victor Julien 80456f3e7d Bug 1083 and 1084: add valgrind suppressions
Add suppressions as these are minor issues and likely not bugs in
Suricata.
11 years ago
Victor Julien 84f14438c3 Bug 980: fix HTTP memory cleanup at shutdown
Buffers in per thread HTTP header, client body and server body storage
would be freed based on the usage indicator instead of the size
indicator.

As the usage indicator (e.g. hsbd_buffers_list_len) could be reset
while leaving the memory untouched for later reuse, the free function
would not iterate over all memory blocks.

Removed DrMemory suppressions as well.

Bug #980.
11 years ago
Eric Leblond 55108167e5 prscript: add --norebase option
If --norebase option is provided, the prscript will start a build
that can be used to check if an out-of-sync branch pass the test.
11 years ago
Eric Leblond 7cc87bc02a coccinelle: protecting regexp operator is not needed
It seems there was an evolution of coccinelle and the protection
of regexp is not necessary anymore. And doing it causing the
expression not to match.
11 years ago
Eric Leblond 1fbaebad63 coccinelle: add test on realloc
If we use SCRealloc like:
 x = SCRealloc(x, ...)
then in case of failure we are loosing the original pointer value
and the memory is lost and can not be free.

This test just check for this construction and output an error if
it finds it.
11 years ago
Victor Julien 01c440bf28 Add DrMemory suppression for Bug #980. Suppress useless (likely) buggy leak message too 11 years ago
Victor Julien 1509c9a2e6 Remove DrMemory suppressions for Bug #979, it is fixed. 11 years ago
Eric Leblond 5a7ad5b382 qa: prscript now output pastable line for PR. 11 years ago
Eric Leblond a597237aed coccinelle: fix malloc test
We can have more than an identifier to be assigned the result of
a malloc function.
11 years ago
Eric Leblond 6378db89f6 coccinelle: add option to continue on errors
When a script has been updated or introduced, it is interesting to
detect all errors at once. With this patch it is now possible to
do so by using:
   NOT_TERMINAL=1 CONCURRENCY_LEVEL=12  qa/coccinelle/run_check.sh
11 years ago
Eric Leblond a8fde0112e prscript: add support for pcap build
Now also start a pcap test build.
11 years ago
Victor Julien 614133b4ca valgrind: add suppression file 11 years ago
Eric Leblond 0a1ca02b3b coccinelle: implement parallel check
This patch is an implementation of parallel check of files. It uses
GNU parallel to run multiple spatch at once.
The concurrency level is set via the CONCURRENCY_LEVEL environment
variable.
11 years ago
Victor Julien 1180f633e2 Add DrMemory suppress file
The suppress file currently suppresses:
- bug #978
- bug #979

Plus a seemingly harmeless warning that happens during libmagic init.

DrMemory is a valgrind like memory checker: http://www.drmemory.org/
11 years ago
Eric Leblond 013e7a0573 prscript: update code following buildbot upgrade
The authentication scheme did change on the buildbot due to a
software upgrade. This patch update prscript.py to fix the build
submission.
11 years ago
Eric Leblond fa861b09ac prscript: support bigger PR
The script now looks for originan HEAD in 100 commits instead of 30.
It should be enough becasue a sane PR should not have 100 commits.
11 years ago
Eric Leblond ad1546d59a prscript: display url where user can watch build 11 years ago
Eric Leblond 8a96296b4a prscript: add verbose option 11 years ago
Eric Leblond f23556dcdb prscript: exit when no build exists 11 years ago
Eric Leblond c151b218f1 prscript: check if branch is synced with master
The script now check if the tested branch is in sync with current
inliniac's master.
11 years ago
Eric Leblond c390006aee script: add script to start personal builder
This script HAS to be used by developer having an account on Suricata
buildbot. It MUST be run before doing a PR. It will trigger a build on
the branch and this will check the validity of the proposed branch.
The cinematic is simple:
 - Push branch XXX to github
 - Run 'prscript.py -u USER -p PASSWORD XXX'
 - Wait for the result
 - If successful, PR can be done
11 years ago
Eric Leblond 867a44f378 autotools: all target are conditional 11 years ago
Eric Leblond 9212ff7e59 coccinelle: dynamic testing through make check
This patch modify build system to have make to create the
struct-flags.cocci file by running struct-flags.py.

This way 'make check' is running the test defined from source
code.
11 years ago
Eric Leblond e05fd7f1d0 coccinelle: add script to generate flags test
This patch adds a script which can be used to generate a test
on coherence of flag usage.

By adding comment in the code, it is possible to declare that we
link a flag in a structure to a specific family of constant:

For example:
	/* coccinelle: Packet:flowflags:FLOW_PKT_ */
will trigger the generation on a test which verifies that the
flowflags field in Packet structure is only used with constant
starting by FLOW_PKT_.
11 years ago
Eric Leblond ce95fbdda0 action handling: add test to avoid direct access
Direct access to the action field of Packet structure is not
allowed.
11 years ago
Eric Leblond 41ebfa77af coccinelle: update pkt not set test
This patch updates the test to add the support of initialization
of a Packet via the INITIALIZE macro.
12 years ago
Eric Leblond c9d90e6596 coccinelle: add tcp flag check
The different TCP related structures have all a flags field and its
value must match the type of structure. This patch adds a check
alerting on invalid value usage.
12 years ago
Eric Leblond aa9f795800 cocci test: add sizeof test
This patch adds a new semantic patch taken from
http://coccinellery.org/. This patch tests if a sizeof take size
of pointer and not of pointed value.
12 years ago
Eric Leblond 7293040ed8 coccinelle: fix distcheck
distcheck is running run_check.sh from another directory and
run_check.sh was not ready for this.
12 years ago