Files
python-fuelclient/fuelclient/tests/functional/v2/test_client.py
Vitalii Myhal 820c7c488f Introduced command 'env redeploy' in v2 version of fuelclient
Example: `fuel2 env redeploy <env_id>`

Fixed deployment tests.
Fuel-web repo has been changed from 'stackforge' to 'openstack'.

Partial-Bug: 1540558
Change-Id: I6bc18ff672bc119c523841033fde4bbacb9290fd
Depends-On: Ibc89fdbfbd0a36a890412cd8e861d35bcf930690
2016-03-27 21:28:43 -05:00

57 lines
2.1 KiB
Python

# -*- coding: utf-8 -*-
#
# Copyright 2013-2014 Mirantis, Inc.
#
# 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.
from fuelclient.tests.functional import base
class TestDeployChanges(base.CLIv2TestCase):
cmd_create_env = "env create -r {0} cluster-test"
cmd_add_node = "env add nodes -e 1 -n 1 -r controller"
cmd_deploy_changes = "env deploy 1"
cmd_redeploy_changes = "env redeploy 1"
pattern_success = (r"^Deployment task with id (\d{1,}) "
r"for the environment 1 has been started.\n$")
message_error = "(No changes to deploy)\n"
def setUp(self):
super(TestDeployChanges, self).setUp()
self.load_data_to_nailgun_server()
release_id = self.get_first_deployable_release_id()
self.cmd_create_env = self.cmd_create_env.format(release_id)
self.run_cli_commands((
self.cmd_create_env,
self.cmd_add_node
))
def test_deploy_changes(self):
self.check_for_stdout_by_regexp(self.cmd_deploy_changes,
self.pattern_success)
def test_redeploy_changes(self):
result = self.check_for_stdout_by_regexp(self.cmd_deploy_changes,
self.pattern_success)
task_id = result.group(1)
self.wait_task_ready(task_id)
self.check_for_stderr(self.cmd_deploy_changes,
self.message_error,
check_errors=False)
self.check_for_stdout_by_regexp(self.cmd_redeploy_changes,
self.pattern_success)