How can you port code you can't see (i.e. isn't open source)?
Did you contact Ookla regarding their source code???
Are you aware there are threads about people hainvg issue running speed test from most consumer-grade devices?
You may have missed this part:
From the software:
You may only use this Speedtest software and information generated from it for personal, non-commercial use,
through a command line interface on a personal computer. Your use of this software is subject to the End User
Restrictions On Use. You shall not: (a) copy the Software, except as expressly permitted herein; (b) modify, translate, adapt, or otherwise create derivative works or improvements, whether or not patentable, of the Software; (c) reverse engineer, disassemble, decompile, decode, or otherwise indirectly or directly attempt to derive or gain access to the source code of the Software or any part thereof; (d) remove, delete, alter, or obscure any trademarks or any copyright, trademark, patent, or other intellectual property or proprietary rights notices from the Software, including any copy thereof; (e) rent, lease, lend, sell, sublicense, assign, distribute, publish, transfer, or otherwise make available the Software, or any features or functionality of the Software, to any third party for any reason, including by making the Software available on a network where it is capable of being accessed by more than one device at any time; or (f) install or use the Software on any router, modem, or other non-personal computer device.
to be clear, that is a violation of their End User License Agreement
The NIC.BR, the Brazilian Network Information Center is the responsible entity for DOT-BR domains and had developed a system named SIMET, a shortening in Portuguese for "Internal Traffic Measurement System". It has version for IOS, Android, Windows and a version named SIMET-BOX that was developed based on OpenWRT and is open source. You can find the project on https://github.com/simetnicbr/simetbox-openwrt-feed. They only made available compilations for half a dozen router models that are easier to be found in Brazil.
The site is https://simet.nic.br/simetbox.html, and contact e-mail is medicoes AT @simet.nic.br.
Well, strictly speaking I installed it in an personal access point, not a router (it is running a custom build of OpenWrt without dnsmasq/dhcp/firewall). So at least in my case I am compliant with EULA: it is not a router, it is a personal device and I am using it in a non-commercial application.
BTW, on a theoretical question: is a Raspberry Pi running Ubuntu a personal computing device? I think yes. And if I configure this Ubuntu to start routing packets for my home network, is it still a personal computing device or is it now a router? My point: this EULA really needs some rewording. It is clear to me that they want to prevent it to be used on routers used by ISPs or deployed to some commercial infrastructure (but it should be OK to be used on a home personal device). Just my 2 cents.
Which brings in the question whether that condition is actually legally enforceable, EULAs and friends contain a lot of legally dubious content (always biased heavily towards the issuer of the EULA) mainly intended to sow fear uncertainty and doubt. Not saying that is the case here, but just because an EULA has a specific stipulation does not necessarily mean said stipulation is valid/binding. However one should consult a lawyer not the internet and lacking specific legal advice assuming "validity" is clearly the safer approach.
Now, it appears that Ookla really only wants to avoid in eating into their own "enterprise network products portfolio", so it seems unlikely that small end-users appear on their monitor at all... especially because they will not be in a position to meaningfully differentiate repeated scheduled tests from a home router from repeated scheduled tests from a Linux device behind that same home router.