I'm writing a framework to test the behaviour of the CernVM FS. Basically, I have a service that mounts a remote filesystem served over http and does it with automount as soon as the the user attempts to access to the configured mounting point.
One of the tests that I have to write, consists on checking if cvmfs respects the timeout configuration for dns request. So, I have a dns set to wait 180 seconds, but the service has to stop to try to mount the folder after 10 seconds if a proxy is used, after 5 seconds if the connection is direct.
I already have three test defined (one with a good dns, other two with a sleeping dns with and without proxy). All tests are successful (so, actually it fails when dns is sleeping), but I don't know how to check how long Perl opendir command waits before stating that it can't access the folder.
How can I measure this time? I know that it has to fail, but I want to be sure that it fails after 10 or 5 seconds (depending on configuration).
I have to do it in Perl, but any suggestion would be appreciated.