Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I pass a complex cookie to ab for testing?

Tags:

apachebench

I'm using ab to test my app, and I'm having trouble passing the correct cookie. My cookie data looks like this:

messages=95925d68c34fcc68b3fcc2e5061a45278c35af41$[[\\\\"__json_message\\\\"\\\\05420\\\\054\\\\"Data\\\\"]]

I can't figure out how to get the second part of the string to ab to send to my server. I'm doing something like

ab -C messages='95*snip*5af41$[[\\\\"__json_message\\\\"\\\\05420\\\\054\\\\"Data\\\\"]]' http://example.com:80/

Everything up to the [ is sent, but nothing from there on. I'm concerned [ is some kind of control to my shell that is getting escaped, but I'm not quite sure what the deal is. I thought the single quotes should allow me to put anything but another single quote inside of them.

like image 255
Paul McMillan Avatar asked Oct 28 '10 23:10

Paul McMillan


1 Answers

I figured it out. Turns out the correct syntax is:

ab -C 'messages="93bad4084536e6ee5839de07d59c8a42eadf014f$[[\"__json_message\"\05420\054\"Houston3\"]]"' http://localhost:8000/
like image 200
Paul McMillan Avatar answered Oct 20 '22 09:10

Paul McMillan