Goal
The goal of today is to change the acceptance test suite to run the Obnam server as a daemon so that HTTP requests can be made to it.
Plan
- Prototype a Subplot library to manage a daemon: start on request, terminate when scenario ends. Implement this in Python.
Notes
- The
daemonizeprogram for various Unix-like operating systems is helpful for this. A more thorough approach would be to use something like systemd user services, but I don't want to tie the test suite to systemd. - I'm OK with just killing the server process when it's time to terminate it. I don't want to implement a tidy shutdown procedure, at least for now. Implementing that will bring its own set of requirements that need to be verified. In any case, that'll be outside the daemon library for Subplot. The library can just kill.
- At its simplest, there'll be a step
when I start {program} as a daemonto start the daemon, with a cleanup function to kill the process. - To run a program as a damon:
daemonize -v -p pid -c . /path/to/esecutable arg... - The
-c .is important so that the filepidis written to the current working directory. daemonizeinsists the path to the exeutable is absolute.- That turned out to be easy, but I changed the stop to
When I run, as a daemon...to be consistend with other things in Subplot. - Used the new daemon step to finish the scenario for the
/validateAPI call. - I could, and possibly should, continue and implement the
PUT /chunkandGET /chunk/<id>API end points, but I'm much too tired for that now.
Summary
Implement a way to run the Obnam server as a daemon, for the test suite.
Comments?
If you have feedback on this, please use the following fediverse thread: https://toot.liw.fi/@liw/116153777058988831.