Refactoring functions in checkers.py(part 2)

Following functions were changed:
  * get_ceph_partitions
  * get_mongo_partitions
  * check_ceph_image_size
  * check_cinder_image_size
  * upload_tarball_path
  * install_plugin_check_code

Folowing functions were moved to utils.py:
  * get_mongo_partitions
  * get_ceph_partitions
  * install_plugin_check_code
  * upload_tarball_path

Related tests are also modified.
Implements: blueprint sshmanager-integration

Change-Id: I2c2bbe0ad0cabb815ee67c5ad89fe2142d2d7383
This commit is contained in:
vgorin 2016-02-24 20:42:56 +03:00 committed by Vasily Gorin
parent 20f6cb9463
commit 5a6c1c86cd
32 changed files with 605 additions and 597 deletions

View File

@ -28,6 +28,7 @@ from fuelweb_test import logwrap
from fuelweb_test.helpers.ssh_manager import SSHManager
from fuelweb_test.helpers.utils import run_on_remote
from fuelweb_test.helpers.utils import run_on_remote_get_results
from fuelweb_test.helpers.utils import get_mongo_partitions
from fuelweb_test.settings import MASTER_IS_CENTOS7
from fuelweb_test.settings import EXTERNAL_DNS
from fuelweb_test.settings import EXTERNAL_NTP
@ -151,42 +152,18 @@ def verify_network_list_api(os_conn, net_count=None):
@logwrap
def get_ceph_partitions(remote, device, type="xfs"):
ret = remote.check_call("parted {device} print | grep {type}".format(
device=device, type=type))['stdout']
if not ret:
logger.error("Partition not present! {partitions}: ".format(
remote.check_call("parted {device} print")))
raise Exception
logger.debug("Partitions: {part}".format(part=ret))
return ret
@logwrap
def get_mongo_partitions(remote, device):
ret = remote.check_call("lsblk | grep {device} | awk {size}".format(
device=device,
size=re.escape('{print $4}')))['stdout']
if not ret:
logger.error("Partition not present! {partitions}: ".format(
remote.check_call("parted {device} print")))
raise Exception
logger.debug("Partitions: {part}".format(part=ret))
return ret
@logwrap
def check_ceph_image_size(remote, expected_size, device='vdc'):
ret = remote.check_call("df -m /dev/{device}* | grep ceph |"
" awk"
" {size}".format(device=device,
size=re.escape('{print $2}')
))['stdout']
def check_ceph_image_size(ip, expected_size, device='vdc'):
ret = ssh_manager.check_call(
ip=ip,
cmd="df -m /dev/{device}* | grep ceph | awk"
" {size}".format(device=device,
size=re.escape('{print $2}'))
)['stdout']
if not ret:
logger.error("Partition not present! {}: ".format(
remote.check_call("df -m")))
raise Exception
ssh_manager.check_call(ip=ip, cmd="df -m")))
raise Exception()
logger.debug("Partitions: {part}".format(part=ret))
assert_true(abs(float(ret[0].rstrip()) / float(expected_size) - 1) < 0.1,
"size {0} is not equal"
@ -195,8 +172,8 @@ def check_ceph_image_size(remote, expected_size, device='vdc'):
@logwrap
def check_cinder_image_size(remote, expected_size, device='vdc3'):
ret = get_mongo_partitions(remote, device)[0].rstrip().rstrip('G')
def check_cinder_image_size(ip, expected_size, device='vdc3'):
ret = get_mongo_partitions(ip, device)[0].rstrip().rstrip('G')
cinder_size = float(ret) * 1024
assert_true(abs(cinder_size / float(expected_size) - 1) < 0.1,
"size {0} is not equal"
@ -225,20 +202,6 @@ def check_unallocated_space(disks, contr_img_ceph=False):
return True
@logwrap
def upload_tarball(node_ssh, tar_path, tar_target):
assert_true(tar_path, "Source path for uploading 'tar_path' is empty, "
"please check test settings!")
check_archive_type(tar_path)
try:
logger.info("Start to upload tar file")
node_ssh.upload(tar_path, tar_target)
logger.info('File {} was uploaded on master'.format(tar_path))
except Exception:
logger.error('Failed to upload file')
logger.error(traceback.format_exc())
@logwrap
def check_archive_type(tar_path):
if os.path.splitext(tar_path)[1] not in [".tar", ".lrz", ".fp", ".rpm"]:
@ -384,17 +347,6 @@ def check_mysql(remote, node_name):
raise
@logwrap
def install_plugin_check_code(
remote, plugin, exit_code=0):
cmd = "cd /var && fuel plugins --install {0} ".format(plugin)
chan, stdin, stderr, stdout = remote.execute_async(cmd)
logger.debug('Try to read status code from chain...')
assert_equal(
chan.recv_exit_status(), exit_code,
'Install script fails with next message {0}'.format(''.join(stderr)))
@logwrap
def check_action_logs(scenario, postgres_actions):
def _check(_action, _group=False):

View File

@ -26,6 +26,8 @@ import signal
import ipaddr
from proboscis import asserts
from proboscis.asserts import assert_true
from proboscis.asserts import assert_equal
from fuelweb_test import logger
from fuelweb_test import logwrap
@ -905,3 +907,72 @@ def fill_space(ip, file_dir, size):
ip=ip,
cmd='fallocate -l {0}G {1}'.format(size, file_path),
err_msg="The file {0} was not allocated".format(file_name))
@logwrap
def get_ceph_partitions(ip, device, type="xfs"):
# Moved from checkers.py for improvement of code
ret = SSHManager().check_call(
ip=ip,
cmd="parted {device} print | grep {type}".format(device=device,
type=type)
)['stdout']
if not ret:
logger.error("Partition not present! {partitions}: ".format(
SSHManager().check_call(ip=ip,
cmd="parted {device} print")))
raise Exception()
logger.debug("Partitions: {part}".format(part=ret))
return ret
@logwrap
def get_mongo_partitions(ip, device):
# Moved from checkers.py for improvement of code
ret = SSHManager().check_call(
ip=ip,
cmd="lsblk | grep {device} | awk {size}".format(
device=device,
size=re.escape('{print $4}'))
)['stdout']
if not ret:
logger.error("Partition not present! {partitions}: ".format(
SSHManager().check_call(ip=ip,
cmd="parted {device} print")))
raise Exception()
logger.debug("Partitions: {part}".format(part=ret))
return ret
@logwrap
def upload_tarball(ip, tar_path, tar_target):
# Moved from checkers.py for improvement of code
assert_true(tar_path, "Source path for uploading 'tar_path' is empty, "
"please check test settings!")
if os.path.splitext(tar_path)[1] not in [".tar", ".lrz", ".fp", ".rpm"]:
raise Exception("Wrong archive type!")
try:
logger.info("Start to upload tar file")
SSHManager().upload_to_remote(
ip=ip,
source=tar_path,
target=tar_target
)
logger.info('File {} was uploaded on master'.format(tar_path))
except Exception:
logger.error('Failed to upload file')
logger.error(traceback.format_exc())
@logwrap
def install_plugin_check_code(ip, plugin, exit_code=0):
# Moved from checkers.py for improvement of code
cmd = "cd /var && fuel plugins --install {0} ".format(plugin)
chan, stdin, stderr, stdout = SSHManager().execute_async_on_remote(
ip=ip,
cmd=cmd
)
logger.debug('Try to read status code from chain...')
assert_equal(
chan.recv_exit_status(), exit_code,
'Install script fails with next message {0}'.format(''.join(stderr)))

View File

@ -20,7 +20,7 @@ from proboscis import test
from proboscis.asserts import assert_true
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.common import Common
from fuelweb_test import logger
from fuelweb_test.settings import DEPLOYMENT_MODE
@ -89,13 +89,15 @@ class ContrailPlugin(TestBasic):
with self.env.d_env.get_admin_remote() as remote:
# copy plugin to the master node
checkers.upload_tarball(
remote,
CONTRAIL_PLUGIN_PATH, '/var')
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=CONTRAIL_PLUGIN_PATH,
tar_target='/var'
)
# install plugin
checkers.install_plugin_check_code(
remote,
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(CONTRAIL_PLUGIN_PATH))
# copy additional packages to the master node

View File

@ -20,7 +20,7 @@ from proboscis import test
from fuelweb_test import logger
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.settings import DEPLOYMENT_MODE
from fuelweb_test.settings import ELASTICSEARCH_KIBANA_PLUGIN_PATH
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -63,16 +63,17 @@ class TestElasticsearchPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugin to the master node
checkers.upload_tarball(
remote,
ELASTICSEARCH_KIBANA_PLUGIN_PATH, '/var')
# copy plugin to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=ELASTICSEARCH_KIBANA_PLUGIN_PATH,
tar_target='/var'
)
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(ELASTICSEARCH_KIBANA_PLUGIN_PATH))
# install plugin
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(ELASTICSEARCH_KIBANA_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -19,6 +19,7 @@ from proboscis import asserts
from proboscis import test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -104,16 +105,17 @@ class EMCPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugin to the master node
checkers.upload_tarball(
remote,
settings.EMC_PLUGIN_PATH, '/var')
# copy plugin to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.EMC_PLUGIN_PATH,
tar_target='/var'
)
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(settings.EMC_PLUGIN_PATH))
# install plugin
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.EMC_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -19,6 +19,7 @@ from proboscis import test
from fuelweb_test import logger
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.settings import DEPLOYMENT_MODE
from fuelweb_test.settings import EXAMPLE_PLUGIN_PATH
from fuelweb_test.settings import EXAMPLE_PLUGIN_V3_PATH
@ -56,16 +57,16 @@ class ExamplePlugin(TestBasic):
# copy plugin to the master node
checkers.check_archive_type(EXAMPLE_PLUGIN_PATH)
with self.env.d_env.get_admin_remote() as remote:
checkers.upload_tarball(
remote,
EXAMPLE_PLUGIN_PATH, '/var')
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=EXAMPLE_PLUGIN_PATH,
tar_target='/var')
# install plugin
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(EXAMPLE_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(EXAMPLE_PLUGIN_PATH))
segment_type = NEUTRON_SEGMENT['vlan']
cluster_id = self.fuel_web.create_cluster(
@ -141,17 +142,17 @@ class ExamplePlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
with self.env.d_env.get_admin_remote() as admin_remote:
# copy plugin to the master node
checkers.check_archive_type(EXAMPLE_PLUGIN_V3_PATH)
checkers.upload_tarball(
admin_remote,
EXAMPLE_PLUGIN_V3_PATH,
'/var')
# install plugin
checkers.install_plugin_check_code(
admin_remote,
plugin=os.path.basename(EXAMPLE_PLUGIN_V3_PATH))
# copy plugin to the master node
checkers.check_archive_type(EXAMPLE_PLUGIN_V3_PATH)
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=EXAMPLE_PLUGIN_V3_PATH,
tar_target='/var'
)
# install plugin
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(EXAMPLE_PLUGIN_V3_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -273,15 +274,17 @@ class ExamplePlugin(TestBasic):
# copy plugin to the master node
checkers.check_archive_type(EXAMPLE_PLUGIN_PATH)
with self.env.d_env.get_admin_remote() as remote:
checkers.upload_tarball(
remote, EXAMPLE_PLUGIN_PATH, '/var')
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=EXAMPLE_PLUGIN_PATH,
tar_target='/var'
)
# install plugin
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(EXAMPLE_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(EXAMPLE_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -362,15 +365,16 @@ class ExamplePlugin(TestBasic):
# copy plugin to the master node
checkers.check_archive_type(EXAMPLE_PLUGIN_PATH)
with self.env.d_env.get_admin_remote() as remote:
checkers.upload_tarball(
remote, EXAMPLE_PLUGIN_PATH, '/var')
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=EXAMPLE_PLUGIN_PATH,
tar_target='/var')
# install plugin
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(EXAMPLE_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(EXAMPLE_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -18,7 +18,7 @@ from proboscis.asserts import assert_true
from proboscis import test
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.settings import DEPLOYMENT_MODE
from fuelweb_test.settings import GLUSTER_CLUSTER_ENDPOINT
from fuelweb_test.settings import GLUSTER_PLUGIN_PATH
@ -65,15 +65,16 @@ class GlusterfsPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugin to the master node
checkers.upload_tarball(
remote, GLUSTER_PLUGIN_PATH, '/var')
# copy plugin to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=GLUSTER_PLUGIN_PATH,
tar_target='/var')
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(GLUSTER_PLUGIN_PATH))
# install plugin
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(GLUSTER_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -142,16 +143,17 @@ class GlusterfsPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugin to the master node
checkers.upload_tarball(
remote, GLUSTER_PLUGIN_PATH, '/var')
# copy plugin to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=GLUSTER_PLUGIN_PATH,
tar_target='/var')
# install plugin
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(GLUSTER_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(GLUSTER_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -20,7 +20,7 @@ from proboscis import test
from fuelweb_test import logger
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.settings import DEPLOYMENT_MODE
from fuelweb_test.settings import INFLUXDB_GRAFANA_PLUGIN_PATH
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -56,11 +56,13 @@ class TestInfluxdbPlugin(TestBasic):
self.env.revert_snapshot("ready_with_3_slaves")
# copy plugin to the master node and install it
with self.env.d_env.get_admin_remote() as remote:
checkers.upload_tarball(
remote, INFLUXDB_GRAFANA_PLUGIN_PATH, '/var')
checkers.install_plugin_check_code(
remote, plugin=os.path.basename(INFLUXDB_GRAFANA_PLUGIN_PATH))
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=INFLUXDB_GRAFANA_PLUGIN_PATH,
tar_target='/var')
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(INFLUXDB_GRAFANA_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -20,7 +20,7 @@ from proboscis import test
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers import os_actions
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test import logger
from fuelweb_test.settings import DEPLOYMENT_MODE_SIMPLE
from fuelweb_test.settings import LBAAS_PLUGIN_PATH
@ -112,16 +112,17 @@ class LbaasPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugin to the master node
checkers.upload_tarball(
remote, LBAAS_PLUGIN_PATH, '/var')
# copy plugin to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=LBAAS_PLUGIN_PATH,
tar_target='/var')
# install plugin
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(LBAAS_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(LBAAS_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -193,15 +194,16 @@ class LbaasPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugin to the master node
checkers.upload_tarball(
remote, LBAAS_PLUGIN_PATH, '/var')
# copy plugin to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=LBAAS_PLUGIN_PATH,
tar_target='/var')
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(LBAAS_PLUGIN_PATH))
# install plugin
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(LBAAS_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -21,7 +21,7 @@ import requests
from fuelweb_test import logger
from fuelweb_test import settings
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.tests.base_test_case import SetupEnvironment
from fuelweb_test.tests.base_test_case import TestBasic
@ -65,37 +65,37 @@ class TestLmaCollectorPlugin(TestBasic):
# TODO(scroiset): use actions fuel_actions.py
# upload_plugin and install_plugin
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
checkers.upload_tarball(
remote,
settings.LMA_COLLECTOR_PLUGIN_PATH, "/var")
checkers.upload_tarball(
remote,
settings.ELASTICSEARCH_KIBANA_PLUGIN_PATH, "/var")
checkers.upload_tarball(
remote,
settings.INFLUXDB_GRAFANA_PLUGIN_PATH, "/var")
checkers.upload_tarball(
remote,
settings.LMA_INFRA_ALERTING_PLUGIN_PATH, "/var")
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.LMA_COLLECTOR_PLUGIN_PATH,
tar_target="/var")
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.ELASTICSEARCH_KIBANA_PLUGIN_PATH,
tar_target="/var")
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.INFLUXDB_GRAFANA_PLUGIN_PATH,
tar_target="/var")
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.LMA_INFRA_ALERTING_PLUGIN_PATH,
tar_target="/var")
# install plugins
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(settings.LMA_COLLECTOR_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.ELASTICSEARCH_KIBANA_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.INFLUXDB_GRAFANA_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.LMA_INFRA_ALERTING_PLUGIN_PATH))
# install plugins
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.LMA_COLLECTOR_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.ELASTICSEARCH_KIBANA_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.INFLUXDB_GRAFANA_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.LMA_INFRA_ALERTING_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -20,8 +20,8 @@ from proboscis import test
import requests
from fuelweb_test import logger
from fuelweb_test.helpers import utils
from fuelweb_test import settings
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.tests.base_test_case import SetupEnvironment
from fuelweb_test.tests.base_test_case import TestBasic
@ -84,18 +84,16 @@ class TestLmaInfraAlertingPlugin(TestBasic):
def _bootstrap(self):
with self.env.d_env.get_admin_remote() as remote:
# copy plugin to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.LMA_INFRA_ALERTING_PLUGIN_PATH,
tar_target="/var")
# copy plugin to the master node
checkers.upload_tarball(
remote,
settings.LMA_INFRA_ALERTING_PLUGIN_PATH, "/var")
# install plugin
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.LMA_INFRA_ALERTING_PLUGIN_PATH))
# install plugin
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.LMA_INFRA_ALERTING_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -17,7 +17,7 @@ import os
from proboscis import asserts
from proboscis import test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test import logger
from fuelweb_test.settings import DEPLOYMENT_MODE
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -60,28 +60,27 @@ class RebootPlugin(TestBasic):
self.env.revert_snapshot("ready_with_5_slaves")
# let's get ssh client for the master node
with self.env.d_env.get_admin_remote() as admin_remote:
# initiate fuel plugin builder instance
self.show_step(2)
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks with our file
fpb.fpb_replace_plugin_content(
os.path.join(tasks_path, tasks_file),
os.path.join(source_plugin_path, 'tasks.yaml'))
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
fpb.fpb_copy_plugin(
os.path.join(source_plugin_path, packet_name), plugin_path)
self.show_step(5)
checkers.install_plugin_check_code(
admin_remote,
plugin=os.path.join(plugin_path, packet_name))
# initiate fuel plugin builder instance
self.show_step(2)
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks with our file
fpb.fpb_replace_plugin_content(
os.path.join(tasks_path, tasks_file),
os.path.join(source_plugin_path, 'tasks.yaml'))
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
fpb.fpb_copy_plugin(
os.path.join(source_plugin_path, packet_name), plugin_path)
self.show_step(5)
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.join(plugin_path, packet_name))
self.show_step(6)
# create cluster
cluster_id = self.fuel_web.create_cluster(
@ -187,37 +186,36 @@ class RebootPlugin(TestBasic):
self.show_step(1, initialize=True)
self.env.revert_snapshot("ready_with_3_slaves")
# let's get ssh client for the master node
with self.env.d_env.get_admin_remote() as admin_remote:
self.show_step(2)
# initiate fuel plugin builder instance
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
fpb.fpb_install()
# change timeout to a new value '1'
fpb.put_value_to_local_yaml(os.path.join(tasks_path, tasks_file),
os.path.join('/tmp/', tasks_file),
[1, 'parameters', 'timeout'],
1)
self.show_step(3)
# create plugin template on the master node
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks with our file
fpb.fpb_replace_plugin_content(
os.path.join('/tmp/', tasks_file),
os.path.join(source_plugin_path, 'tasks.yaml'))
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
# copy plugin archive file
# to the /var directory on the master node
fpb.fpb_copy_plugin(
os.path.join(source_plugin_path, packet_name),
plugin_path)
# let's install plugin
self.show_step(5)
checkers.install_plugin_check_code(
admin_remote,
plugin=os.path.join(plugin_path, packet_name))
self.show_step(2)
# initiate fuel plugin builder instance
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
fpb.fpb_install()
# change timeout to a new value '1'
fpb.put_value_to_local_yaml(os.path.join(tasks_path, tasks_file),
os.path.join('/tmp/', tasks_file),
[1, 'parameters', 'timeout'],
1)
self.show_step(3)
# create plugin template on the master node
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks with our file
fpb.fpb_replace_plugin_content(
os.path.join('/tmp/', tasks_file),
os.path.join(source_plugin_path, 'tasks.yaml'))
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
# copy plugin archive file
# to the /var directory on the master node
fpb.fpb_copy_plugin(
os.path.join(source_plugin_path, packet_name),
plugin_path)
# let's install plugin
self.show_step(5)
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.join(plugin_path, packet_name))
# create cluster
self.show_step(6)
cluster_id = self.fuel_web.create_cluster(

View File

@ -18,7 +18,7 @@ import os
from proboscis import asserts
from proboscis import test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test import logger
from fuelweb_test.settings import DEPLOYMENT_MODE
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -62,37 +62,36 @@ class VipReservation(TestBasic):
self.show_step(1, initialize=True)
self.env.revert_snapshot("ready_with_3_slaves")
with self.env.d_env.get_admin_remote() as admin_remote:
# initiate fuel plugin builder instance
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
self.show_step(2)
fpb.fpb_install()
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, net_role_file),
os.path.join(source_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, tasks_file),
os.path.join(source_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, metadata_file),
os.path.join(source_plugin_path, metadata_file))
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
# copy plugin archive file from nailgun container
# to the /var directory on the master node
fpb.fpb_copy_plugin(os.path.join(source_plugin_path, packet_name),
plugin_path)
# let's install plugin
self.show_step(5)
checkers.install_plugin_check_code(
admin_remote,
plugin=os.path.join(plugin_path, packet_name))
# initiate fuel plugin builder instance
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
self.show_step(2)
fpb.fpb_install()
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, net_role_file),
os.path.join(source_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, tasks_file),
os.path.join(source_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, metadata_file),
os.path.join(source_plugin_path, metadata_file))
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
# copy plugin archive file from nailgun container
# to the /var directory on the master node
fpb.fpb_copy_plugin(os.path.join(source_plugin_path, packet_name),
plugin_path)
# let's install plugin
self.show_step(5)
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.join(plugin_path, packet_name))
self.show_step(6)
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -185,46 +184,45 @@ class VipReservation(TestBasic):
self.show_step(1, initialize=True)
self.env.revert_snapshot("ready_with_3_slaves")
with self.env.d_env.get_admin_remote() as admin_remote:
# initiate fuel plugin builder instance
self.show_step(2)
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(task_path, net_role_file),
os.path.join(source_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, tasks_file),
os.path.join(source_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, metadata_file),
os.path.join(source_plugin_path, metadata_file))
# initiate fuel plugin builder instance
self.show_step(2)
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(task_path, net_role_file),
os.path.join(source_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, tasks_file),
os.path.join(source_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, metadata_file),
os.path.join(source_plugin_path, metadata_file))
fpb.change_remote_yaml(
path_to_file=os.path.join(source_plugin_path, net_role_file),
element=[0, 'properties', 'vip', 0, 'namespace'],
value=namespace)
fpb.change_remote_yaml(
os.path.join(source_plugin_path, net_role_file),
[1, 'properties', 'vip', 0, 'namespace'],
namespace)
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
# copy plugin archive file
# to the /var directory on the master node
fpb.fpb_copy_plugin(os.path.join(source_plugin_path, packet_name),
plugin_path)
# let's install plugin
self.show_step(5)
checkers.install_plugin_check_code(
admin_remote,
plugin=os.path.join(plugin_path, packet_name))
fpb.change_remote_yaml(
path_to_file=os.path.join(source_plugin_path, net_role_file),
element=[0, 'properties', 'vip', 0, 'namespace'],
value=namespace)
fpb.change_remote_yaml(
os.path.join(source_plugin_path, net_role_file),
[1, 'properties', 'vip', 0, 'namespace'],
namespace)
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
# copy plugin archive file
# to the /var directory on the master node
fpb.fpb_copy_plugin(os.path.join(source_plugin_path, packet_name),
plugin_path)
# let's install plugin
self.show_step(5)
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.join(plugin_path, packet_name))
self.show_step(6)
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -313,46 +311,45 @@ class VipReservation(TestBasic):
self.show_step(1, initialize=True)
self.env.revert_snapshot("ready_with_3_slaves")
with self.env.d_env.get_admin_remote() as admin_remote:
self.show_step(2)
# initiate fuel plugin builder instance
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(task_path, net_role_file),
os.path.join(source_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, tasks_file),
os.path.join(source_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, metadata_file),
os.path.join(source_plugin_path, metadata_file))
self.show_step(2)
# initiate fuel plugin builder instance
fpb = FuelPluginBuilder()
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(task_path, net_role_file),
os.path.join(source_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, tasks_file),
os.path.join(source_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, metadata_file),
os.path.join(source_plugin_path, metadata_file))
fpb.change_remote_yaml(
os.path.join(source_plugin_path, net_role_file),
[0, 'properties', 'vip', 0, 'namespace'],
namespace)
fpb.change_remote_yaml(
os.path.join(source_plugin_path, net_role_file),
[1, 'properties', 'vip', 0, 'namespace'],
namespace)
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
# copy plugin archive file
# to the /var directory on the master node
fpb.fpb_copy_plugin(os.path.join(source_plugin_path, packet_name),
plugin_path)
self.show_step(5)
# let's install plugin
checkers.install_plugin_check_code(
admin_remote,
plugin=os.path.join(plugin_path, packet_name))
fpb.change_remote_yaml(
os.path.join(source_plugin_path, net_role_file),
[0, 'properties', 'vip', 0, 'namespace'],
namespace)
fpb.change_remote_yaml(
os.path.join(source_plugin_path, net_role_file),
[1, 'properties', 'vip', 0, 'namespace'],
namespace)
# build plugin
self.show_step(4)
packet_name = fpb.fpb_build_plugin(source_plugin_path)
# copy plugin archive file
# to the /var directory on the master node
fpb.fpb_copy_plugin(os.path.join(source_plugin_path, packet_name),
plugin_path)
self.show_step(5)
# let's install plugin
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.join(plugin_path, packet_name))
self.show_step(6)
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,

View File

@ -23,7 +23,7 @@ from proboscis.asserts import assert_true
from proboscis import test
import requests
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -167,12 +167,13 @@ class ZabbixPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
with self.env.d_env.get_admin_remote() as remote:
checkers.upload_tarball(
remote, settings.ZABBIX_PLUGIN_PATH, "/var")
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(settings.ZABBIX_PLUGIN_PATH))
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.ZABBIX_PLUGIN_PATH,
tar_target="/var")
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.ZABBIX_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -249,14 +250,15 @@ class ZabbixPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
with self.env.d_env.get_admin_remote() as remote:
for plugin in [settings.ZABBIX_PLUGIN_PATH,
settings.ZABBIX_SNMP_PLUGIN_PATH]:
checkers.upload_tarball(
remote, plugin, "/var")
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(plugin))
for plugin in [settings.ZABBIX_PLUGIN_PATH,
settings.ZABBIX_SNMP_PLUGIN_PATH]:
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=plugin,
tar_target="/var")
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(plugin))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -346,15 +348,16 @@ class ZabbixPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
with self.env.d_env.get_admin_remote() as remote:
for plugin in [settings.ZABBIX_PLUGIN_PATH,
settings.ZABBIX_SNMP_PLUGIN_PATH,
settings.ZABBIX_SNMP_EMC_PLUGIN_PATH]:
checkers.upload_tarball(
remote, plugin, "/var")
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(plugin))
for plugin in [settings.ZABBIX_PLUGIN_PATH,
settings.ZABBIX_SNMP_PLUGIN_PATH,
settings.ZABBIX_SNMP_EMC_PLUGIN_PATH]:
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=plugin,
tar_target="/var")
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(plugin))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -428,15 +431,16 @@ class ZabbixPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
with self.env.d_env.get_admin_remote() as remote:
for plugin in [settings.ZABBIX_PLUGIN_PATH,
settings.ZABBIX_SNMP_PLUGIN_PATH,
settings.ZABBIX_SNMP_EXTREME_PLUGIN_PATH]:
checkers.upload_tarball(
remote, plugin, "/var")
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(plugin))
for plugin in [settings.ZABBIX_PLUGIN_PATH,
settings.ZABBIX_SNMP_PLUGIN_PATH,
settings.ZABBIX_SNMP_EXTREME_PLUGIN_PATH]:
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=plugin,
tar_target="/var")
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(plugin))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
@ -510,12 +514,13 @@ class ZabbixPlugin(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
with self.env.d_env.get_admin_remote() as remote:
checkers.upload_tarball(
remote, settings.ZABBIX_PLUGIN_PATH, "/var")
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(settings.ZABBIX_PLUGIN_PATH))
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.ZABBIX_PLUGIN_PATH,
tar_target="/var")
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.ZABBIX_PLUGIN_PATH))
cluster_settings = {}
if settings.NEUTRON_ENABLE:

View File

@ -25,6 +25,7 @@ from devops.helpers.helpers import wait
from fuelweb_test.helpers import os_actions
from fuelweb_test.helpers import ceph
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers.ovs import ovs_get_tag_by_port
from fuelweb_test import ostf_test_mapping
@ -857,10 +858,9 @@ class CheckCephPartitionsAfterReboot(TestBasic):
self.show_step(7, node)
logger.info("Get partitions for {node}".format(node=node))
_ip = self.fuel_web.get_nailgun_node_by_name(node)['ip']
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
before_reboot_partitions = [checkers.get_ceph_partitions(
remote,
"/dev/vd{p}".format(p=part)) for part in ["b", "c"]]
before_reboot_partitions = [utils.get_ceph_partitions(
_ip,
"/dev/vd{p}".format(p=part)) for part in ["b", "c"]]
self.show_step(8, node)
logger.info("Warm-restart nodes")
@ -872,10 +872,9 @@ class CheckCephPartitionsAfterReboot(TestBasic):
node=node
))
_ip = self.fuel_web.get_nailgun_node_by_name(node)['ip']
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
after_reboot_partitions = [checkers.get_ceph_partitions(
remote,
"/dev/vd{p}".format(p=part)) for part in ["b", "c"]]
after_reboot_partitions = [utils.get_ceph_partitions(
_ip,
"/dev/vd{p}".format(p=part)) for part in ["b", "c"]]
if before_reboot_partitions != after_reboot_partitions:
logger.info("Partitions don`t match")
@ -894,10 +893,9 @@ class CheckCephPartitionsAfterReboot(TestBasic):
self.show_step(12, node)
_ip = self.fuel_web.get_nailgun_node_by_name(node)['ip']
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
after_reboot_partitions = [checkers.get_ceph_partitions(
remote,
"/dev/vd{p}".format(p=part)) for part in ["b", "c"]]
after_reboot_partitions = [utils.get_ceph_partitions(
_ip,
"/dev/vd{p}".format(p=part)) for part in ["b", "c"]]
if before_reboot_partitions != after_reboot_partitions:
logger.info("Partitions don`t match")

View File

@ -19,6 +19,7 @@ from proboscis import test
from proboscis.asserts import assert_equal
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers import os_actions
from fuelweb_test import settings
@ -547,8 +548,7 @@ class CeilometerHAOneControllerMongo(OSTFCeilometerHelper):
ignore_count_of_proccesses=True)
_ip = self.fuel_web.get_nailgun_node_by_name("slave-03")['ip']
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
partitions = checkers.get_mongo_partitions(remote, "vda5")
partitions = utils.get_mongo_partitions(_ip, "vda5")
assert_equal(partitions[0].rstrip(), mongo_disk_gb,
'Mongo size {0} before deployment is not equal'

View File

@ -106,7 +106,6 @@ class HaTunGroup3(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -116,9 +115,8 @@ class HaTunGroup3(TestBasic):
self.fuel_web.verify_network(cluster_id)
self.fuel_web.deploy_cluster_wait(cluster_id)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
ctrls = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
cluster_id, roles=['controller'])
@ -192,7 +190,6 @@ class HaTunGroup3(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -202,10 +199,9 @@ class HaTunGroup3(TestBasic):
self.fuel_web.verify_network(cluster_id)
self.fuel_web.deploy_cluster_wait(cluster_id)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
# TODO: add pool size check
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
# TODO: add pool size check
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
self.fuel_web.check_ceph_status(cluster_id)
self.fuel_web.verify_network(cluster_id)

View File

@ -82,7 +82,6 @@ class HaVlanGroup1(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -91,9 +90,8 @@ class HaVlanGroup1(TestBasic):
self.fuel_web.check_ceph_status(cluster_id)
self.fuel_web.verify_network(cluster_id)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
self.fuel_web.run_ostf(cluster_id=cluster_id)
@ -155,7 +153,6 @@ class HaVlanGroup1(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -164,9 +161,8 @@ class HaVlanGroup1(TestBasic):
self.fuel_web.deploy_cluster_wait(cluster_id)
self.fuel_web.check_ceph_status(cluster_id)
self.fuel_web.verify_network(cluster_id)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
self.fuel_web.run_ostf(cluster_id=cluster_id)

View File

@ -79,17 +79,15 @@ class HaVlanGroup4(TestBasic):
}
)
self.show_step(6)
n_cinders = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
cinders = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
cluster_id=cluster_id,
roles=['cinder'],
role_status='pending_roles'
)
for node in n_cinders:
for node in cinders:
cinder_image_size = self.fuel_web.update_node_partitioning(node)
d_cinders = self.fuel_web.get_devops_nodes_by_nailgun_nodes(n_cinders)
self.show_step(7)
self.fuel_web.verify_network(cluster_id)
@ -100,9 +98,8 @@ class HaVlanGroup4(TestBasic):
self.fuel_web.verify_network(cluster_id)
self.show_step(10)
for d_cinder in d_cinders:
with self.fuel_web.get_ssh_for_node(d_cinder.name) as remote:
checkers.check_cinder_image_size(remote, cinder_image_size)
for cinder in cinders:
checkers.check_cinder_image_size(cinder['ip'], cinder_image_size)
self.show_step(11)
self.fuel_web.run_ostf(cluster_id)

View File

@ -167,7 +167,6 @@ class HaVlanGroup5(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -175,7 +174,6 @@ class HaVlanGroup5(TestBasic):
cinder_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['cinder'],
role_status='pending_roles')
d_cinder = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for cinder_node in cinder_nodes:
cinder_image_size = self.fuel_web.\
update_node_partitioning(cinder_node, node_role='cinder')
@ -189,13 +187,11 @@ class HaVlanGroup5(TestBasic):
self.show_step(13)
self.fuel_web.verify_network(cluster_id)
self.show_step(14)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
for devops_cinder in d_cinder:
with self.fuel_web.get_ssh_for_node(devops_cinder.name) as remote:
checkers.check_cinder_image_size(remote, cinder_image_size)
for cinder in cinder_nodes:
checkers.check_cinder_image_size(cinder['ip'], cinder_image_size)
self.show_step(15)
self.fuel_web.run_ostf(cluster_id=cluster_id)

View File

@ -92,7 +92,6 @@ class HaVlanGroup6(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -105,9 +104,8 @@ class HaVlanGroup6(TestBasic):
self.fuel_web.verify_network(cluster_id)
self.show_step(11)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
self.show_step(12)
self.fuel_web.run_ostf(cluster_id=cluster_id)
@ -179,7 +177,6 @@ class HaVlanGroup6(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -193,9 +190,8 @@ class HaVlanGroup6(TestBasic):
self.show_step(10)
self.fuel_web.verify_network(cluster_id)
self.show_step(11)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
self.show_step(12)
self.fuel_web.run_ostf(cluster_id=cluster_id)

View File

@ -85,7 +85,6 @@ class HaVlanGroup7(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -94,9 +93,8 @@ class HaVlanGroup7(TestBasic):
self.fuel_web.check_ceph_status(cluster_id)
self.fuel_web.verify_network(cluster_id)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
self.fuel_web.run_ostf(cluster_id=cluster_id)

View File

@ -83,7 +83,6 @@ class MultiroleGroup1(TestBasic):
ceph_nodes = self.fuel_web.\
get_nailgun_cluster_nodes_by_roles(cluster_id, ['ceph-osd'],
role_status='pending_roles')
d_ceph = self.fuel_web.get_devops_nodes_by_nailgun_nodes(ceph_nodes)
for ceph_node in ceph_nodes:
ceph_image_size = self.fuel_web.\
update_node_partitioning(ceph_node, node_role='ceph')
@ -96,9 +95,8 @@ class MultiroleGroup1(TestBasic):
self.fuel_web.verify_network(cluster_id)
self.show_step(10)
for devops_ceph in d_ceph:
with self.fuel_web.get_ssh_for_node(devops_ceph.name) as remote:
checkers.check_ceph_image_size(remote, ceph_image_size)
for ceph in ceph_nodes:
checkers.check_ceph_image_size(ceph['ip'], ceph_image_size)
self.show_step(11)
self.fuel_web.run_ostf(cluster_id=cluster_id)

View File

@ -19,6 +19,7 @@ from proboscis import test
from devops.helpers.helpers import wait
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test import logger
@ -52,20 +53,19 @@ class SeparateDb(TestBasic):
self.check_run("separate_db_service")
self.env.revert_snapshot("ready_with_9_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_DB_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH, "/var")
# install plugins
# install plugins
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
data = {
'tenant': 'separatedb',

View File

@ -17,7 +17,7 @@ import os
from proboscis.asserts import assert_true
from proboscis import test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -51,20 +51,19 @@ class SeparateDbCeph(TestBasic):
self.check_run("separate_db_ceph_service")
self.env.revert_snapshot("ready_with_9_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_DB_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH, "/var")
# install plugins
# install plugins
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
data = {
'volumes_lvm': False,

View File

@ -18,7 +18,7 @@ from proboscis import test
from proboscis.asserts import assert_true
from devops.helpers.helpers import wait
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test import logger
@ -52,20 +52,19 @@ class SeparateHorizon(TestBasic):
self.check_run("separate_horizon_service")
self.env.revert_snapshot("ready_with_9_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_HORIZON_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_HORIZON_PLUGIN_PATH, "/var")
# install plugins
# install plugins
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_HORIZON_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_HORIZON_PLUGIN_PATH))
data = {
'volumes_lvm': False,

View File

@ -19,6 +19,7 @@ from proboscis.asserts import assert_true
from devops.helpers.helpers import wait
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test import logger
@ -53,29 +54,29 @@ class SeparateKeystone(TestBasic):
self.check_run("separate_keystone_service")
self.env.revert_snapshot("ready_with_9_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_DB_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH, "/var")
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH, "/var")
# install plugins
# install plugins
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH))
data = {
'tenant': 'separatekeystone',

View File

@ -17,7 +17,7 @@ import os
from proboscis import test
from proboscis.asserts import assert_true
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -50,29 +50,29 @@ class SeparateKeystoneCeph(TestBasic):
self.check_run("separate_keystone_ceph_service")
self.env.revert_snapshot("ready_with_9_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_DB_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH, "/var")
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH, "/var")
# install plugins
# install plugins
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH))
data = {
'volumes_lvm': False,

View File

@ -18,7 +18,7 @@ from proboscis import test
from proboscis.asserts import assert_true
from devops.helpers.helpers import wait
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test import logger
@ -53,38 +53,39 @@ class SeparateAllServices(TestBasic):
self.check_run("separate_all_service")
self.env.revert_snapshot("ready_with_9_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_DB_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH, "/var")
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH, "/var")
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH, "/var")
# install plugins
# install plugins
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_DB_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH))
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_KEYSTONE_PLUGIN_PATH))
data = {
'tenant': 'separateall',

View File

@ -19,6 +19,7 @@ from proboscis import test
from devops.helpers.helpers import wait
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test import logger
@ -52,20 +53,19 @@ class SeparateRabbit(TestBasic):
self.check_run("separate_rabbit_service")
self.env.revert_snapshot("ready_with_9_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH, "/var")
# install plugins
# install plugins
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH))
data = {
'tenant': 'separaterabbit',

View File

@ -17,7 +17,7 @@ import os
from proboscis.asserts import assert_true
from proboscis import test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -50,20 +50,19 @@ class SeparateRabbitCeph(TestBasic):
self.check_run("separate_rabbit_ceph_service")
self.env.revert_snapshot("ready_with_9_slaves")
with self.env.d_env.get_admin_remote() as remote:
# copy plugins to the master node
# copy plugins to the master node
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH,
tar_target="/var")
checkers.upload_tarball(
remote,
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH, "/var")
# install plugins
# install plugins
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(
settings.SEPARATE_SERVICE_RABBIT_PLUGIN_PATH))
data = {
'volumes_lvm': False,

View File

@ -16,8 +16,7 @@ import os
from proboscis.asserts import assert_true, assert_equal
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import utils
from system_test import logger
from system_test import action
from system_test import deferred_decorator
@ -49,10 +48,10 @@ class PluginsActions(object):
# copy plugin to the master node
assert_true(self.plugin_path, "plugin_path is not specified")
with self.env.d_env.get_admin_remote() as remote:
checkers.upload_tarball(
remote,
self.plugin_path, '/var')
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=self.plugin_path,
tar_target='/var')
@deferred_decorator([make_snapshot_if_step_fail])
@action
@ -60,10 +59,9 @@ class PluginsActions(object):
"""Install plugin to Fuel"""
assert_true(self.plugin_path, "plugin_path is not specified")
with self.env.d_env.get_admin_remote() as remote:
checkers.install_plugin_check_code(
remote,
plugin=os.path.basename(self.plugin_path))
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(self.plugin_path))
@deferred_decorator([make_snapshot_if_step_fail])
@action