[cse491] automated test issue

C. Titus Brown ctb at msu.edu
Wed Oct 8 07:51:02 PDT 2008


On Tue, Oct 07, 2008 at 09:24:40PM -0400, Alex Nolley wrote:
-> Hey I noticed something kind of odd when running the tests and accessing my
-> server through Firefox.
-> When I didn't set the 'Path' attribute on the cookie my server was sending
-> back to the client, browsing to /auth/print never caused Firefox to send the
-> cookie back to the server, even though I had already logged in. The only way
-> Firefox would send the cookie back was when I was browsing in some path
-> under /auth/login (/auth/login/blah, /auth/login/something, etc...).
-> However, this method passed all the tests, even though /auth/print returned
-> 'no user specified' and /auth/logout did nothing (which they shouldn't
-> have).
-> When I set the 'Path' attribute to '/auth/', then Firefox would return the
-> cookie whenever I was browsing through any path under /auth/. This allowed
-> me to see the correct string, 'you are user alex' when under /auth/print,
-> and would successfully log me out when browsing to /auth/logout. The only
-> problem is, doing it this way makes the test 'test_auth_login_yes' fail
-> since the cookie my server is returning is 'user=test; Path=/auth/' and the
-> header_present function called in 'test_auth_login_yes' is only looking for
-> 'user=test'.
-> Should I just leave the 'Path' attribute out of it for now?

Hi, Alex,

that's odd, it works without "Path" for me on my Mac with both Firefox
and Camino (which is derived from Firefox, too)... how frustrating :).

Well, here's the Python code you would need to set the path, which
should be set to the root of the site:

         C['user']['Path'] = '/'

I've updated the tests to reflect this, too:

	http://class.ged.idyll.org/svn/files/hw-6/webserve-test.py

Thanks for figuring this out!

cheers,
--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2008 mailing list