Add api calls to os in assert_cluster_ready

We should to stop use exec os command over ssh
and start to use python clients for cluster
verification.
This patch includes:
* add some api calls to the helpers.os_action
* checkers.image_list start to use api calls
* checkers.service_list move from nova-message
  usage to nova.services.list()
* checkers.netwotk_list start to use nova.networks.list()
* Test were updated

Change-Id: I2f042b3c8215611ce2c1a6f0cf37ccd03bbdf967
Closes-Bug: #1385420
This commit is contained in:
Tatyana Leontovich 2014-10-24 20:48:16 +00:00
parent e9839f6855
commit 3fb992e74f
12 changed files with 555 additions and 111 deletions

View File

@ -124,14 +124,6 @@ def get_interface_description(ctrl_ssh, interface_short_name):
)
@logwrap
def verify_glance_image_list(remote):
ret = remote.check_call('. /root/openrc; glance image-list')['stdout']
logger.info("glance image-list output: \\n{}" .format(ret))
assert_equal(1, ''.join(ret).count("TestVM"),
"TestVM not found in glance image-list")
def verify_network_configuration(remote, node):
for interface in node['network_data']:
if interface.get('vlan') is None:
@ -156,15 +148,6 @@ def verify_network_configuration(remote, node):
"brd {}".format(interface['brd']) in interface_description)
@logwrap
def verify_network_list(networks_count, remote):
ret = remote.check_call('/usr/bin/nova-manage network list')
logger.debug("network list: \\n: {}".format(ret['stdout']))
assert_equal(len(ret['stdout'][1:]), networks_count,
"Actual network list {} not equal to expected {}".format(
len(ret['stdout'][1:]), networks_count))
@logwrap
def verify_service(remote, service_name, count=1):
ps_output = remote.execute('ps ax')['stdout']
@ -175,15 +158,22 @@ def verify_service(remote, service_name, count=1):
@logwrap
def verify_service_list(remote, smiles_count):
def verify_service_list_api(os_conn, service_count):
def _verify():
ret = remote.check_call('/usr/bin/nova-manage service list')
logger.debug("Service list: {}".format(ret['stdout']))
assert_equal(
smiles_count, ''.join(ret['stdout']).count(":-)"), "Smiles count")
assert_equal(
0, ''.join(ret['stdout']).count("XXX"), "Broken services count")
ret = os_conn.get_nova_service_list()
logger.debug('Service list {0}'.format(ret))
assert_equal(service_count, len(ret),
'Expected service count is {0},'
' but get {1} count, actual list {2}'.format(
service_count, len(ret), ret))
for service in ret:
logger.debug('service is {0}'.format(service))
assert_equal(
service.state, 'up',
'Service {0} on host {1} has next '
'state {2}'.format(service.binary,
service.host,
service.state))
try:
_verify()
except AssertionError:
@ -193,6 +183,22 @@ def verify_service_list(remote, smiles_count):
_verify()
@logwrap
def verify_glance_image_api(os_conn):
ret = os_conn.get_image_list()
assert_equal(1, len([i for i in ret if i.name == 'TestVM']),
"TestVM not found in glance image-list")
@logwrap
def verify_network_list_api(os_conn, net_count=None):
ret = os_conn.get_nova_network_list()
assert_equal(net_count, len(ret),
'Unexpected count of networks detected, '
'expected: {0}, current {1} count,'
' full list {2}'.format(net_count, len(ret), ret))
@logwrap
def get_ceph_partitions(remote, device, type="xfs"):
ret = remote.check_call("parted {device} print | grep {type}".format(

View File

@ -280,9 +280,21 @@ class OpenStackActions(common.Common):
return router
return None
def get_image_list(self):
return self.glance.images.list()
def get_image(self, image_name):
image_list = self.glance.images.list()
image_list = self.get_image_list()
for img in image_list:
if img.name == image_name:
return img
return None
def get_image_data(self, image_name):
return self.glance.images.data(image_name)
def get_nova_service_list(self):
return self.nova.services.list()
def get_nova_network_list(self):
return self.nova.networks.list()

View File

@ -0,0 +1,336 @@
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.3" jmeter="2.8.20130705">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Create_cluster_100_100" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">100</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1411570374000</longProp>
<longProp name="ThreadGroup.end_time">1411570374000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">{&quot;auth&quot;:{&quot;passwordCredentials&quot;:{&quot;username&quot;:&quot;admin&quot;,&quot;password&quot;:&quot;admin&quot;},&quot;tenantName&quot;:&quot;admin&quot;}}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name"></stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">10.108.0.2</stringProp>
<stringProp name="HTTPSampler.port">8000</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">keystone/v2.0/tokens</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true">
<stringProp name="RegexExtractor.useHeaders">false</stringProp>
<stringProp name="RegexExtractor.refname">token</stringProp>
<stringProp name="RegexExtractor.regex">&quot;token&quot;\s*:\s*{[^{]*&quot;id&quot;\s*:\s*&quot;(\w+)</stringProp>
<stringProp name="RegexExtractor.template">$1$</stringProp>
<stringProp name="RegexExtractor.default">BLQAAA</stringProp>
<stringProp name="RegexExtractor.match_number"></stringProp>
<stringProp name="Scope.variable"></stringProp>
</RegexExtractor>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create_cluster" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">{&quot;nodes&quot;:[],&quot;tasks&quot;:[],&quot;name&quot;: &quot;cluster${__Random(1, 10000)}&quot;, &quot;release&quot;:1,&quot;mode&quot;:&quot;ha_compact&quot;,&quot;net_provider&quot;:&quot;nova_network&quot;}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name"></stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">10.108.0.2</stringProp>
<stringProp name="HTTPSampler.port">8000</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">http://10.108.0.2:8000/api/clusters</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
<stringProp name="delimiter"></stringProp>
<stringProp name="fileEncoding"></stringProp>
<stringProp name="filename">cluster|_name.cvs</stringProp>
<boolProp name="quotedData">false</boolProp>
<boolProp name="recycle">true</boolProp>
<stringProp name="shareMode">All threads</stringProp>
<boolProp name="stopThread">false</boolProp>
<stringProp name="variableNames">CLUSTER_NAME</stringProp>
</CSVDataSet>
<hashTree/>
<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" testname="name" enabled="true">
<stringProp name="maximumValue">100</stringProp>
<stringProp name="minimumValue">1</stringProp>
<stringProp name="outputFormat">name_00</stringProp>
<boolProp name="perThread">true</boolProp>
<stringProp name="randomSeed"></stringProp>
<stringProp name="variableName">CLUSTER_NAME</stringProp>
</RandomVariableConfig>
<hashTree/>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP_Request_cluster_header" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Content-Type</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">X-Auth-Token</stringProp>
<stringProp name="Header.value">${token}</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Cookie</stringProp>
<stringProp name="Header.value">i18next=en-US</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
<RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true">
<stringProp name="RegexExtractor.useHeaders">false</stringProp>
<stringProp name="RegexExtractor.refname">cluster_id</stringProp>
<stringProp name="RegexExtractor.regex">&quot;id&quot;\s*:\s*(\d+)</stringProp>
<stringProp name="RegexExtractor.template">$1$</stringProp>
<stringProp name="RegexExtractor.default">cluster_id_did_not_get</stringProp>
<stringProp name="RegexExtractor.match_number"></stringProp>
</RegexExtractor>
<hashTree/>
</hashTree>
<ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="Aggregate Graph" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>true</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>true</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP_Delete" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">10.108.0.2</stringProp>
<stringProp name="HTTPSampler.port">8000</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">http://10.108.0.2:8000/api/clusters/${cluster_id}</stringProp>
<stringProp name="HTTPSampler.method">DELETE</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP_Request_cluster_header" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Content-Type</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">X-Auth-Token</stringProp>
<stringProp name="Header.value">${token}</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Cookie</stringProp>
<stringProp name="Header.value">i18next=en-US</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
</hashTree>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="Debug Sampler" enabled="false">
<boolProp name="displayJMeterProperties">false</boolProp>
<boolProp name="displayJMeterVariables">true</boolProp>
<boolProp name="displaySystemProperties">false</boolProp>
</DebugSampler>
<hashTree/>
<ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="Aggregate Report" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Content-Type</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
<!-- Yandex.Tank Addition -->
<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Yandex.Tank results writer"
enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>false</message>
<threadName>false</threadName>
<dataType>false</dataType>
<encoding>false</encoding>
<assertions>false</assertions>
<subresults>false</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>true</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
</value>
</objProp>
<stringProp name="filename">/home/tleontovich/.jenkins/jobs/jmeter_job/workspace/jmeter_glhRzL.jtl</stringProp>
<stringProp name="TestPlan.comments">Added automatically</stringProp>
</ResultCollector>
<hashTree/>
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="Yandex.Tank Variables" enabled="true">
<collectionProp name="Arguments.arguments">
</collectionProp>
</Arguments>
<!-- /Yandex.Tank Addition --> </hashTree>
</hashTree>
</jmeterTestPlan>

View File

@ -68,10 +68,10 @@ class FuelWebClient(object):
@staticmethod
@logwrap
def get_cluster_status(ssh_remote, smiles_count, networks_count=1):
checkers.verify_service_list(ssh_remote, smiles_count)
checkers.verify_glance_image_list(ssh_remote)
checkers.verify_network_list(networks_count, ssh_remote)
def get_cluster_status(os_conn, smiles_count, networks_count=1):
checkers.verify_service_list_api(os_conn, service_count=smiles_count)
checkers.verify_glance_image_api(os_conn)
checkers.verify_network_list_api(os_conn, networks_count)
@logwrap
def _ostf_test_wait(self, cluster_id, timeout):
@ -103,13 +103,12 @@ class FuelWebClient(object):
'Current floating IPs {0}'.format(current_ips))
@logwrap
def assert_cluster_ready(self, node_name, smiles_count,
def assert_cluster_ready(self, os_conn, smiles_count,
networks_count=1, timeout=300):
logger.info('Assert cluster services are UP')
remote = self.environment.get_ssh_to_remote_by_name(node_name)
_wait(
lambda: self.get_cluster_status(
remote,
os_conn,
smiles_count=smiles_count,
networks_count=networks_count),
timeout=timeout)

View File

@ -18,6 +18,7 @@ from proboscis import asserts
from proboscis import test
from fuelweb_test.helpers.decorators import log_snapshot_on_error
from fuelweb_test.helpers import os_actions
from fuelweb_test import settings as hlp_data
from fuelweb_test import logger
from fuelweb_test.tests import base_test_case
@ -181,8 +182,10 @@ class EnvironmentAction(base_test_case.TestBasic):
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
self.fuel_web.stop_reset_env_wait(cluster_id)
self.fuel_web.wait_nodes_get_online_state(self.env.nodes().slaves[:2])
@ -191,7 +194,7 @@ class EnvironmentAction(base_test_case.TestBasic):
cluster_id, amount=8, network_size=32)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=8, timeout=300)
os_conn, smiles_count=6, networks_count=8, timeout=300)
self.fuel_web.verify_network(cluster_id)
@ -251,8 +254,10 @@ class EnvironmentActionOnHA(base_test_case.TestBasic):
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_public_vip(cluster_id))
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=16, networks_count=1, timeout=300)
os_conn, smiles_count=16, networks_count=1, timeout=300)
self.fuel_web.verify_network(cluster_id)

View File

@ -20,6 +20,7 @@ from proboscis import test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers.decorators import log_snapshot_on_error
from fuelweb_test.helpers import os_actions
from fuelweb_test.settings import DEPLOYMENT_MODE_HA
from fuelweb_test.tests.base_test_case import SetupEnvironment
from fuelweb_test.tests.base_test_case import TestBasic
@ -51,14 +52,16 @@ class TestHaVLAN(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
data = {
'tenant': 'novaHAVlan',
'user': 'novaHAVlan',
'password': 'novaHAVlan'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=DEPLOYMENT_MODE_HA,
settings={
'tenant': 'novaHAVlan',
'user': 'novaHAVlan',
'password': 'novaHAVlan'
}
settings=data
)
self.fuel_web.update_nodes(
cluster_id,
@ -74,11 +77,14 @@ class TestHaVLAN(TestBasic):
cluster_id, amount=8, network_size=32
)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=16, networks_count=8, timeout=300)
#self.fuel_web.check_fixed_network_cidr(
# cluster_id, self.env.get_ssh_to_remote_by_name('slave-01'))
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_public_vip(cluster_id),
data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
os_conn, smiles_count=16, networks_count=8, timeout=300)
self.fuel_web.verify_network(cluster_id)
self.fuel_web.run_ostf(
@ -113,14 +119,16 @@ class TestHaFlat(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
data = {
'tenant': 'novaHaFlat',
'user': 'novaHaFlat',
'password': 'novaHaFlat'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=DEPLOYMENT_MODE_HA,
settings={
'tenant': 'novaHaFlat',
'user': 'novaHaFlat',
'password': 'novaHaFlat'
}
settings=data
)
self.fuel_web.update_nodes(
cluster_id,
@ -133,8 +141,11 @@ class TestHaFlat(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_public_vip(cluster_id),
data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=16, networks_count=1, timeout=300)
os_conn, smiles_count=16, networks_count=1, timeout=300)
self.fuel_web.verify_network(cluster_id)
@ -186,8 +197,10 @@ class TestHaFlatAddCompute(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_public_vip(cluster_id))
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=16, networks_count=1, timeout=300)
os_conn, smiles_count=16, networks_count=1, timeout=300)
self.env.bootstrap_nodes(self.env.nodes().slaves[5:6])
self.fuel_web.update_nodes(
@ -296,8 +309,10 @@ class BackupRestoreHa(TestBasic):
self.env.revert_snapshot("deploy_ha_flat")
cluster_id = self.fuel_web.get_last_created_cluster()
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_public_vip(cluster_id))
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=16, networks_count=1, timeout=300)
os_conn, smiles_count=16, networks_count=1, timeout=300)
self.fuel_web.backup_master(self.env.get_admin_remote())
checkers.backup_check(self.env.get_admin_remote())
self.env.bootstrap_nodes(self.env.nodes().slaves[5:6])

View File

@ -23,6 +23,7 @@ from proboscis.asserts import assert_equal
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers.common import Common
from fuelweb_test.helpers.decorators import log_snapshot_on_error
from fuelweb_test.helpers import os_actions
from fuelweb_test import settings
from fuelweb_test import logger as LOGGER
from fuelweb_test.tests.base_test_case import SetupEnvironment
@ -86,15 +87,17 @@ class SaharaSimple(TestBasic):
'slave-02': ['compute']
}
)
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
os_conn = os_actions.OpenStackActions(
controller['ip'], data['user'], data['password'], data['tenant'])
self.fuel_web.deploy_cluster_wait(cluster_id)
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=5, networks_count=1, timeout=300)
os_conn, smiles_count=5, networks_count=1, timeout=300)
checkers.verify_service(
self.env.get_ssh_to_remote_by_name("slave-01"),
service_name='sahara-api')
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
common_func = Common(controller['ip'], data['user'], data['password'],
data['tenant'])
@ -186,15 +189,20 @@ class SaharaHA(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
cluster_vip = self.fuel_web.get_public_vip(cluster_id)
os_conn = os_actions.OpenStackActions(
cluster_vip, data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=13, networks_count=1, timeout=300)
os_conn, smiles_count=13, networks_count=1, timeout=300)
for slave in ["slave-01", "slave-02", "slave-03"]:
checkers.verify_service(
self.env.get_ssh_to_remote_by_name(slave),
service_name='sahara-api')
cluster_vip = self.fuel_web.get_public_vip(cluster_id)
common_func = Common(cluster_vip, data['user'], data['password'],
data['tenant'])
@ -283,14 +291,17 @@ class MuranoSimple(TestBasic):
'slave-02': ['compute']
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
os_conn = os_actions.OpenStackActions(
controller['ip'], data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=5, networks_count=1, timeout=300)
os_conn, smiles_count=5, networks_count=1, timeout=300)
checkers.verify_service(
self.env.get_ssh_to_remote_by_name("slave-01"),
service_name='murano-api')
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
common_func = Common(controller['ip'], data['user'], data['password'],
data['tenant'])
@ -404,14 +415,16 @@ class MuranoHA(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
cluster_vip = self.fuel_web.get_public_vip(cluster_id)
os_conn = os_actions.OpenStackActions(
cluster_vip, data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=13, networks_count=1, timeout=300)
os_conn, smiles_count=13, networks_count=1, timeout=300)
for slave in ["slave-01", "slave-02", "slave-03"]:
checkers.verify_service(
self.env.get_ssh_to_remote_by_name(slave),
service_name='murano-api')
cluster_vip = self.fuel_web.get_public_vip(cluster_id)
common_func = Common(cluster_vip, data['user'], data['password'],
data['tenant'])
@ -775,14 +788,16 @@ class HeatSimple(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
os_conn = os_actions.OpenStackActions(
controller['ip'], data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=5, networks_count=1, timeout=300)
os_conn, smiles_count=5, networks_count=1, timeout=300)
checkers.verify_service(
self.env.get_ssh_to_remote_by_name("slave-01"),
service_name='heat-api', count=3)
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
common_func = Common(controller['ip'],
data['user'],
data['password'],
@ -864,14 +879,16 @@ class HeatSimple(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
os_conn = os_actions.OpenStackActions(
controller['ip'], data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
checkers.verify_service(
self.env.get_ssh_to_remote_by_name("slave-01"),
service_name='heat-api', count=3)
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
common_func = Common(controller['ip'],
data['user'],
data['password'],
@ -965,16 +982,17 @@ class HeatHA(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
cluster_vip = self.fuel_web.get_public_vip(cluster_id)
os_conn = os_actions.OpenStackActions(
cluster_vip, data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=13, networks_count=1, timeout=300)
os_conn, smiles_count=13, networks_count=1, timeout=300)
for slave in ["slave-01", "slave-02", "slave-03"]:
checkers.verify_service(
self.env.get_ssh_to_remote_by_name(slave),
service_name='heat-api', count=3)
cluster_vip = self.fuel_web.get_public_vip(cluster_id)
common_func = Common(cluster_vip,
data['user'],
data['password'],

View File

@ -60,8 +60,10 @@ class OneNodeDeploy(TestBasic):
{'slave-01': ['controller']}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
os_conn = os_actions.OpenStackActions(controller['ip'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=4, networks_count=1, timeout=300)
os_conn, smiles_count=4, networks_count=1, timeout=300)
self.fuel_web.run_single_ostf_test(
cluster_id=cluster_id, test_sets=['sanity'],
test_name=('fuel_health.tests.sanity.test_sanity_identity'
@ -92,14 +94,17 @@ class SimpleFlat(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
data = {
'tenant': 'novaSimpleFlat',
'user': 'novaSimpleFlat',
'password': 'novaSimpleFlat'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=DEPLOYMENT_MODE_SIMPLE,
settings={
'tenant': 'novaSimpleFlat',
'user': 'novaSimpleFlat',
'password': 'novaSimpleFlat'
}
settings=data
)
self.fuel_web.update_nodes(
cluster_id,
@ -110,8 +115,11 @@ class SimpleFlat(TestBasic):
)
self.fuel_web.update_internal_network(cluster_id, '10.1.0.0/24')
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'],
data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
self.fuel_web.check_fixed_network_cidr(
cluster_id, self.env.get_ssh_to_remote_by_name('slave-01'))
@ -219,8 +227,10 @@ class SimpleFlat(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
ebtables = self.env.get_ebtables(
cluster_id, self.env.nodes().slaves[:2])
@ -256,14 +266,17 @@ class SimpleFlat(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
data = {
'tenant': 'flatAddCompute',
'user': 'flatAddCompute',
'password': 'flatAddCompute'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=DEPLOYMENT_MODE_SIMPLE,
settings={
'tenant': 'flatAddCompute',
'user': 'flatAddCompute',
'password': 'flatAddCompute'
}
settings=data
)
self.fuel_web.update_nodes(
cluster_id,
@ -273,8 +286,11 @@ class SimpleFlat(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'],
data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
self.fuel_web.update_nodes(
cluster_id, {'slave-03': ['compute']}, True, False)
@ -284,7 +300,7 @@ class SimpleFlat(TestBasic):
3, len(self.fuel_web.client.list_cluster_nodes(cluster_id)))
self.fuel_web.assert_cluster_ready(
"slave-01", smiles_count=8, networks_count=1, timeout=300)
os_conn, smiles_count=8, networks_count=1, timeout=300)
self.env.verify_node_service_list("slave-02", 8)
self.env.verify_node_service_list("slave-03", 8)
@ -318,14 +334,16 @@ class SimpleVlan(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
data = {
'tenant': 'novaSimpleVlan',
'user': 'novaSimpleVlan',
'password': 'novaSimpleVlan'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=DEPLOYMENT_MODE_SIMPLE,
settings={
'tenant': 'novaSimpleVlan',
'user': 'novaSimpleVlan',
'password': 'novaSimpleVlan'
}
settings=data
)
self.fuel_web.update_nodes(
cluster_id,
@ -334,11 +352,17 @@ class SimpleVlan(TestBasic):
'slave-02': ['compute']
}
)
self.fuel_web.update_vlan_network_fixed(
cluster_id, amount=8, network_size=32)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'],
data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=8, timeout=300)
os_conn, smiles_count=6, networks_count=8, timeout=300)
self.fuel_web.verify_network(cluster_id)
@ -369,14 +393,16 @@ class MultiroleControllerCinder(TestBasic):
"""
self.env.revert_snapshot("ready_with_3_slaves")
data = {
'tenant': 'multirolecinder',
'user': 'multirolecinder',
'password': 'multirolecinder'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=DEPLOYMENT_MODE_SIMPLE,
settings={
'tenant': 'multirolecinder',
'user': 'multirolecinder',
'password': 'multirolecinder'
}
settings=data
)
self.fuel_web.update_nodes(
cluster_id,
@ -531,8 +557,12 @@ class SimpleCinder(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
self.fuel_web.check_fixed_network_cidr(
cluster_id, self.env.get_ssh_to_remote_by_name('slave-01'))
@ -670,8 +700,11 @@ class NodeDiskSizes(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
self.fuel_web.run_ostf(cluster_id=cluster_id)
@ -863,8 +896,10 @@ class BackupRestoreSimple(TestBasic):
self.env.revert_snapshot("deploy_simple_flat")
cluster_id = self.fuel_web.get_last_created_cluster()
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
self.fuel_web.backup_master(self.env.get_admin_remote())
checkers.backup_check(self.env.get_admin_remote())

View File

@ -21,6 +21,7 @@ from proboscis import SkipTest
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers.decorators import log_snapshot_on_error
from fuelweb_test.helpers.decorators import create_diagnostic_snapshot
from fuelweb_test.helpers import os_actions
from fuelweb_test import settings as hlp_data
from fuelweb_test.tests import base_test_case as base_test_data
@ -72,8 +73,11 @@ class UpgradeFuelMaster(base_test_data.TestBasic):
True, False
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'],
user='ceph1', tenant='ceph1', passwd='ceph1')
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=10, networks_count=1, timeout=300)
os_conn, smiles_count=10, networks_count=1, timeout=300)
self.fuel_web.run_ostf(cluster_id=cluster_id)
create_diagnostic_snapshot(self.env, "pass", "upgrade_simple_env")
@ -128,14 +132,15 @@ class UpgradeFuelMaster(base_test_data.TestBasic):
added_release = [id for id in available_releases_after
if id not in available_releases_before]
self.env.bootstrap_nodes(self.env.nodes().slaves[5:7])
data = {
'tenant': 'novaSimpleVlan',
'user': 'novaSimpleVlan',
'password': 'novaSimpleVlan'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=hlp_data.DEPLOYMENT_MODE_SIMPLE,
settings={
'tenant': 'novaSimpleVlan',
'user': 'novaSimpleVlan',
'password': 'novaSimpleVlan'
},
settings=data,
release_id=added_release[0]
)
self.fuel_web.update_nodes(
@ -147,9 +152,14 @@ class UpgradeFuelMaster(base_test_data.TestBasic):
)
self.fuel_web.update_vlan_network_fixed(
cluster_id, amount=8, network_size=32)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_public_vip(cluster_id),
data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
'slave-06', smiles_count=6, networks_count=8, timeout=300)
os_conn, smiles_count=6, networks_count=8, timeout=300)
self.fuel_web.verify_network(cluster_id)
self.fuel_web.run_ostf(

View File

@ -18,6 +18,7 @@ from proboscis import test
from fuelweb_test.helpers.decorators import log_snapshot_on_error
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers import http
from fuelweb_test.helpers import os_actions
from fuelweb_test import settings as hlp
from fuelweb_test.tests.base_test_case import SetupEnvironment
from fuelweb_test.tests.base_test_case import TestBasic
@ -85,8 +86,10 @@ class SimpleZabbix(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'])
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
self.fuel_web.verify_network(cluster_id)

View File

@ -24,6 +24,7 @@ from proboscis import SkipTest
from fuelweb_test.helpers.checkers import check_mysql
from fuelweb_test.helpers.decorators import log_snapshot_on_error
from fuelweb_test.helpers import os_actions
from fuelweb_test import logger
from fuelweb_test.settings import DEPLOYMENT_MODE_HA
from fuelweb_test.settings import NEUTRON_SEGMENT_TYPE
@ -82,12 +83,14 @@ class TestHaFailover(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
public_vip = self.fuel_web.get_public_vip(cluster_id)
os_conn = os_actions.OpenStackActions(public_vip)
if NEUTRON_ENABLE:
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=14, networks_count=1, timeout=300)
os_conn, smiles_count=14, networks_count=1, timeout=300)
else:
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=16, networks_count=1, timeout=300)
os_conn, smiles_count=16, networks_count=1, timeout=300)
self.fuel_web.verify_network(cluster_id)
# Bug #1289297. Pause 5 min to make sure that all remain activity

View File

@ -16,6 +16,7 @@ from proboscis.asserts import assert_equal
from proboscis import test
from fuelweb_test.helpers import common
from fuelweb_test.helpers import os_actions
from fuelweb_test import settings
from fuelweb_test import logger
from fuelweb_test.tests import base_test_case
@ -57,17 +58,18 @@ class DeploySimpleMasterNodeFail(base_test_case.TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
controller_ip = self.fuel_web.get_nailgun_node_by_name(
'slave-01')['ip']
os_conn = os_actions.OpenStackActions(controller_ip)
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=6, networks_count=1, timeout=300)
os_conn, smiles_count=6, networks_count=1, timeout=300)
self.fuel_web.verify_network(cluster_id)
logger.info('PASS DEPLOYMENT')
self.fuel_web.run_ostf(
cluster_id=cluster_id)
logger.info('PASS OSTF')
logger.info('Get controller ip')
controller_ip = self.fuel_web.get_nailgun_node_by_name(
'slave-01')['ip']
logger.info('Destroy admin node...')
self.env.nodes().admin.destroy()
logger.info('Admin node destroyed')