From 11c62d0aa05922a6e5a87afc92f6b093820b72d4 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Mon, 8 Apr 2019 13:52:07 +0200 Subject: [PATCH] Enable bionic/stein and disco/stein functional tests Change-Id: I04958075c2bd22ff0d932ca05cdc8d1868f0995c --- tests/basic_deployment.py | 21 +++++++++++++++------ tests/dev-basic-disco-stein | 23 +++++++++++++++++++++++ tests/gate-basic-bionic-stein | 25 +++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 6 deletions(-) create mode 100755 tests/dev-basic-disco-stein create mode 100755 tests/gate-basic-bionic-stein diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 2f691784..effd4ba4 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -52,7 +52,7 @@ class NeutronAPIBasicDeployment(OpenStackAmuletDeployment): services = ("neutron-server", "apache2", "haproxy") u.get_unit_process_ids( {self.neutron_api_sentry: services}, - expect_success=should_run) + expect_success=should_run, pgrep_full=self.pgrep_full) def _add_services(self): """Add services @@ -155,6 +155,13 @@ class NeutronAPIBasicDeployment(OpenStackAmuletDeployment): self.neutron_ovs_sentry = self.d.sentry['neutron-openvswitch'][0] self.nova_compute_sentry = self.d.sentry['nova-compute'][0] + # pidof is failing to find neutron-server on stein + # use pgrep instead. + if self._get_openstack_release() >= self.bionic_stein: + self.pgrep_full = True + else: + self.pgrep_full = False + u.log.debug('openstack release val: {}'.format( self._get_openstack_release())) u.log.debug('openstack release str: {}'.format( @@ -579,11 +586,13 @@ class NeutronAPIBasicDeployment(OpenStackAmuletDeployment): for s, conf_file in services.iteritems(): u.log.debug("Checking that service restarted: {}".format(s)) - if not u.validate_service_config_changed(sentry, mtime, s, - conf_file, - retry_count=4, - retry_sleep_time=20, - sleep_time=20): + if not u.validate_service_config_changed( + sentry, mtime, s, + conf_file, + retry_count=4, + retry_sleep_time=20, + sleep_time=20, + pgrep_full=self.pgrep_full): self.d.configure(juju_service, set_default) msg = "service {} didn't restart after config change".format(s) amulet.raise_status(amulet.FAIL, msg=msg) diff --git a/tests/dev-basic-disco-stein b/tests/dev-basic-disco-stein new file mode 100755 index 00000000..4cf52edd --- /dev/null +++ b/tests/dev-basic-disco-stein @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# +# Copyright 2016 Canonical Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Amulet tests on a basic neutron-api deployment on disco-stein.""" + +from basic_deployment import NeutronAPIBasicDeployment + +if __name__ == '__main__': + deployment = NeutronAPIBasicDeployment(series='disco') + deployment.run_tests() diff --git a/tests/gate-basic-bionic-stein b/tests/gate-basic-bionic-stein new file mode 100755 index 00000000..b128cc68 --- /dev/null +++ b/tests/gate-basic-bionic-stein @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# +# Copyright 2016 Canonical Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Amulet tests on a basic neutron-api deployment on bionic-stein.""" + +from basic_deployment import NeutronAPIBasicDeployment + +if __name__ == '__main__': + deployment = NeutronAPIBasicDeployment(series='bionic', + openstack='cloud:bionic-stein', + source='cloud:bionic-stein') + deployment.run_tests()