This was all done on a Debian Linux server.
Install speedtest-cli by:
sudo easy_install speedtest-cli
That gives you a one-line command to run up/down tests via speedtest.net. To hit a specific server, check the main list at https://www.speedtest.net/speedtest-servers.php and provide the ID to test against: