Merge "Revert "Add gate_tests directory for test_directory""
This commit is contained in:
commit
072316a83a
@ -388,7 +388,7 @@ def run_on_remote(*args, **kwargs):
|
||||
@logwrap
|
||||
def run_on_remote_get_results(remote, cmd, clear=False, err_msg=None,
|
||||
jsonify=False, assert_ec_equal=None,
|
||||
raise_on_assert=True, cli_command=None):
|
||||
raise_on_assert=True):
|
||||
# TODO(ivankliuk): move it to devops.helpers.SSHClient
|
||||
"""Execute ``cmd`` on ``remote`` and return result.
|
||||
|
||||
@ -426,14 +426,11 @@ def run_on_remote_get_results(remote, cmd, clear=False, err_msg=None,
|
||||
if clear:
|
||||
remote.clear()
|
||||
|
||||
if cli_command:
|
||||
result['stdout_str'] = ''.join(result['stdout'][2:])
|
||||
else:
|
||||
result['stdout_str'] = ''.join(result['stdout'])
|
||||
result['stdout_str'] = ''.join(result['stdout'])
|
||||
result['stdout_len'] = len(result['stdout'])
|
||||
result['stderr_str'] = ''.join(result['stderr'])
|
||||
result['stderr_len'] = len(result['stderr'])
|
||||
logger.debug('Result sdtout_str {0}'.format(result['stdout_str']))
|
||||
|
||||
if jsonify:
|
||||
try:
|
||||
result['stdout_json'] = json_deserialize(result['stdout_str'])
|
||||
|
@ -33,7 +33,7 @@ class CommandLine(TestBasic):
|
||||
@logwrap
|
||||
def get_task(self, remote, task_id):
|
||||
tasks = run_on_remote(remote, 'fuel task --task-id {0} --json'
|
||||
.format(task_id), jsonify=True, cli_command=True)
|
||||
.format(task_id), jsonify=True)
|
||||
return tasks[0]
|
||||
|
||||
@logwrap
|
||||
|
@ -67,8 +67,7 @@ class GateFuelWeb(TestBasic):
|
||||
cmd = ('fuel env create --name={0} --release={1} '
|
||||
'--nst=tun --json'.format(self.__class__.__name__,
|
||||
release_id))
|
||||
env_result = run_on_remote(
|
||||
remote, cmd, jsonify=True, cli_command=True)
|
||||
env_result = run_on_remote(remote, cmd, jsonify=True)
|
||||
cluster_id = env_result['id']
|
||||
|
||||
self.show_step(7)
|
||||
|
@ -91,8 +91,7 @@ class GateAstute(TestBasic):
|
||||
cmd = ('fuel env create --name={0} --release={1} '
|
||||
'--nst=tun --json'.format(self.__class__.__name__,
|
||||
release_id))
|
||||
env_result = run_on_remote(
|
||||
remote, cmd, jsonify=True, cli_command=True)
|
||||
env_result = run_on_remote(remote, cmd, jsonify=True)
|
||||
|
||||
self.show_step(6)
|
||||
cluster_id = env_result['id']
|
||||
|
@ -72,8 +72,7 @@ class Gate(TestBasic):
|
||||
cmd = ('fuel env create --name={0} --release={1} '
|
||||
'--nst=tun --json'.format(self.__class__.__name__,
|
||||
release_id))
|
||||
env_result = run_on_remote(
|
||||
remote, cmd, jsonify=True, cli_command=True)
|
||||
env_result = run_on_remote(remote, cmd, jsonify=True)
|
||||
cluster_id = env_result['id']
|
||||
|
||||
self.show_step(6)
|
||||
|
@ -14,13 +14,16 @@
|
||||
import os
|
||||
import traceback
|
||||
|
||||
from devops.error import TimeoutError
|
||||
from devops.helpers.helpers import wait
|
||||
from proboscis import test
|
||||
from proboscis import asserts
|
||||
|
||||
|
||||
from gates_tests.helpers import exceptions
|
||||
from fuelweb_test.helpers.decorators import log_snapshot_after_test
|
||||
from fuelweb_test.helpers.utils import get_package_version
|
||||
from fuelweb_test.helpers.utils import run_on_remote
|
||||
from fuelweb_test.helpers.utils import get_package_version
|
||||
from fuelweb_test.settings import UPDATE_FUEL
|
||||
from fuelweb_test.settings import UPDATE_FUEL_PATH
|
||||
from fuelweb_test.tests.base_test_case import SetupEnvironment
|
||||
@ -135,7 +138,7 @@ class CreateDeployEnvironmentCli(test_cli_base.CommandLine):
|
||||
self.show_step(4)
|
||||
list_release_cmd = 'fuel release --json'
|
||||
list_release_res = run_on_remote(
|
||||
remote, list_release_cmd, jsonify=True, cli_command=True)
|
||||
remote, list_release_cmd, jsonify=True)
|
||||
active_release_id = [
|
||||
release['id'] for release
|
||||
in list_release_res if release['is_deployable']]
|
||||
@ -149,8 +152,7 @@ class CreateDeployEnvironmentCli(test_cli_base.CommandLine):
|
||||
'--nst=tun --json'.format(self.__class__.__name__,
|
||||
active_release_id[0]))
|
||||
|
||||
env_result = run_on_remote(
|
||||
remote, cmd, jsonify=True, cli_command=True)
|
||||
env_result = run_on_remote(remote, cmd, jsonify=True)
|
||||
cluster_id = env_result['id']
|
||||
cluster_name = env_result['name']
|
||||
|
||||
@ -165,7 +167,7 @@ class CreateDeployEnvironmentCli(test_cli_base.CommandLine):
|
||||
self.show_step(8)
|
||||
cmd = 'fuel env --json'
|
||||
env_list_res = run_on_remote(
|
||||
remote, cmd, jsonify=True, cli_command=True)
|
||||
remote, cmd, jsonify=True)
|
||||
asserts.assert_true(
|
||||
cluster_id in [cluster['id'] for cluster in env_list_res],
|
||||
'Can not find created before environment'
|
||||
@ -183,14 +185,14 @@ class CreateDeployEnvironmentCli(test_cli_base.CommandLine):
|
||||
remote.execute(cmd)
|
||||
cmd = ('fuel --env-id={0} node --provision --node={1} --json'
|
||||
.format(cluster_id, node_id[0]))
|
||||
task = run_on_remote(remote, cmd, jsonify=True, cli_command=True)
|
||||
task = run_on_remote(remote, cmd, jsonify=True)
|
||||
self.assert_cli_task_success(task, remote, timeout=30 * 60)
|
||||
|
||||
# Deploy the controller node
|
||||
self.show_step(10)
|
||||
cmd = ('fuel --env-id={0} node --deploy --node {1} --json'
|
||||
.format(cluster_id, node_id[0]))
|
||||
task = run_on_remote(remote, cmd, jsonify=True, cli_command=True)
|
||||
task = run_on_remote(remote, cmd, jsonify=True)
|
||||
self.assert_cli_task_success(task, remote, timeout=60 * 60)
|
||||
|
||||
self.fuel_web.run_ostf(
|
||||
@ -202,4 +204,14 @@ class CreateDeployEnvironmentCli(test_cli_base.CommandLine):
|
||||
asserts.assert_true(
|
||||
res['exit_code'] == 0)
|
||||
|
||||
with self.env.d_env.get_admin_remote() as remote:
|
||||
try:
|
||||
wait(lambda:
|
||||
remote.execute("fuel env | awk '{print $1}'"
|
||||
" | tail -n 1 | grep '^.$'")
|
||||
['exit_code'] == 1, timeout=60 * 10)
|
||||
except TimeoutError:
|
||||
raise TimeoutError(
|
||||
"cluster {0} was not deleted".format(cluster_id))
|
||||
|
||||
self.env.make_snapshot("review_fuel_cli_one_node_deploy")
|
||||
|
Loading…
Reference in New Issue
Block a user