summaryrefslogtreecommitdiff
path: root/tests/lockfile.at
Commit message (Collapse)AuthorAgeFilesLines
* lockfile: Modify tests for Windows.Gurucharan Shetty2014-06-241-5/+8
| | | | | | | | | | | | | | | | | As of now, when a process tries to reacquire a lockfile, we return EEXIST on Windows and print a different error message. This means that the unit tests need to look for different error messages too. Linux uses EDEADLK for the same. EDEADLK feels like a good error description for Windows too and this also lets us not change the tests too much. So use it. Some of the tests in test-lockfile.c uses fork to test a child's ability to acquire lock. We do not fork in Windows. We also do not support symlinks on Windows. So, comment out those tests. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lockfile: Improve log message when a process tries to relock a file.Ben Pfaff2014-04-071-10/+10
| | | | | | | "Resource deadlock avoided" is a pretty obscure message. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
* unit-test: Link 29 test programs into ovstestAndy Zhou2014-04-031-1/+1
| | | | | | | | | | | | | | Improve link speed by linking 29 test programs into ovstest. On my machine, running the following command against a fully built tree: $ touch lib/random.c; time make Improve the overall build time from 7 seconds to 3.5 seconds. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lockfile: Log more helpful message when locking fails due to a conflict.Ben Pfaff2012-08-311-3/+4
| | | | | | Reported-by: rahim entezari <rahim.entezari@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* lockfile: In tests, also verify log messages.Ben Pfaff2012-08-311-8/+38
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* lockfile: Remove lockfile_lock timeout argumentLeo Alterman2012-08-091-2/+0
| | | | | | | | | lockfile_lock() accepts a timeout argument but, aside from unit tests pertaining to timeout, its value is always 0. Since this feature relies on a periodic SIGALRM signal, which is not a given if we're not caching time, the cleanest solution is just to remove it. Signed-off-by: Leo Alterman <lalterman@nicira.com>
* lockfile: Be more forgiving about lockfiles for symlinks.Ben Pfaff2012-08-011-0/+1
| | | | | | | | | | As the database is being transitioned from /etc to /var, there is a symlink from the old to the new location for the database and a symlink for its lockfile. This works OK, but it would be more user-friendly to still work correctly in case the symlink for the lockfile isn't there (since its existence is non-obvious), so this commit implements that behavior. Signed-off-by: Ben Pfaff <blp@nicira.com>
* lockfile: Fix hang locking through a dangling symlink.Ben Pfaff2012-08-011-0/+1
| | | | | | | | | | | | | | | | | open() with O_CREAT|O_EXCL yields EEXIST if the file being opened is a symlink. lockfile_try_lock() interpreted that error code to mean that some other process had created the lock file in the meantime, so it went around its loop again, which found out the same thing, which led to a hang. This commit fixes the problem by dropping O_EXCL. I don't see any reason that it's actually necessary. That means that the loop itself is unnecessary, so this commit drops that too. Debian bug #681880. CC: 681880@bugs.debian.org Reported-by: Bastian Blank <waldi@debian.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Reviewed-by: Simon Horman <horms@verge.net.au>
* Rework and simplify the "lcov" support for the testsuite.Ben Pfaff2010-02-021-1/+1
|
* Implement library for lockfiles and use it in cfg code.Ben Pfaff2009-10-291-0/+20
This is useful because the upcoming configuration database also needs a lockfile implementation. Also adds tests.