depot/third_party/nixpkgs/pkgs/servers/sip/kamailio/test-kamailio-bin/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

24 lines
691 B
Nix

{ stdenv, kamailio }:
stdenv.mkDerivation {
name = "kamailio-bin-test";
meta.timeout = 60;
src = ./.;
dontInstall = true;
buildPhase = ''
mkdir $out
${kamailio}/bin/kamailio -v > $out/kamailio-stdout
${kamailio}/bin/kamcmd -h > $out/kamcmd-stdout
(${kamailio}/bin/kamctl help || exit 0) > $out/kamctl-stdout
'';
doCheck = true;
checkPhase = ''
grep -q "version: kamailio" $out/kamailio-stdout || (echo "ERROR: kamailio cannot be run"; exit 1)
grep -q "version: kamcmd" $out/kamcmd-stdout || (echo "ERROR: kamcmd cannot be run"; exit 1)
grep -q "add a new subscriber" $out/kamctl-stdout || (echo "ERROR: kamctl cannot be run"; exit 1)
'';
}