在 El Capitan 的自动测试中限制连接速度?

Throttling connection speed in Automated test in El Capitan?

所以我计划使用 python-selenium(真正的 webdriver)编写一个自动化测试,它使用 subprocess to throttle the connection speed before a suite of tests. I found this great script for ipfw, only to find out that OS X El Capitan switched to PF(Packet Filter) at Yosemite

我保留 运行 的所有内容都已过时。那么通过 shell 或 El Capitan 上的 cli 限制互联网的最佳方式是什么?有没有人有可以分享的脚本?网络 Link Conditioner 非常适合测试,但如果我可以开始使用自动化捕获低速发生的错误,那就太好了。

我能够使用网络 link 调节器来限制网络。要安装网络 link 调节器,您需要获取硬件 IO 工具。 Installing Apple's Network Link Conditioner Tool

中提供了更多详细信息

要在网络 link 调节器中自动设置带宽配置文件,您可以参考我在 中的回答