cloudflared: 2022.8.2 -> 2022.11.1, add tests and additional platforms

+91 -13
+47 -13
pkgs/applications/networking/cloudflared/default.nix
··· 1 - { lib, buildGoModule, fetchFromGitHub, stdenv }: 1 + { lib, buildGoModule, fetchFromGitHub, stdenv, callPackage }: 2 2 3 3 buildGoModule rec { 4 4 pname = "cloudflared"; 5 - version = "2022.8.2"; 5 + version = "2022.11.1"; 6 6 7 7 src = fetchFromGitHub { 8 - owner = "cloudflare"; 9 - repo = "cloudflared"; 10 - rev = version; 11 - hash = "sha256-Kyt5d3KmLefTVVUmUUU23UV0lghzhLFCKLlmwTjN68I="; 8 + owner = "cloudflare"; 9 + repo = "cloudflared"; 10 + rev = version; 11 + hash = "sha256-aG63CEJfEL9r0SviZu9VzArtt3e4VuAbOMaYk9atSGo="; 12 12 }; 13 13 14 14 vendorSha256 = null; ··· 17 17 18 18 preCheck = '' 19 19 # Workaround for: sshgen_test.go:74: mkdir /homeless-shelter/.cloudflared: no such file or directory 20 - export HOME="$(mktemp -d)"; 20 + export HOME="$(mktemp -d)" 21 21 22 22 # Workaround for: protocol_test.go:11: 23 23 # lookup protocol-v2.argotunnel.com on [::1]:53: read udp [::1]:51876->[::1]:53: read: connection refused 24 - 25 24 substituteInPlace "edgediscovery/protocol_test.go" \ 26 25 --replace "TestProtocolPercentage" "SkipProtocolPercentage" 26 + 27 + # Workaround for: origin_icmp_proxy_test.go:46: 28 + # cannot create ICMPv4 proxy: socket: permission denied nor ICMPv6 proxy: socket: permission denied 29 + substituteInPlace "ingress/origin_icmp_proxy_test.go" \ 30 + --replace "TestICMPRouterEcho" "SkipICMPRouterEcho" 31 + 32 + # Workaround for: origin_icmp_proxy_test.go:110: 33 + # cannot create ICMPv4 proxy: socket: permission denied nor ICMPv6 proxy: socket: permission denied 34 + substituteInPlace "ingress/origin_icmp_proxy_test.go" \ 35 + --replace "TestConcurrentRequestsToSameDst" "SkipConcurrentRequestsToSameDst" 36 + 37 + # Workaround for: origin_icmp_proxy_test.go:242: 38 + # cannot create ICMPv4 proxy: socket: permission denied nor ICMPv6 proxy: socket: permission denied 39 + substituteInPlace "ingress/origin_icmp_proxy_test.go" \ 40 + --replace "TestICMPRouterRejectNotEcho" "SkipICMPRouterRejectNotEcho" 41 + 42 + # Workaround for: origin_icmp_proxy_test.go:108: 43 + # Received unexpected error: cannot create ICMPv4 proxy: Group ID 100 is not between ping group 65534 to 65534 nor ICMPv6 proxy: socket: permission denied 44 + substituteInPlace "ingress/origin_icmp_proxy_test.go" \ 45 + --replace "TestTraceICMPRouterEcho" "SkipTraceICMPRouterEcho" 46 + 47 + # Workaround for: icmp_posix_test.go:28: socket: permission denied 48 + substituteInPlace "ingress/icmp_posix_test.go" \ 49 + --replace "TestFunnelIdleTimeout" "SkipFunnelIdleTimeout" 50 + 51 + # Workaround for: icmp_posix_test.go:88: Received unexpected error: Group ID 100 is not between ping group 65534 to 65534 52 + substituteInPlace "ingress/icmp_posix_test.go" \ 53 + --replace "TestReuseFunnel" "SkipReuseFunnel" 54 + 55 + # Workaround for: supervisor_test.go:49: 56 + # Expected nil, but got: Could not lookup srv records on _us-v2-origintunneld._tcp.argotunnel.com: lookup _us-v2-origintunneld._tcp.argotunnel.com on [::1]:53: read udp [::1]:49342->[::1]:53: read: connection refused 57 + substituteInPlace "supervisor/supervisor_test.go" \ 58 + --replace "Test_Initialize_Same_Protocol" "Skip_Initialize_Same_Protocol" 27 59 ''; 28 60 29 61 doCheck = !stdenv.isDarwin; 30 62 63 + passthru.tests.simple = callPackage ./tests.nix { inherit version; }; 64 + 31 65 meta = with lib; { 32 - description = "CloudFlare Tunnel daemon (and DNS-over-HTTPS client)"; 33 - homepage = "https://www.cloudflare.com/products/tunnel"; 34 - license = licenses.asl20; 35 - platforms = platforms.unix; 36 - maintainers = with maintainers; [ bbigras enorris thoughtpolice ]; 66 + description = "Cloudflare Tunnel daemon, Cloudflare Access toolkit, and DNS-over-HTTPS client"; 67 + homepage = "https://www.cloudflare.com/products/tunnel"; 68 + license = licenses.asl20; 69 + platforms = platforms.unix ++ platforms.windows; 70 + maintainers = with maintainers; [ bbigras enorris thoughtpolice piperswe ]; 37 71 }; 38 72 }
+44
pkgs/applications/networking/cloudflared/tests.nix
··· 1 + { version, lib, stdenv, pkgsCross, testers, cloudflared, runCommand, wine, wine64 }: 2 + 3 + let 4 + inherit (stdenv) buildPlatform; 5 + in 6 + { 7 + version = testers.testVersion { 8 + package = cloudflared; 9 + command = "cloudflared help"; 10 + }; 11 + refuses-to-autoupdate = runCommand "cloudflared-${version}-refuses-to-autoupdate" 12 + { 13 + nativeBuildInputs = [ cloudflared ]; 14 + } '' 15 + set -e 16 + cloudflared update 2>&1 | tee output.txt 17 + if ! grep "cloudflared was installed by nixpkgs" output.txt 18 + then 19 + echo "cloudflared's output didn't contain the package manager name" 20 + exit 1 21 + fi 22 + mkdir $out 23 + ''; 24 + } // lib.optionalAttrs (buildPlatform.isLinux && (buildPlatform.isi686 || buildPlatform.isx86_64)) { 25 + runs-through-wine = runCommand "cloudflared-${version}-runs-through-wine" 26 + { 27 + nativeBuildInputs = [ wine ]; 28 + exe = "${pkgsCross.mingw32.cloudflared}/bin/cloudflared.exe"; 29 + } '' 30 + export HOME="$(mktemp -d)" 31 + wine $exe help 32 + mkdir $out 33 + ''; 34 + } // lib.optionalAttrs (buildPlatform.isLinux && buildPlatform.isx86_64) { 35 + runs-through-wine64 = runCommand "cloudflared-${version}-runs-through-wine64" 36 + { 37 + nativeBuildInputs = [ wine64 ]; 38 + exe = "${pkgsCross.mingwW64.cloudflared}/bin/cloudflared.exe"; 39 + } '' 40 + export HOME="$(mktemp -d)" 41 + wine64 $exe help 42 + mkdir $out 43 + ''; 44 + }