Skip to content

Commit

Permalink
Merge branch 'dev' into package
Browse files Browse the repository at this point in the history
  • Loading branch information
seladb authored Sep 7, 2023
2 parents 5e93077 + 22c6c85 commit 6a7e459
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ task:
test_pcapplusplus_script:
- python3 -m pip install gcovr
- python3 -m pip install -r ci/run_tests/requirements.txt
- python3 ci/run_tests/run_tests.py --interface eth0
- python3 ci/run_tests/run_tests.py --interface eth0 --pcap-test-args="-n"
coverage_report_script:
- gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
- curl -Os https://uploader.codecov.io/latest/linux/codecov
Expand All @@ -61,7 +61,7 @@ task:
test_pcapplusplus_script:
- python3 -m ensurepip
- python3 -m pip install -r ci/run_tests/requirements.txt
- python3 ci/run_tests/run_tests.py --interface en0 --test-args="-x TestPcapLiveDeviceSpecialCfg"
- python3 ci/run_tests/run_tests.py --interface en0 --pcap-test-args="-x TestPcapLiveDeviceSpecialCfg"
coverage_report_script:
- gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
- curl -Os https://uploader.codecov.io/latest/macos/codecov
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ jobs:
config-zstd: OFF
- image: centos7
python: python3.8
test-flags: --test-args="-s"
# TODO: TestLoggerMultiThread sometimes fail in CI so we exclude it for now, need to look into it
test-flags: --pcap-test-args="-s -x TestLoggerMultiThread"
config-zstd: OFF
- image: fedora37
python: python3
Expand Down
20 changes: 12 additions & 8 deletions ci/run_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@

def main():
parser = argparse.ArgumentParser()
parser.add_argument("--interface", type=str, required=True, help="interface to use")
parser.add_argument(
"--interface", "-i", type=str, required=True, help="interface to use"
"--use-sudo", action="store_true", help="use sudo when running tests"
)
parser.add_argument(
"--use-sudo", "-s", action="store_true", help="use sudo when running tests"
"--packet-test-args",
type=str,
default="",
help="packet++ test arguments",
)
parser.add_argument(
"--test-args",
"-t",
"--pcap-test-args",
type=str,
default="",
help="test arguments",
help="pcap++ test arguments",
)
parser.add_argument(
"--tcpreplay-dir",
"-d",
type=str,
default=None,
help="tcpreplay directory",
Expand All @@ -41,7 +43,9 @@ def main():

use_sudo = ["sudo"] if args.use_sudo else []
completed_process = subprocess.run(
use_sudo + [os.path.join("Bin", "Packet++Test")] + args.test_args.split(),
use_sudo
+ [os.path.join("Bin", "Packet++Test")]
+ args.packet_test_args.split(),
cwd="Tests/Packet++Test",
)
if completed_process.returncode != 0:
Expand All @@ -50,7 +54,7 @@ def main():
completed_process = subprocess.run(
use_sudo
+ [os.path.join("Bin", "Pcap++Test"), "-i", ip_address]
+ args.test_args.split(),
+ args.pcap_test_args.split(),
cwd="Tests/Pcap++Test",
)
if completed_process.returncode != 0:
Expand Down

0 comments on commit 6a7e459

Please sign in to comment.