Add a test for ha-promote-on-shutdown, and associated refactoring.