From b92de6b6b95ad740cbd28c5c43749341c5437fe0 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Mon, 8 Apr 2019 13:52:14 +0200 Subject: [PATCH] Enable bionic/stein and disco/stein functional tests Change-Id: Iefdd3139a7a0543fa400296ecc4a497de8d4782b --- tests/basic_deployment.py | 13 ++++++++++--- tests/dev-basic-disco-stein | 23 +++++++++++++++++++++++ tests/gate-basic-bionic-stein | 26 ++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 3 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 ed572b57..62a722f3 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -133,6 +133,13 @@ class NeutronOVSBasicDeployment(OpenStackAmuletDeployment): self.neutron_api_sentry = self.d.sentry['neutron-api'][0] self.n_ovs_sentry = self.d.sentry['neutron-openvswitch'][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 + def _wait_and_check(self, sleep=5, exclude_services=[]): """Extended wait and check helper @@ -357,9 +364,9 @@ class NeutronOVSBasicDeployment(OpenStackAmuletDeployment): sleep_time = 30 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, - sleep_time=sleep_time): + if not u.validate_service_config_changed( + sentry, mtime, s, conf_file, sleep_time=sleep_time, + pgrep_full=self.pgrep_full): self.d.configure(juju_service, set_default) self._wait_and_check() msg = "service {} didn't restart after config change".format(s) diff --git a/tests/dev-basic-disco-stein b/tests/dev-basic-disco-stein new file mode 100755 index 00000000..8da8f074 --- /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-openvswitch deployment on disco-stein.""" + +from basic_deployment import NeutronOVSBasicDeployment + +if __name__ == '__main__': + deployment = NeutronOVSBasicDeployment(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..d8da3cbd --- /dev/null +++ b/tests/gate-basic-bionic-stein @@ -0,0 +1,26 @@ +#!/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. + +# NeutronOVSBasicDeployment +"""Amulet tests on a basic neutron-openvswitch deployment on bionic-stein.""" + +from basic_deployment import NeutronOVSBasicDeployment + +if __name__ == '__main__': + deployment = NeutronOVSBasicDeployment(series='bionic', + openstack='cloud:bionic-stein', + source='cloud:bionic-stein') + deployment.run_tests()