From 2fa8441274dab6f7a6c5d3e79a54ad62eabc4fd1 Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Wed, 16 Mar 2022 12:18:51 -0300 Subject: [PATCH] gost: enable tests --- pkgs/tools/networking/gost/default.nix | 29 ++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/gost/default.nix b/pkgs/tools/networking/gost/default.nix index 13cac7444617..c8f42b3ad4a7 100644 --- a/pkgs/tools/networking/gost/default.nix +++ b/pkgs/tools/networking/gost/default.nix @@ -13,8 +13,33 @@ buildGoModule rec { vendorSha256 = "1cgb957ipkiix3x0x84c77a1i8l679q3kqykm1lhb4f19x61dqjh"; - # Many tests fail. - doCheck = false; + postPatch = '' + substituteInPlace http2_test.go \ + --replace "TestH2CForwardTunnel" "SkipH2CForwardTunnel" \ + --replace "TestH2ForwardTunnel" "SkipH2ForwardTunnel" + + substituteInPlace resolver_test.go \ + --replace '{NameServer{Addr: "1.1.1.1"}, "github", true},' "" \ + --replace '{NameServer{Addr: "1.1.1.1"}, "github.com", true},' "" \ + --replace '{NameServer{Addr: "1.1.1.1:53"}, "github.com", true},' "" \ + --replace '{NameServer{Addr: "1.1.1.1:53", Protocol: "tcp"}, "github.com", true},' "" \ + --replace '{NameServer{Addr: "1.1.1.1:853", Protocol: "tls"}, "github.com", true},' "" \ + --replace '{NameServer{Addr: "1.1.1.1:853", Protocol: "tls", Hostname: "cloudflare-dns.com"}, "github.com", true},' "" \ + --replace '{NameServer{Addr: "https://cloudflare-dns.com/dns-query", Protocol: "https"}, "github.com", true},' "" \ + --replace '{NameServer{Addr: "https://1.0.0.1/dns-query", Protocol: "https"}, "github.com", true},' "" + + # Skip TestShadowTCP, TestShadowUDP: #70 #71 #72 #78 #83 #85 #86 #87 #93 + substituteInPlace ss_test.go \ + --replace '{url.User("xchacha20"), url.UserPassword("xchacha20", "123456"), false},' "" \ + --replace '{url.UserPassword("xchacha20", "123456"), url.User("xchacha20"), false},' "" \ + --replace '{url.UserPassword("xchacha20", "123456"), url.UserPassword("xchacha20", "abc"), false},' "" \ + --replace '{url.UserPassword("CHACHA20-IETF-POLY1305", "123456"), url.UserPassword("CHACHA20-IETF-POLY1305", "123456"), true},' "" \ + --replace '{url.UserPassword("AES-128-GCM", "123456"), url.UserPassword("AES-128-GCM", "123456"), true},' "" \ + --replace '{url.User("AES-192-GCM"), url.UserPassword("AES-192-GCM", "123456"), false},' "" \ + --replace '{url.UserPassword("AES-192-GCM", "123456"), url.User("AES-192-GCM"), false},' "" \ + --replace '{url.UserPassword("AES-192-GCM", "123456"), url.UserPassword("AES-192-GCM", "abc"), false},' "" \ + --replace '{url.UserPassword("AES-256-GCM", "123456"), url.UserPassword("AES-256-GCM", "123456"), true},' "" + ''; meta = with lib; { description = "A simple tunnel written in golang";