Ask Your Question

Revision history [back]

testing horizon with curl

Is there any way to test horizon using curl?

The tests from horizon use selenium, but I would need a minimal command with minimal dependencies, just to check the login.

I have tried with curl by using this script:

curl -L -v -c cookies.txt -b cookies.txt -o output.1.html http://10.0.0.11/horizon/

CRS_TOKEN=$(grep csrftoken cookies.txt | awk '{print $NF}')

curl -L -v -c cookies.txt -b cookies.txt \
-d "csrfmiddlewaretoken=$CRS_TOKEN&\
fake_email=admin&\
fake_password=$PASSWORD&\
region=http%3A%2F%2Fcontroller%3A5000%2Fv3&\
domain=default&\
username=$USERNAME&\
password=$PASSWORD" \
-o output.2.html \
http://10.0.0.11/horizon/

The output.2.html just shows the login screen again.