Merge "Enable Ocata Amulet Tests"

This commit is contained in:
Jenkins 2017-03-24 13:58:07 +00:00 committed by Gerrit Code Review
commit c5448acb58
6 changed files with 17 additions and 7 deletions

View File

@ -227,6 +227,7 @@ class NRPE(object):
nagios_logdir = '/var/log/nagios' nagios_logdir = '/var/log/nagios'
nagios_exportdir = '/var/lib/nagios/export' nagios_exportdir = '/var/lib/nagios/export'
nrpe_confdir = '/etc/nagios/nrpe.d' nrpe_confdir = '/etc/nagios/nrpe.d'
homedir = '/var/lib/nagios' # home dir provided by nagios-nrpe-server
def __init__(self, hostname=None, primary=True): def __init__(self, hostname=None, primary=True):
super(NRPE, self).__init__() super(NRPE, self).__init__()
@ -369,7 +370,7 @@ def add_init_service_checks(nrpe, services, unit_name, immediate_check=True):
) )
elif os.path.exists(sysv_init): elif os.path.exists(sysv_init):
cronpath = '/etc/cron.d/nagios-service-check-%s' % svc cronpath = '/etc/cron.d/nagios-service-check-%s' % svc
checkpath = '/var/lib/nagios/service-check-%s.txt' % svc checkpath = '%s/service-check-%s.txt' % (nrpe.homedir, svc)
croncmd = ( croncmd = (
'/usr/local/lib/nagios/plugins/check_exit_status.pl ' '/usr/local/lib/nagios/plugins/check_exit_status.pl '
'-s /etc/init.d/%s status' % svc '-s /etc/init.d/%s status' % svc
@ -383,7 +384,9 @@ def add_init_service_checks(nrpe, services, unit_name, immediate_check=True):
description='service check {%s}' % unit_name, description='service check {%s}' % unit_name,
check_cmd='check_status_file.py -f %s' % checkpath, check_cmd='check_status_file.py -f %s' % checkpath,
) )
if immediate_check: # if /var/lib/nagios doesn't exist open(checkpath, 'w') will fail
# (LP: #1670223).
if immediate_check and os.path.isdir(nrpe.homedir):
f = open(checkpath, 'w') f = open(checkpath, 'w')
subprocess.call( subprocess.call(
croncmd.split(), croncmd.split(),

View File

@ -306,6 +306,8 @@ SYSTEMD_SYSTEM = '/run/systemd/system'
def init_is_systemd(): def init_is_systemd():
"""Return True if the host system uses systemd, False otherwise.""" """Return True if the host system uses systemd, False otherwise."""
if lsb_release()['DISTRIB_CODENAME'] == 'trusty':
return False
return os.path.isdir(SYSTEMD_SYSTEM) return os.path.isdir(SYSTEMD_SYSTEM)

View File

@ -12,6 +12,7 @@ tags:
- openstack - openstack
series: series:
- xenial - xenial
- zesty
- trusty - trusty
- yakkety - yakkety
provides: provides:

View File

@ -81,7 +81,7 @@ class NovaBasicDeployment(OpenStackAmuletDeployment):
{'name': 'nova-cloud-controller'}, {'name': 'nova-cloud-controller'},
{'name': 'keystone'}, {'name': 'keystone'},
{'name': 'glance'}, {'name': 'glance'},
{'name': 'percona-cluster', 'constraints': {'mem': '3072M'}}, {'name': 'percona-cluster'},
] ]
if self._get_openstack_release() >= self.xenial_ocata: if self._get_openstack_release() >= self.xenial_ocata:
other_ocata_services = [ other_ocata_services = [
@ -179,10 +179,7 @@ class NovaBasicDeployment(OpenStackAmuletDeployment):
'admin-token': 'ubuntutesting', 'admin-token': 'ubuntutesting',
} }
pxc_config = { pxc_config = {
'dataset-size': '25%',
'max-connections': 1000, 'max-connections': 1000,
'root-password': 'ChangeMe123',
'sst-password': 'ChangeMe123',
} }
configs = { configs = {

View File

@ -306,6 +306,8 @@ SYSTEMD_SYSTEM = '/run/systemd/system'
def init_is_systemd(): def init_is_systemd():
"""Return True if the host system uses systemd, False otherwise.""" """Return True if the host system uses systemd, False otherwise."""
if lsb_release()['DISTRIB_CODENAME'] == 'trusty':
return False
return os.path.isdir(SYSTEMD_SYSTEM) return os.path.isdir(SYSTEMD_SYSTEM)

View File

@ -14,13 +14,18 @@ install_command =
pip install --allow-unverified python-apt {opts} {packages} pip install --allow-unverified python-apt {opts} {packages}
commands = ostestr {posargs} commands = ostestr {posargs}
whitelist_externals = juju whitelist_externals = juju
passenv = HOME TERM AMULET_* passenv = HOME TERM AMULET_* CS_API_URL
[testenv:py27] [testenv:py27]
basepython = python2.7 basepython = python2.7
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
[testenv:py35]
basepython = python3.5
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:pep8] [testenv:pep8]
basepython = python2.7 basepython = python2.7
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt