AB-test-http, test http requests between two systems.
- put urls into a file, like
url.txt
.
$ tail -n 2 url.txt
http://openresty.org/
https://openresty.org/cn/
- specify the two IPs that we want to compare between them, run test like this:
TEST_OLD_IP=$OLD_IP TEST_NEW_IP=$NEW_IP perl test-http.pl url.txt
- it will compare the response status, the
Content-Type
response header and theLocation
response header, we can get the the output like this:
ok 1 - GET http://openresty.org/ status matched
ok 2 - GET http://openresty.org/ content-type matched
ok 3 - GET http://openresty.org/ location matched
ok 4 - GET https://openresty.org/cn/ status matched
ok 5 - GET https://openresty.org/cn/ content-type matched
1..5
# use perl5
cpan Test::More