Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ Or to run a single test:
../path/to/suricata-tests/run.py TEST-NAME
```

For Unix socket tests, the path to `suricatasc` can be overridden with the
`SURICATASC` environment variable:

```
SURICATASC=/path/to/suricatasc ../path/to/suricata-tests/run.py
```

## Adding a New Test

- Create a directory that is the name of the new test.
Expand Down
16 changes: 9 additions & 7 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,13 +1383,15 @@ def main():
HAS_SURICATA_SC = None
global suricatasc_bin
if not args.skipunixsocket:
sc_path = [".", "rust", "target", "release", "suricatasc"]
if "DEBUG" in suricata_config.features:
sc_path[3] = "debug"
cargo_build_target = os.environ.get("CARGO_BUILD_TARGET")
if cargo_build_target != None :
sc_path.insert(3, cargo_build_target)
suricatasc_bin = os.path.join(*sc_path)
suricatasc_bin = os.environ.get("SURICATASC")
if suricatasc_bin is None:
sc_path = [".", "rust", "target", "release", "suricatasc"]
if "DEBUG" in suricata_config.features:
sc_path[3] = "debug"
cargo_build_target = os.environ.get("CARGO_BUILD_TARGET")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting CARGO_BUILD_TARGET is another way, but in this case, I don't want to alter the cargo build environment as it can affect the build of the included eve validation program.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use a SURICATASC_BUILD_TARGET ? if this is just about the target.

I find rust's way hard to find where my binary was built :-/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how we pick up the target between release and debug builds. Its not related to this PR.

if cargo_build_target != None :
sc_path.insert(3, cargo_build_target)
suricatasc_bin = os.path.join(*sc_path)
if os.path.exists(suricatasc_bin):
HAS_SURICATA_SC = True
else:
Expand Down
Loading