Project

General

Profile

Actions

Feature #797

closed

Dynamic test on flag usage

Added by Eric Leblond about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:

Description

The idea is to generalized: https://github.com/inliniac/suricata/pull/341

By adding some comments in the code, we will trigger the creation of a test checking the correct usage of flag for a given structure. For example, we could add before the declaration of flag:

/* coccinelle: TcpStream:flags:STREAMTCP_STREAM_FLAG_ */

This would result in creating a block of tests in a dynamically generated cocci file that would be put in the qa/coccinelle directory:
ssn->flags@p1 |= ssn_flags
|
ssn->flags@p1 & ssn_flags
|
ssn->flags@p1 &= ~ssn_flags

The script searching for the entry will be called by 'make check' previously to the run of cocci test.

Actions

Also available in: Atom PDF