diff --git a/.cirrus.yml b/.cirrus.yml index ca06ba7625..80290c1715 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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 @@ -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 diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 7c210913af..7d6493628f 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -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: fedora34 python: python3 diff --git a/ci/run_tests/run_tests.py b/ci/run_tests/run_tests.py index 0245d1ffc0..43a938e8e0 100644 --- a/ci/run_tests/run_tests.py +++ b/ci/run_tests/run_tests.py @@ -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", @@ -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: @@ -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: