diff --git a/benchmarks/librespeed-cli/Makefile b/benchmarks/librespeed-cli/Makefile new file mode 100644 index 00000000000..f8eb4547d55 --- /dev/null +++ b/benchmarks/librespeed-cli/Makefile @@ -0,0 +1,35 @@ +ONLY_FOR_ARCHS = ${GO_ARCHS} + +COMMENT = command line client for LibreSpeed + +MODGO_MODNAME = github.com/librespeed/speedtest-cli +MODGO_VERSION = v1.0.13 + +DISTNAME = librespeed-cli-${MODGO_VERSION} + +CATEGORIES = benchmarks + +HOMEPAGE = https://librespeed.org + +MAINTAINER = Christoh Liebender + +# LGPL-3.0 +PERMIT_PACKAGE = Yes + +# uses pledge() and unveil() +WANTLIB += c pthread + +MODULES = lang/go + +SEPARATE_BUILD = Yes + +# patches +WRKDIST = ${WRKSRC} + +do-install: + ${INSTALL_PROGRAM} ${MODGO_WORKSPACE}/bin/speedtest-cli \ + ${PREFIX}/bin/librespeed-cli + +.include "modules.inc" + +.include diff --git a/benchmarks/librespeed-cli/distinfo b/benchmarks/librespeed-cli/distinfo new file mode 100644 index 00000000000..112f54e7562 --- /dev/null +++ b/benchmarks/librespeed-cli/distinfo @@ -0,0 +1,96 @@ +SHA256 (go_modules/github.com/!burnt!sushi/toml/@v/v1.3.2.mod) = JnfIL+dPIDdyiJpagBr7Mp2VF1UId92ssXIZFpurPt0= +SHA256 (go_modules/github.com/!burnt!sushi/toml/@v/v1.3.2.zip) = XeJGoMtMJW8/1dDbigihFPWK8MLhk7vwrZASEErbtrI= +SHA256 (go_modules/github.com/briandowns/spinner/@v/v1.23.1.mod) = 5kl+NIWPfHiQPOJBFVzd2gDGgl25k07QM5nDMxPiDZk= +SHA256 (go_modules/github.com/briandowns/spinner/@v/v1.23.1.zip) = fz/VaPuSJcsvnt1L7v2duTP08XO5utCYMBx//gOEvfs= +SHA256 (go_modules/github.com/cpuguy83/go-md2man/v2/@v/v2.0.4.mod) = FMOvou9iNVXBtINNH4ixTfd1Sa/uheV1DBkQJGW3iro= +SHA256 (go_modules/github.com/cpuguy83/go-md2man/v2/@v/v2.0.4.zip) = mtuqF/F9vjauRk2AYqy7+5z4U7/r7UJENag0orC+2RA= +SHA256 (go_modules/github.com/fatih/color/@v/v1.17.0.mod) = EVCWwLAxTBSaQR67bfCX187wr8cx2gHTTexr2pLfgQ4= +SHA256 (go_modules/github.com/fatih/color/@v/v1.17.0.zip) = iltulKtJ3m+GnT79TgQv/UbCoSfyUTn267YUbkyescQ= +SHA256 (go_modules/github.com/fatih/color/@v/v1.7.0.mod) = TDlJ5lwSok4Luy1SEYvASOaYDCm8SUAsWWWK3gNRmKM= +SHA256 (go_modules/github.com/gocarina/gocsv/@v/v0.0.0-20240520201108-78e41c74b4b1.mod) = pjO1Uy/bZ+3U86N39q/y4UHYxma8imRoOPqQrvnX1TU= +SHA256 (go_modules/github.com/gocarina/gocsv/@v/v0.0.0-20240520201108-78e41c74b4b1.zip) = mOoXDMFBrDF21jKdHFqlnGKsClIp5h+WDerTAcgqYJo= +SHA256 (go_modules/github.com/google/uuid/@v/v1.6.0.mod) = c9pHtjOLAKCC/UUao1oyc9OtwJuOm7qY2rAQkeQCr24= +SHA256 (go_modules/github.com/google/uuid/@v/v1.6.0.zip) = 0PAvN3IX9CcC4lloTgZEHtv1FA3dzDS6m+pWA4s4pu0= +SHA256 (go_modules/github.com/mattn/go-colorable/@v/v0.1.13.mod) = 1nQ64urmVxYSLxK0LJ8/g6gFwK4yvTxVPUpvG8uSQ6U= +SHA256 (go_modules/github.com/mattn/go-colorable/@v/v0.1.13.zip) = CL4yLcxYSp/P3lyvDPh4tOEc2Y8lLjK8cE6SxaS6nRU= +SHA256 (go_modules/github.com/mattn/go-colorable/@v/v0.1.2.mod) = oRYeaUrDvf6/hVCzTYJz+v3b52/aDGLoVED3F5nla50= +SHA256 (go_modules/github.com/mattn/go-isatty/@v/v0.0.16.mod) = cUdm7ILWfbiVreiva4BUrUMMPOpeFbOoiPI+0vPhuGM= +SHA256 (go_modules/github.com/mattn/go-isatty/@v/v0.0.20.mod) = Huq+8bTZjbc8bCBzKJFjZJvJoERVKsqGudWS/oTqocg= +SHA256 (go_modules/github.com/mattn/go-isatty/@v/v0.0.20.zip) = 8tX4nKRRV34XRkubtZbcDQ7OzsteqmNiLEG1fNC3uMw= +SHA256 (go_modules/github.com/mattn/go-isatty/@v/v0.0.8.mod) = T3daib6agBiagm7yLcMD44lVfFWPFL/UC3W17yhF5W8= +SHA256 (go_modules/github.com/prometheus-community/pro-bing/@v/v0.8.0.mod) = fzgJNOxmJ8jW2ya1wm0v7mdhLSlbYm2UBMfJ5qCPmFA= +SHA256 (go_modules/github.com/prometheus-community/pro-bing/@v/v0.8.0.zip) = ej6K+NZQMAq/tN+e7sQ11uXuJsxn6Hg9wk6Hw/gV9gI= +SHA256 (go_modules/github.com/russross/blackfriday/v2/@v/v2.1.0.mod) = w5VHzOboZujPo5XSk3vOMIAc0H8LkBwhMySPH7oS9Y0= +SHA256 (go_modules/github.com/russross/blackfriday/v2/@v/v2.1.0.zip) = eFJ1DVigU844sB8sIDIIgXVk9VLr83GytjAIHXAExq4= +SHA256 (go_modules/github.com/urfave/cli/v2/@v/v2.27.4.mod) = UmfHv9x/17zhZR7Sd9Vy1xcB3nmjKE1SPU9wztX+TeI= +SHA256 (go_modules/github.com/urfave/cli/v2/@v/v2.27.4.zip) = HPSpifOKjsKcOZQAxAxY6NWeoa+cZpIcALK1HLacBTU= +SHA256 (go_modules/github.com/xrash/smetrics/@v/v0.0.0-20240521201337-686a1a2994c1.mod) = 20TcnREk0ciM/YvNMyL5h+eslNKTQE/SouqOivhFOKo= +SHA256 (go_modules/github.com/xrash/smetrics/@v/v0.0.0-20240521201337-686a1a2994c1.zip) = YGHZph6GPJuKTtPjSwDWeE2uTKfsZKDm8OXEu4V0Mo0= +SHA256 (go_modules/golang.org/x/crypto/@v/v0.47.0.mod) = /7gT2Z5zjMawzCnpCjxY7w3P5kkNNsIVO5c9QcX7fZk= +SHA256 (go_modules/golang.org/x/crypto/@v/v0.47.0.zip) = h0V0aoDB6/+R4ddztsKMSqTwdNaqk4t6UTMNUu0ioMA= +SHA256 (go_modules/golang.org/x/net/@v/v0.49.0.mod) = 9juXIMbYfvBWYtRkHnhTGvmOahO+CGEb+6cSjpst6XA= +SHA256 (go_modules/golang.org/x/net/@v/v0.49.0.zip) = wHpNVsPbUtwrKcZbE0+WwssHHopQ5PSIrH+stGAFzIU= +SHA256 (go_modules/golang.org/x/sync/@v/v0.19.0.mod) = 0zPFS3SviguOx0jTfFly0nudCIueRci/XDq1INIRMJA= +SHA256 (go_modules/golang.org/x/sync/@v/v0.19.0.zip) = JSEf4s/9gCC7QFua23qQ9eBnYPKBi4+y50qqohpm7Z4= +SHA256 (go_modules/golang.org/x/sys/@v/v0.0.0-20220412211240-33da011f77ad.mod) = 8DMzMJb+GY8xUd7tk/LeunTlC7/nc5E0BFvDt85KUCQ= +SHA256 (go_modules/golang.org/x/sys/@v/v0.0.0-20220811171246-fbc7d0a398ab.mod) = 8DMzMJb+GY8xUd7tk/LeunTlC7/nc5E0BFvDt85KUCQ= +SHA256 (go_modules/golang.org/x/sys/@v/v0.18.0.mod) = 0iezJfYh9OvijTm6dz6pm4cPOTt8CcNFksNlsW3VYN4= +SHA256 (go_modules/golang.org/x/sys/@v/v0.40.0.mod) = 9BGBTYOpboZ4Gx3uQcEluVBNpUItujfMHWOwFq45z+I= +SHA256 (go_modules/golang.org/x/sys/@v/v0.40.0.zip) = 1/n+RDAPyNR7MNBs0AHZxixUxhGYGKGaLjOpNTiXFmk= +SHA256 (go_modules/golang.org/x/sys/@v/v0.6.0.mod) = 8DMzMJb+GY8xUd7tk/LeunTlC7/nc5E0BFvDt85KUCQ= +SHA256 (go_modules/golang.org/x/term/@v/v0.1.0.mod) = dAeU4pFPXMh+JWVsWEMiKyxlZlghIF9FYyoEd8jT95s= +SHA256 (go_modules/golang.org/x/term/@v/v0.39.0.mod) = wDklZj+X1JDHRXWE2tqVS2z748R2K6AufPbw6694oss= +SHA256 (go_modules/golang.org/x/term/@v/v0.39.0.zip) = RDux+HrRGn0tqP6k5YJy6G89cIlfOOE6mSU23EMfxS0= +SHA256 (go_modules/golang.org/x/text/@v/v0.33.0.mod) = Ef7SIeJ/A1RzGaflrnBC6CNKhaPk5ZzFGx984iLJnkA= +SHA256 (go_modules/golang.org/x/text/@v/v0.33.0.zip) = 8Bzfhfall6pFJtaLXC5aNHCm8WK5a7mGevN/BZuW21o= +SHA256 (go_modules/gopkg.in/yaml.v3/@v/v3.0.1.mod) = IVeYYKIDBvz0OxvSNNH7oxlJnHdhG3HAX5vzupDauTk= +SHA256 (go_modules/gopkg.in/yaml.v3/@v/v3.0.1.zip) = qrj7xOYwDqCOav4crqGKIckMefSJ9SxT4vIEMfGpoBU= +SHA256 (librespeed-cli-v1.0.13.zip) = 48jTiQdHZQgbWsxbqC0+OE/ONU/qk60t0RryCCbjfDs= +SIZE (go_modules/github.com/!burnt!sushi/toml/@v/v1.3.2.mod) = 43 +SIZE (go_modules/github.com/!burnt!sushi/toml/@v/v1.3.2.zip) = 303020 +SIZE (go_modules/github.com/briandowns/spinner/@v/v1.23.1.mod) = 291 +SIZE (go_modules/github.com/briandowns/spinner/@v/v1.23.1.zip) = 226880 +SIZE (go_modules/github.com/cpuguy83/go-md2man/v2/@v/v2.0.4.mod) = 100 +SIZE (go_modules/github.com/cpuguy83/go-md2man/v2/@v/v2.0.4.zip) = 13136 +SIZE (go_modules/github.com/fatih/color/@v/v1.17.0.mod) = 161 +SIZE (go_modules/github.com/fatih/color/@v/v1.17.0.zip) = 14693 +SIZE (go_modules/github.com/fatih/color/@v/v1.7.0.mod) = 30 +SIZE (go_modules/github.com/gocarina/gocsv/@v/v0.0.0-20240520201108-78e41c74b4b1.mod) = 42 +SIZE (go_modules/github.com/gocarina/gocsv/@v/v0.0.0-20240520201108-78e41c74b4b1.zip) = 38688 +SIZE (go_modules/github.com/google/uuid/@v/v1.6.0.mod) = 30 +SIZE (go_modules/github.com/google/uuid/@v/v1.6.0.zip) = 31981 +SIZE (go_modules/github.com/mattn/go-colorable/@v/v0.1.13.mod) = 90 +SIZE (go_modules/github.com/mattn/go-colorable/@v/v0.1.13.zip) = 13909 +SIZE (go_modules/github.com/mattn/go-colorable/@v/v0.1.2.mod) = 80 +SIZE (go_modules/github.com/mattn/go-isatty/@v/v0.0.16.mod) = 104 +SIZE (go_modules/github.com/mattn/go-isatty/@v/v0.0.20.mod) = 76 +SIZE (go_modules/github.com/mattn/go-isatty/@v/v0.0.20.zip) = 8936 +SIZE (go_modules/github.com/mattn/go-isatty/@v/v0.0.8.mod) = 95 +SIZE (go_modules/github.com/prometheus-community/pro-bing/@v/v0.8.0.mod) = 202 +SIZE (go_modules/github.com/prometheus-community/pro-bing/@v/v0.8.0.zip) = 36233 +SIZE (go_modules/github.com/russross/blackfriday/v2/@v/v2.1.0.mod) = 42 +SIZE (go_modules/github.com/russross/blackfriday/v2/@v/v2.1.0.zip) = 122358 +SIZE (go_modules/github.com/urfave/cli/v2/@v/v2.27.4.mod) = 280 +SIZE (go_modules/github.com/urfave/cli/v2/@v/v2.27.4.zip) = 3552751 +SIZE (go_modules/github.com/xrash/smetrics/@v/v0.0.0-20240521201337-686a1a2994c1.mod) = 42 +SIZE (go_modules/github.com/xrash/smetrics/@v/v0.0.0-20240521201337-686a1a2994c1.zip) = 1826468 +SIZE (go_modules/golang.org/x/crypto/@v/v0.47.0.mod) = 192 +SIZE (go_modules/golang.org/x/crypto/@v/v0.47.0.zip) = 2224706 +SIZE (go_modules/golang.org/x/net/@v/v0.49.0.mod) = 157 +SIZE (go_modules/golang.org/x/net/@v/v0.49.0.zip) = 1934922 +SIZE (go_modules/golang.org/x/sync/@v/v0.19.0.mod) = 36 +SIZE (go_modules/golang.org/x/sync/@v/v0.19.0.zip) = 25714 +SIZE (go_modules/golang.org/x/sys/@v/v0.0.0-20220412211240-33da011f77ad.mod) = 33 +SIZE (go_modules/golang.org/x/sys/@v/v0.0.0-20220811171246-fbc7d0a398ab.mod) = 33 +SIZE (go_modules/golang.org/x/sys/@v/v0.18.0.mod) = 33 +SIZE (go_modules/golang.org/x/sys/@v/v0.40.0.mod) = 35 +SIZE (go_modules/golang.org/x/sys/@v/v0.40.0.zip) = 2003724 +SIZE (go_modules/golang.org/x/sys/@v/v0.6.0.mod) = 33 +SIZE (go_modules/golang.org/x/term/@v/v0.1.0.mod) = 95 +SIZE (go_modules/golang.org/x/term/@v/v0.39.0.mod) = 70 +SIZE (go_modules/golang.org/x/term/@v/v0.39.0.zip) = 21694 +SIZE (go_modules/golang.org/x/text/@v/v0.33.0.mod) = 190 +SIZE (go_modules/golang.org/x/text/@v/v0.33.0.zip) = 9236387 +SIZE (go_modules/gopkg.in/yaml.v3/@v/v3.0.1.mod) = 95 +SIZE (go_modules/gopkg.in/yaml.v3/@v/v3.0.1.zip) = 104623 +SIZE (librespeed-cli-v1.0.13.zip) = 34032 diff --git a/benchmarks/librespeed-cli/modules.inc b/benchmarks/librespeed-cli/modules.inc new file mode 100644 index 00000000000..fded9be8820 --- /dev/null +++ b/benchmarks/librespeed-cli/modules.inc @@ -0,0 +1,32 @@ +MODGO_MODULES = \ + github.com/!burnt!sushi/toml v1.3.2 \ + github.com/briandowns/spinner v1.23.1 \ + github.com/cpuguy83/go-md2man/v2 v2.0.4 \ + github.com/fatih/color v1.17.0 \ + github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 \ + github.com/google/uuid v1.6.0 \ + github.com/mattn/go-colorable v0.1.13 \ + github.com/mattn/go-isatty v0.0.20 \ + github.com/prometheus-community/pro-bing v0.8.0 \ + github.com/russross/blackfriday/v2 v2.1.0 \ + github.com/urfave/cli/v2 v2.27.4 \ + github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 \ + golang.org/x/crypto v0.47.0 \ + golang.org/x/net v0.49.0 \ + golang.org/x/sync v0.19.0 \ + golang.org/x/sys v0.40.0 \ + golang.org/x/term v0.39.0 \ + golang.org/x/text v0.33.0 \ + gopkg.in/yaml.v3 v3.0.1 + +MODGO_MODFILES = \ + github.com/fatih/color v1.7.0 \ + github.com/mattn/go-colorable v0.1.2 \ + github.com/mattn/go-isatty v0.0.16 \ + github.com/mattn/go-isatty v0.0.8 \ + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad \ + golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab \ + golang.org/x/sys v0.18.0 \ + golang.org/x/sys v0.6.0 \ + golang.org/x/term v0.1.0 + diff --git a/benchmarks/librespeed-cli/patches/patch-main_go b/benchmarks/librespeed-cli/patches/patch-main_go new file mode 100644 index 00000000000..ff57fee0733 --- /dev/null +++ b/benchmarks/librespeed-cli/patches/patch-main_go @@ -0,0 +1,16 @@ +binding to specific interface is non-functional + +Index: main.go +--- main.go.orig ++++ main.go +@@ -124,10 +124,6 @@ func main() { + Name: defs.OptionSource, + Usage: "`SOURCE` IP address to bind to", + }, +- &cli.StringFlag{ +- Name: defs.OptionInterface, +- Usage: "network INTERFACE to bind to", +- }, + &cli.IntFlag{ + Name: defs.OptionTimeout, + Usage: "HTTP `TIMEOUT` in seconds.", diff --git a/benchmarks/librespeed-cli/patches/patch-speedtest_speedtest_go b/benchmarks/librespeed-cli/patches/patch-speedtest_speedtest_go new file mode 100644 index 00000000000..2d2972e26ae --- /dev/null +++ b/benchmarks/librespeed-cli/patches/patch-speedtest_speedtest_go @@ -0,0 +1,49 @@ +Index: speedtest/speedtest.go +--- speedtest/speedtest.go.orig ++++ speedtest/speedtest.go +@@ -15,6 +15,8 @@ import ( + "sync" + "time" + ++ "golang.org/x/sys/unix" ++ + "github.com/gocarina/gocsv" + "github.com/urfave/cli/v2" + +@@ -33,8 +35,8 @@ const ( + defaultTelemetryShare = "/results/" + + forceNothing = 0 +- forceHttps = 1 +- forceHttp = 2 ++ forceHttps = 1 ++ forceHttp = 2 + ) + + type PingJob struct { +@@ -169,7 +171,24 @@ func SpeedTest(c *cli.Context) error { + transport.MaxIdleConnsPerHost = concurrent + 2 + transport.MaxConnsPerHost = concurrent + 2 + +- if caCertFileName := c.String(defs.OptionCACert); caCertFileName != "" { ++ caCertFileName := c.String(defs.OptionCACert) ++ ++ for _, rpath := range []string{ ++ "/dev/urandom", "/etc/hosts", "/etc/localtime", "/etc/resolv.conf", ++ "/etc/ssl/cert.pem", caCertFileName, ++ } { ++ if rpath != "" { ++ if err := unix.Unveil(rpath, "r"); err != nil { ++ return fmt.Errorf("unveil %s: %s", rpath, err) ++ } ++ } ++ } ++ ++ if err := unix.PledgePromises("stdio tty inet dns rpath"); err != nil { ++ return fmt.Errorf("pledge: %s", err) ++ } ++ ++ if caCertFileName != "" { + caCert, err := os.ReadFile(caCertFileName) + if err != nil { + output.Fatal(err) diff --git a/benchmarks/librespeed-cli/pkg/DESCR b/benchmarks/librespeed-cli/pkg/DESCR new file mode 100644 index 00000000000..3081de4dabb --- /dev/null +++ b/benchmarks/librespeed-cli/pkg/DESCR @@ -0,0 +1,10 @@ +Don't have a GUI but want to use LibreSpeed servers to test your Internet +speed? librespeed-cli is a command line interface for LibreSpeed speed test +backends, written in Go. + +Features: +- Ping, Jitter, Download, Upload +- IP address & ISP Information +- Result sharing (telemetry) [optional] +- Test with mutliple servers in a single run +- Use your own server list or telemetry endpoints diff --git a/benchmarks/librespeed-cli/pkg/PLIST b/benchmarks/librespeed-cli/pkg/PLIST new file mode 100644 index 00000000000..fc97844ced8 --- /dev/null +++ b/benchmarks/librespeed-cli/pkg/PLIST @@ -0,0 +1 @@ +@bin bin/librespeed-cli