Joachim Nilsson
61fb7aeca2
New unit test framework, first test pidfile funcs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 12:30:35 +02:00
Joachim Nilsson
7f89000c6c
pidfilefn.c: Update unittests, add mtime test and prettyfy output
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-03-20 02:15:35 +01:00
Joachim Nilsson
5d07594709
Update pidfile() documentation and add unit test for __pidfile_name
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-01-21 23:30:08 +01:00
Joachim Nilsson
975df87d6b
Update unit test for pidfile()
...
Add ocular verification step for mtime update when pidfile() is
called more than once.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-12-17 00:15:18 +01:00
Joachim Nilsson
44e787c966
Add generic support for running tests as root.
...
By setting `ASROOT=1` in a unit test makefile a test will now run as
root, using `sudo -n`.
This patch allows us to simplify the pidfilefn() test.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-08-23 01:30:29 +02:00
Joachim Nilsson
ab2b0f00fa
Add autotest for pidfilefn et al.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-08-22 22:41:34 +02:00
Joachim Nilsson
8db314623a
Followup to pidfilefn.c, add system include file for usleep()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-07-09 03:22:53 +02:00
Joachim Nilsson
e731d83881
Add pidfile_poll() from Finit, waits max 5 sec for pidfile.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-07-09 03:19:56 +02:00
Joachim Nilsson
c2d0ed0d12
Fix minor issues in pidfile_read() and pidfile_signal(), caught by Coverity
...
- Simplify pidfile_read(), no need to call access() when fopen() is more
than capable of failing on its own if we do not have READ access.
- The remove() syscall requires that you check the return value, but we
don't care about that when having signalled a TERM signal to a process.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-07-09 01:59:10 +02:00
Joachim Nilsson
5a50a6add1
Add client side pidfile functions: pidfile_read(), pidfile_signal().
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2015-07-09 01:36:58 +02:00