Skip keepalived_respawns test

keepalived fails to respawn after crash for > 1.2.11 version.

When keepalived starts, it spawns vrrp thread to monitor vrrp forked
process. It also creates a vrrp pid file. When the process is killed, and
it's restarted, the the new keepalived process runs with -P, so
when we validate whether we are already running,  we check vrrp pid file.
Since we never clean up the file before starting the process, and the process
dies without a chance to clean up the file as part of its signal
handler, respawn never works.

keepalived_respawns test should be skipped until bug is resolved.
See also: https://bugzilla.redhat.com/show_bug.cgi?id=1286729

Change-Id: Ic111573e0cd5ad5bfe70b0f38ec0203c10d52e34
Related-Bug: #1511311
This commit is contained in:
Arie Bregman 2015-12-01 09:47:55 +02:00
parent a6c10ac125
commit 34822ba31a
1 changed files with 17 additions and 0 deletions

View File

@ -13,8 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from distutils import version
import re
from oslo_config import cfg
from oslo_log import log as logging
import testtools
from neutron.agent.linux import external_process
from neutron.agent.linux import keepalived
@ -26,6 +30,18 @@ from neutron.tests.unit.agent.linux import test_keepalived
LOG = logging.getLogger(__name__)
def keepalived_version_not_supported():
try:
cmd = ['keepalived', '--version']
out = utils.execute(cmd, return_stderr=True)
ver = re.search(r"Keepalived v(\d+\.\d+\.\d+)", out[1]).group(1)
return version.LooseVersion(ver) >= version.LooseVersion("1.2.11")
except (OSError, RuntimeError, IndexError, ValueError) as e:
LOG.debug("Exception while checking keepalived version. "
"Exception: %s", e)
return False
class KeepalivedManagerTestCase(base.BaseTestCase,
test_keepalived.KeepalivedConfBaseMixin):
@ -53,6 +69,7 @@ class KeepalivedManagerTestCase(base.BaseTestCase,
self.assertEqual(self.expected_config.get_config_str(),
self.manager.get_conf_on_disk())
@testtools.skipIf(keepalived_version_not_supported(), 'bug/1511311')
def test_keepalived_respawns(self):
self.manager.spawn()
process = self.manager.get_process()