opscode-cookbooks/bluepill — pull request #19 by rteabeault (2013-11-18 23:04:00+00:00)
Title: COOK-4010: Check for service_running? should be more specific

The service_running method was not correctly determining if the service was actually up. The exit code of the bluepill status command seems to always return 0. The change was to do a regex against the stdout of the status command. This change broke the service.must_be_running test. The existing tests was creating a pill file with a command that would never actually start but instead would exit with a non-zero exit code and continually be respawned by bluepill. This was the intention of the service, but because bluepill would always report "starting" instead of "up", the service was never considered up.

We removed the test that was listening for the secret being sent to the tcp port and just created a daemonized process that would stay running. We felt this was more testing bluepill's function of respawning a process than validating the functionality of the bluepill cookbook. Also, to ensure that the service is running before actually running the tests we make the test recipe block until the service is up.