问题描述
如何为400个用户生成用户帐户以进行负载测试?
How do you generate user accounts for 400 users to do a load testing?
Htdigest会强制您每次输入密码,我尝试过类似dos管道
Htdigest forces you to type in a password each time, I have tried dos pipes like
echo password > htdigest -c realm username%1
htdigest -c realm username%1 < password.txt
但是它不起作用...
but it is not working...
推荐答案
您还可以查看trac在其网站上分发的python脚本中的htdigest密码,然后可以对其进行自动化:
You can also check out the python script that trac distributes on their website for htdigest passwords, you can then automate it:
他们还建议遵循以下原则进行工作:
They also suggest something along these lines will work:
$ printf "${user}:trac:${password}" | md5sum - >>user.htdigest
我已经在FreeBSD上进行了测试,不确定它是否可以在Linux或Windows上运行,因此您可能需要对其进行一些修改:
I have tested this on FreeBSD, not sure if this will work on Linux or Windows, so you may need to modify it a little:
(echo -n "user:realm:" && echo -n "user:realm:testing" | md5) > outfile
输出文件包含:
user:realm:84af20dd88a2456d3bf6431fe8a59d16
与htdigest相同:
Same thing with htdigest:
htdigest -c outfile2 realm user
outfile2中的输出
output in outfile2
user:realm:84af20dd88a2456d3bf6431fe8a59d16
它们都是相同的,从而证明了命令行实现的正确性!
They are both the same, thereby proving correctness of the command line implementation!
这篇关于您如何htdigest 400个用户帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!