|
1 | 1 | import fasteners
|
2 | 2 | import os
|
3 | 3 | import subprocess
|
4 |
| -# import pytest |
| 4 | +import pytest |
5 | 5 |
|
6 | 6 | from regression.end_to_end.driver import run_security_analyser_pipeline
|
7 | 7 | import regression.utils as utils
|
8 | 8 |
|
9 | 9 |
|
10 |
| -# @pytest.mark.xfail(strict=True) |
| 10 | +@pytest.mark.xfail(strict=True) |
11 | 11 | @fasteners.interprocess_locked(os.path.join(os.path.dirname(__file__), ".build_lock"))
|
12 |
| -def test_xxe02(load_strategy): |
| 12 | +def test_xxe02_no_xxe_issue(load_strategy): |
13 | 13 | with utils.working_dir(os.path.abspath(os.path.dirname(__file__))):
|
14 | 14 | subprocess.call(["ant"])
|
15 | 15 | with run_security_analyser_pipeline(
|
16 | 16 | "build",
|
17 | 17 | "rules.json",
|
18 | 18 | os.path.realpath(os.path.dirname(__file__)),
|
19 |
| - "xxe02.Main.main", |
| 19 | + "xxe02.Main.no_xxe_issue", |
| 20 | + load_strategy, |
| 21 | + extra_args=["--use-xxe-models-library"]) as traces: |
| 22 | + assert traces.count_traces() == 0 |
| 23 | + |
| 24 | + |
| 25 | +@fasteners.interprocess_locked(os.path.join(os.path.dirname(__file__), ".build_lock")) |
| 26 | +def test_xxe02_xxe_issue(load_strategy): |
| 27 | + with utils.working_dir(os.path.abspath(os.path.dirname(__file__))): |
| 28 | + subprocess.call(["ant"]) |
| 29 | + with run_security_analyser_pipeline( |
| 30 | + "build", |
| 31 | + "rules.json", |
| 32 | + os.path.realpath(os.path.dirname(__file__)), |
| 33 | + "xxe02.Main.xxe_issue", |
20 | 34 | load_strategy,
|
21 | 35 | extra_args=["--use-xxe-models-library"]) as traces:
|
22 | 36 | assert traces.count_traces() == 1
|
23 | 37 | assert traces.trace_exists(
|
24 |
| - "java::xxe02.Main.main:([Ljava/lang/String;)V", 25) |
| 38 | + "java::xxe02.Main.xxe_issue:(Ljava/lang/String;)V", 36) |
25 | 39 |
|
0 commit comments