From 3e11f713364bc519273115dc9481c2218c250680 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sun, 7 Dec 2025 15:54:48 -0500 Subject: [PATCH 1/2] ovn: fix command presence detection during checkPhase The test suite uses `which` to detect if auxiliary dependencies like scapy or tcpdump are installed on the system, and skips the tests using these commands if not. Problem is when `which` is missing, all such commands are detected as missing, so some tests that could be safely run are unnecessarily skipped. Note: upstream should probably not swallow the error from missing `which` and instead enforce its presence during build. Or better: use `command -v` that is always present. --- pkgs/by-name/ov/ovn/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/ov/ovn/package.nix b/pkgs/by-name/ov/ovn/package.nix index 2946f814f2d8..15f3e89450a1 100644 --- a/pkgs/by-name/ov/ovn/package.nix +++ b/pkgs/by-name/ov/ovn/package.nix @@ -19,6 +19,7 @@ coreutils, gnugrep, gnused, + which, makeWrapper, }: let @@ -72,6 +73,9 @@ stdenv.mkDerivation (finalAttrs: { pkg-config python3 makeWrapper + # NOTE: remove if OVN switches to `command -v`: + # https://patchwork.ozlabs.org/project/ovn/patch/20260205004956.84602-3-ihar.hrachyshka@gmail.com/ + which # used in test suite to detect presence of commands ]; buildInputs = [ From 30fd8c9daf4968cf50ef1e2d8b6ea618d2f3c6cb Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sun, 7 Dec 2025 14:00:03 -0500 Subject: [PATCH 2/2] ovn: run scapy based tests With scapy in python import path, additional test cases that use it will be executed during test run. --- pkgs/by-name/ov/ovn/package.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ov/ovn/package.nix b/pkgs/by-name/ov/ovn/package.nix index 15f3e89450a1..c466362858ae 100644 --- a/pkgs/by-name/ov/ovn/package.nix +++ b/pkgs/by-name/ov/ovn/package.nix @@ -19,8 +19,12 @@ coreutils, gnugrep, gnused, - which, makeWrapper, + + # test dependencies + which, + util-linux, + tcpdump, }: let withOpensslConfigureFlag = "--with-openssl=${lib.getLib openssl.dev}"; @@ -112,8 +116,18 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; nativeCheckInputs = [ - openssl # used to generate certificates used for test services + # used to generate certificates used for test services + openssl procps + + # some tests may need tcpdump to run + tcpdump + + # scapy-server imports scapy module + (python3.withPackages (ps: with ps; [ scapy ])) + + # scapy tests use flock to start scapy-server + util-linux ]; postInstall = '' @@ -156,6 +170,8 @@ stdenv.mkDerivation (finalAttrs: { # hack to stop tests from trying to read /etc/resolv.conf export OVS_RESOLV_CONF="$PWD/resolv.conf" touch $OVS_RESOLV_CONF + + patchShebangs --build tests/scapy-server.py ''; checkPhase = ''