Fix tests and flake8 issues.
-fix flake8 issues -fix smoke test -fix dvs_vcenter_security test Change-Id: If10cfb5f26aa386cee034335af6a6bc1648d3cad
This commit is contained in:
parent
3362afb42b
commit
5b65862cdc
@ -1,20 +1,22 @@
|
|||||||
# Copyright (c) 2015 Cloudbase Solutions.
|
"""Copyright 2015 Mirantis, Inc.
|
||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
# not use this file except in compliance with the License. You may obtain
|
|
||||||
# a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
|
|
||||||
import neutron.plugins.ml2.drivers.vmware_dvs.agent.dvs_neutron_agent as agent_main
|
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
not use this file except in compliance with the License. You may obtain
|
||||||
|
copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
License for the specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import neutron.plugins.ml2.drivers.vmware_dvs.agent.dvs_neutron_agent\
|
||||||
|
as agent_main
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
"""TODO."""
|
||||||
agent_main.main()
|
agent_main.main()
|
||||||
|
@ -1,4 +1,19 @@
|
|||||||
# -*- coding: utf-8 -*-
|
"""Copyright 2016 Mirantis, Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
not use this file except in compliance with the License. You may obtain
|
||||||
|
copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
License for the specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*- # noqa
|
||||||
#
|
#
|
||||||
# Fuel VMware DVS plugin documentation build configuration file, created by
|
# Fuel VMware DVS plugin documentation build configuration file, created by
|
||||||
# sphinx-quickstart on Fri Aug 14 12:14:29 2015.
|
# sphinx-quickstart on Fri Aug 14 12:14:29 2015.
|
||||||
@ -12,23 +27,21 @@
|
|||||||
# All configuration values have a default; values that are commented out
|
# All configuration values have a default; values that are commented out
|
||||||
# serve to show the default.
|
# serve to show the default.
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
#sys.path.insert(0, os.path.abspath('.'))
|
# sys.path.insert(0, os.path.abspath('.'))
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
#needs_sphinx = '1.0'
|
# needs_sphinx = '1.0'
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [ ]
|
extensions = []
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ['_templates']
|
||||||
@ -37,14 +50,14 @@ templates_path = ['_templates']
|
|||||||
source_suffix = '.rst'
|
source_suffix = '.rst'
|
||||||
|
|
||||||
# The encoding of source files.
|
# The encoding of source files.
|
||||||
#source_encoding = 'utf-8-sig'
|
# source_encoding = 'utf-8-sig'
|
||||||
|
|
||||||
# The master toctree document.
|
# The master toctree document.
|
||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Fuel VMware DVS plugin'
|
project = u'Fuel VMware DVS plugin'
|
||||||
copyright = u'2015, Mirantis Inc.'
|
copyright = u'2015, Mirantis Inc.' # noqa
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
@ -57,41 +70,41 @@ release = '2.1.0'
|
|||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
#language = None
|
# language = None
|
||||||
|
|
||||||
# There are two options for replacing |today|: either, you set today to some
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
# non-false value, then it is used:
|
# non-false value, then it is used:
|
||||||
#today = ''
|
# today = ''
|
||||||
# Else, today_fmt is used as the format for a strftime call.
|
# Else, today_fmt is used as the format for a strftime call.
|
||||||
#today_fmt = '%B %d, %Y'
|
# today_fmt = '%B %d, %Y'
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
#exclude_patterns = []
|
# exclude_patterns = []
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all
|
# The reST default role (used for this markup: `text`) to use for all
|
||||||
# documents.
|
# documents.
|
||||||
#default_role = None
|
# default_role = None
|
||||||
|
|
||||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||||
#add_function_parentheses = True
|
# add_function_parentheses = True
|
||||||
|
|
||||||
# If true, the current module name will be prepended to all description
|
# If true, the current module name will be prepended to all description
|
||||||
# unit titles (such as .. function::).
|
# unit titles (such as .. function::).
|
||||||
#add_module_names = True
|
# add_module_names = True
|
||||||
|
|
||||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||||
# output. They are ignored by default.
|
# output. They are ignored by default.
|
||||||
#show_authors = False
|
# show_authors = False
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
pygments_style = 'sphinx'
|
pygments_style = 'sphinx'
|
||||||
|
|
||||||
# A list of ignored prefixes for module index sorting.
|
# A list of ignored prefixes for module index sorting.
|
||||||
#modindex_common_prefix = []
|
# modindex_common_prefix = []
|
||||||
|
|
||||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||||
#keep_warnings = False
|
# keep_warnings = False
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output ----------------------------------------------
|
# -- Options for HTML output ----------------------------------------------
|
||||||
@ -103,77 +116,77 @@ html_theme = 'default'
|
|||||||
# Theme options are theme-specific and customize the look and feel of a theme
|
# Theme options are theme-specific and customize the look and feel of a theme
|
||||||
# further. For a list of options available for each theme, see the
|
# further. For a list of options available for each theme, see the
|
||||||
# documentation.
|
# documentation.
|
||||||
#html_theme_options = {}
|
# html_theme_options = {}
|
||||||
|
|
||||||
# Add any paths that contain custom themes here, relative to this directory.
|
# Add any paths that contain custom themes here, relative to this directory.
|
||||||
#html_theme_path = []
|
# html_theme_path = []
|
||||||
|
|
||||||
# The name for this set of Sphinx documents. If None, it defaults to
|
# The name for this set of Sphinx documents. If None, it defaults to
|
||||||
# "<project> v<release> documentation".
|
# "<project> v<release> documentation".
|
||||||
#html_title = None
|
# html_title = None
|
||||||
|
|
||||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||||
#html_short_title = None
|
# html_short_title = None
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top
|
# The name of an image file (relative to this directory) to place at the top
|
||||||
# of the sidebar.
|
# of the sidebar.
|
||||||
#html_logo = None
|
# html_logo = None
|
||||||
|
|
||||||
# The name of an image file (within the static path) to use as favicon of the
|
# The name of an image file (within the static path) to use as favicon of the
|
||||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||||
# pixels large.
|
# pixels large.
|
||||||
#html_favicon = None
|
# html_favicon = None
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
#html_static_path = ['_static']
|
# html_static_path = ['_static']
|
||||||
|
|
||||||
# Add any extra paths that contain custom files (such as robots.txt or
|
# Add any extra paths that contain custom files (such as robots.txt or
|
||||||
# .htaccess) here, relative to this directory. These files are copied
|
# .htaccess) here, relative to this directory. These files are copied
|
||||||
# directly to the root of the documentation.
|
# directly to the root of the documentation.
|
||||||
#html_extra_path = []
|
# html_extra_path = []
|
||||||
|
|
||||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||||
# using the given strftime format.
|
# using the given strftime format.
|
||||||
#html_last_updated_fmt = '%b %d, %Y'
|
# html_last_updated_fmt = '%b %d, %Y'
|
||||||
|
|
||||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||||
# typographically correct entities.
|
# typographically correct entities.
|
||||||
#html_use_smartypants = True
|
# html_use_smartypants = True
|
||||||
|
|
||||||
# Custom sidebar templates, maps document names to template names.
|
# Custom sidebar templates, maps document names to template names.
|
||||||
#html_sidebars = {}
|
# html_sidebars = {}
|
||||||
|
|
||||||
# Additional templates that should be rendered to pages, maps page names to
|
# Additional templates that should be rendered to pages, maps page names to
|
||||||
# template names.
|
# template names.
|
||||||
#html_additional_pages = {}
|
# html_additional_pages = {}
|
||||||
|
|
||||||
# If false, no module index is generated.
|
# If false, no module index is generated.
|
||||||
#html_domain_indices = True
|
# html_domain_indices = True
|
||||||
|
|
||||||
# If false, no index is generated.
|
# If false, no index is generated.
|
||||||
#html_use_index = True
|
# html_use_index = True
|
||||||
|
|
||||||
# If true, the index is split into individual pages for each letter.
|
# If true, the index is split into individual pages for each letter.
|
||||||
#html_split_index = False
|
# html_split_index = False
|
||||||
|
|
||||||
# If true, links to the reST sources are added to the pages.
|
# If true, links to the reST sources are added to the pages.
|
||||||
#html_show_sourcelink = True
|
# html_show_sourcelink = True
|
||||||
|
|
||||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||||
#html_show_sphinx = True
|
# html_show_sphinx = True
|
||||||
|
|
||||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||||
#html_show_copyright = True
|
# html_show_copyright = True
|
||||||
|
|
||||||
# If true, an OpenSearch description file will be output, and all pages will
|
# If true, an OpenSearch description file will be output, and all pages will
|
||||||
# contain a <link> tag referring to it. The value of this option must be the
|
# contain a <link> tag referring to it. The value of this option must be the
|
||||||
# base URL from which the finished HTML is served.
|
# base URL from which the finished HTML is served.
|
||||||
#html_use_opensearch = ''
|
# html_use_opensearch = ''
|
||||||
|
|
||||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||||
#html_file_suffix = None
|
# html_file_suffix = None
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
# Output file base name for HTML help builder.
|
||||||
htmlhelp_basename = 'FuelVMwareDVSplugindoc'
|
htmlhelp_basename = 'FuelVMwareDVSplugindoc'
|
||||||
@ -181,36 +194,37 @@ htmlhelp_basename = 'FuelVMwareDVSplugindoc'
|
|||||||
|
|
||||||
# -- Options for LaTeX output ---------------------------------------------
|
# -- Options for LaTeX output ---------------------------------------------
|
||||||
|
|
||||||
latex_elements = { 'classoptions': ',openany,oneside', 'babel': '\\usepackage[english]{babel}'
|
latex_elements = {
|
||||||
|
'classoptions': ',openany,oneside', 'babel': '\\usepackage[english]{babel}'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'FuelVMwareDVSvplugin.tex', u'Fuel VMware DVS plugin user\
|
('index', 'FuelVMwareDVSvplugin.tex', u'Fuel VMware DVS plugin user\
|
||||||
guide', u'Mirantis Inc.', 'manual'),
|
guide', u'Mirantis Inc.', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
# the title page.
|
# the title page.
|
||||||
#latex_logo = None
|
# latex_logo = None
|
||||||
|
|
||||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||||
# not chapters.
|
# not chapters.
|
||||||
#latex_use_parts = False
|
# latex_use_parts = False
|
||||||
|
|
||||||
# If true, show page references after internal links.
|
# If true, show page references after internal links.
|
||||||
#latex_show_pagerefs = False
|
# latex_show_pagerefs = False
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
#latex_show_urls = False
|
# latex_show_urls = False
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
# Documents to append as an appendix to all manuals.
|
||||||
#latex_appendices = []
|
# latex_appendices = []
|
||||||
|
|
||||||
# If false, no module index is generated.
|
# If false, no module index is generated.
|
||||||
#latex_domain_indices = True
|
# latex_domain_indices = True
|
||||||
|
|
||||||
|
|
||||||
# -- Options for manual page output ---------------------------------------
|
# -- Options for manual page output ---------------------------------------
|
||||||
@ -223,7 +237,7 @@ man_pages = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
#man_show_urls = False
|
# man_show_urls = False
|
||||||
|
|
||||||
|
|
||||||
# -- Options for Texinfo output -------------------------------------------
|
# -- Options for Texinfo output -------------------------------------------
|
||||||
@ -232,22 +246,22 @@ man_pages = [
|
|||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
('index', 'FuelVMwareDVSplugin', u'Fuel VMware DVS plugin user\
|
('index', 'FuelVMwareDVSplugin', u'Fuel VMware DVS plugin user guide',
|
||||||
guide', u'Mirantis Inc.', 'FuelVMwareDVSplugin',\
|
u'Mirantis Inc.', 'FuelVMwareDVSplugin',
|
||||||
'One line description of project.', 'Miscellaneous'),
|
'One line description of project.', 'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
# Documents to append as an appendix to all manuals.
|
||||||
#texinfo_appendices = []
|
# texinfo_appendices = []
|
||||||
|
|
||||||
# If false, no module index is generated.
|
# If false, no module index is generated.
|
||||||
#texinfo_domain_indices = True
|
# texinfo_domain_indices = True
|
||||||
|
|
||||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||||
#texinfo_show_urls = 'footnote'
|
# texinfo_show_urls = 'footnote'
|
||||||
|
|
||||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||||
#texinfo_no_detailmenu = False
|
# texinfo_no_detailmenu = False
|
||||||
|
|
||||||
# Insert footnotes where they are defined instead of at the end.
|
# Insert footnotes where they are defined instead of at the end.
|
||||||
pdf_inline_footnotes = True
|
pdf_inline_footnotes = True
|
||||||
|
@ -26,7 +26,6 @@ from fuelweb_test.settings import SERVTEST_TENANT
|
|||||||
from fuelweb_test.settings import SERVTEST_USERNAME
|
from fuelweb_test.settings import SERVTEST_USERNAME
|
||||||
|
|
||||||
from fuelweb_test.tests.base_test_case import TestBasic
|
from fuelweb_test.tests.base_test_case import TestBasic
|
||||||
from tests.test_plugin_vmware_dvs_smoke import TestDVSSmoke
|
|
||||||
|
|
||||||
from helpers import openstack
|
from helpers import openstack
|
||||||
|
|
||||||
@ -34,6 +33,8 @@ from proboscis import test
|
|||||||
|
|
||||||
from proboscis.asserts import assert_true
|
from proboscis.asserts import assert_true
|
||||||
|
|
||||||
|
from tests.test_plugin_vmware_dvs_smoke import TestDVSSmoke
|
||||||
|
|
||||||
|
|
||||||
@test(groups=["plugins"])
|
@test(groups=["plugins"])
|
||||||
class TestDVSMaintenance(TestBasic):
|
class TestDVSMaintenance(TestBasic):
|
||||||
|
@ -245,7 +245,8 @@ class TestDVSSmoke(TestBasic):
|
|||||||
cmd = 'fuel plugins --remove {0}=={1}'.format(
|
cmd = 'fuel plugins --remove {0}=={1}'.format(
|
||||||
plugin.plugin_name, plugin.DVS_PLUGIN_VERSION)
|
plugin.plugin_name, plugin.DVS_PLUGIN_VERSION)
|
||||||
|
|
||||||
assert_true(self.env.d_env.get_admin_remote().execute(cmd) == 0,
|
assert_true(
|
||||||
|
self.env.d_env.get_admin_remote().execute(cmd)['exit_code'] == 0,
|
||||||
'Can not remove plugin.')
|
'Can not remove plugin.')
|
||||||
|
|
||||||
self.show_step(3)
|
self.show_step(3)
|
||||||
|
@ -462,7 +462,7 @@ class TestDVSSystem(TestBasic):
|
|||||||
subnet = os_conn.create_subnet(
|
subnet = os_conn.create_subnet(
|
||||||
subnet_name=network['name'],
|
subnet_name=network['name'],
|
||||||
network_id=network['id'],
|
network_id=network['id'],
|
||||||
cidr=self.net_data[0][self.net_data[0].keys()[0]],
|
cidr=self.net_data[0]['net_1'],
|
||||||
ip_version=4)
|
ip_version=4)
|
||||||
|
|
||||||
logger.info("Check that network are created.")
|
logger.info("Check that network are created.")
|
||||||
@ -493,7 +493,12 @@ class TestDVSSystem(TestBasic):
|
|||||||
)
|
)
|
||||||
openstack.verify_instance_state(os_conn)
|
openstack.verify_instance_state(os_conn)
|
||||||
|
|
||||||
|
# Remove default security group
|
||||||
srv_list = os_conn.get_servers()
|
srv_list = os_conn.get_servers()
|
||||||
|
for srv in srv_list:
|
||||||
|
srv.remove_security_group(srv.security_groups[0]['name'])
|
||||||
|
os_conn.goodbye_security()
|
||||||
|
|
||||||
self.show_step(5)
|
self.show_step(5)
|
||||||
sec_name = ['SG1', 'SG2']
|
sec_name = ['SG1', 'SG2']
|
||||||
sg1 = os_conn.nova.security_groups.create(
|
sg1 = os_conn.nova.security_groups.create(
|
||||||
@ -509,11 +514,8 @@ class TestDVSSystem(TestBasic):
|
|||||||
icmp["security_group_rule"]["security_group_id"] = sg2.id
|
icmp["security_group_rule"]["security_group_id"] = sg2.id
|
||||||
os_conn.neutron.create_security_group_rule(icmp)
|
os_conn.neutron.create_security_group_rule(icmp)
|
||||||
|
|
||||||
logger.info("""Remove default security group
|
logger.info("""Attach SG_1 and SG2 to instances""")
|
||||||
and attach SG_1 and SG2 to instances""")
|
|
||||||
srv_list = os_conn.get_servers()
|
|
||||||
for srv in srv_list:
|
for srv in srv_list:
|
||||||
srv.remove_security_group(srv.security_groups[0]['name'])
|
|
||||||
srv.add_security_group(sg1.id)
|
srv.add_security_group(sg1.id)
|
||||||
srv.add_security_group(sg2.id)
|
srv.add_security_group(sg2.id)
|
||||||
|
|
||||||
@ -529,98 +531,82 @@ class TestDVSSystem(TestBasic):
|
|||||||
os_conn, floating_ip, remote=ssh_contr,
|
os_conn, floating_ip, remote=ssh_contr,
|
||||||
command='pingv4')
|
command='pingv4')
|
||||||
|
|
||||||
self.show_step(10)
|
self.show_step(10)
|
||||||
ip_pair = [(ip_1, ip_2)
|
ip_pair = [(ip_1, ip_2)
|
||||||
for ip_1 in floating_ip
|
for ip_1 in floating_ip
|
||||||
for ip_2 in floating_ip
|
for ip_2 in floating_ip
|
||||||
if ip_1 != ip_2]
|
if ip_1 != ip_2]
|
||||||
|
|
||||||
for ips in ip_pair:
|
for ips in ip_pair:
|
||||||
openstack.remote_execute_command(ips[0], ips[1], ' ')
|
openstack.remote_execute_command(ips[0], ips[1], ' ')
|
||||||
|
|
||||||
self.show_step(11)
|
self.show_step(11)
|
||||||
sg_rules = os_conn.neutron.list_security_group_rules()[
|
sg_rules = os_conn.neutron.list_security_group_rules()[
|
||||||
'security_group_rules']
|
|
||||||
sg_rules = [
|
|
||||||
sg_rule for sg_rule
|
|
||||||
in os_conn.neutron.list_security_group_rules()[
|
|
||||||
'security_group_rules']
|
'security_group_rules']
|
||||||
if sg_rule['security_group_id'] in [sg1.id, sg2.id]]
|
sg_rules = [
|
||||||
for rule in sg_rules:
|
sg_rule for sg_rule
|
||||||
os_conn.neutron.delete_security_group_rule(rule['id'])
|
in os_conn.neutron.list_security_group_rules()[
|
||||||
|
'security_group_rules']
|
||||||
|
if sg_rule['security_group_id'] in [sg1.id, sg2.id]]
|
||||||
|
for rule in sg_rules:
|
||||||
|
os_conn.neutron.delete_security_group_rule(rule['id'])
|
||||||
|
|
||||||
time.sleep(20) # need wait to update rules on dvs
|
self.show_step(12)
|
||||||
|
for ip in floating_ip:
|
||||||
|
try:
|
||||||
|
openstack.get_ssh_connection(
|
||||||
|
ip, self.instance_creds[0],
|
||||||
|
self.instance_creds[1])
|
||||||
|
except Exception as e:
|
||||||
|
logger.info('{}'.format(e))
|
||||||
|
|
||||||
self.show_step(12)
|
self.show_step(13)
|
||||||
for ip in floating_ip:
|
tcp["security_group_rule"]["security_group_id"] = sg2.id
|
||||||
try:
|
os_conn.neutron.create_security_group_rule(tcp)
|
||||||
openstack.get_ssh_connection(
|
tcp["security_group_rule"]["direction"] = "egress"
|
||||||
ip, self.instance_creds[0],
|
os_conn.neutron.create_security_group_rule(tcp)
|
||||||
self.instance_creds[1])
|
|
||||||
except Exception as e:
|
|
||||||
logger.info('{}'.format(e))
|
|
||||||
|
|
||||||
self.show_step(13)
|
self.show_step(14)
|
||||||
tcp["security_group_rule"]["security_group_id"] = sg2.id
|
for ips in ip_pair:
|
||||||
os_conn.neutron.create_security_group_rule(tcp)
|
wait(
|
||||||
tcp["security_group_rule"]["direction"] = "egress"
|
lambda: openstack.remote_execute_command(
|
||||||
os_conn.neutron.create_security_group_rule(tcp)
|
ips[0], ips[1], ' '), timeout=30, interval=5)
|
||||||
|
|
||||||
time.sleep(20) # need wait to update rules on dvs ports
|
self.show_step(15)
|
||||||
|
|
||||||
self.show_step(14)
|
|
||||||
for ips in ip_pair:
|
|
||||||
openstack.remote_execute_command(ips[0], ips[1], ' ')
|
|
||||||
|
|
||||||
self.show_step(15)
|
|
||||||
with self.fuel_web.get_ssh_for_node(controller.name) as ssh_contr:
|
|
||||||
openstack.check_connection_vms(
|
openstack.check_connection_vms(
|
||||||
os_conn, floating_ip, remote=ssh_contr,
|
os_conn, floating_ip, remote=ssh_contr,
|
||||||
command='pingv4', result_of_command=1)
|
command='pingv4', result_of_command=1)
|
||||||
|
|
||||||
self.show_step(16)
|
self.show_step(16)
|
||||||
logger.info("Add Ingress and egress rules for ICMP protocol to SG_1")
|
icmp["security_group_rule"]["security_group_id"] = sg1.id
|
||||||
icmp["security_group_rule"]["security_group_id"] = sg1.id
|
os_conn.neutron.create_security_group_rule(icmp)
|
||||||
os_conn.neutron.create_security_group_rule(icmp)
|
icmp["security_group_rule"]["direction"] = "egress"
|
||||||
icmp["security_group_rule"]["direction"] = "egress"
|
os_conn.neutron.create_security_group_rule(icmp)
|
||||||
os_conn.neutron.create_security_group_rule(icmp)
|
|
||||||
|
|
||||||
time.sleep(20) # need wait to update rules on dvs ports
|
time.sleep(30) # need wait to update rules on dvs ports
|
||||||
|
self.show_step(17)
|
||||||
self.show_step(17)
|
|
||||||
with self.fuel_web.get_ssh_for_node(controller.name) as ssh_contr:
|
|
||||||
openstack.check_connection_vms(
|
openstack.check_connection_vms(
|
||||||
os_conn, floating_ip, remote=ssh_contr,
|
os_conn, floating_ip, remote=ssh_contr,
|
||||||
command='pingv4')
|
command='pingv4')
|
||||||
|
|
||||||
self.show_step(21)
|
self.show_step(21)
|
||||||
self.show_step(22)
|
srv_list = os_conn.get_servers()
|
||||||
srv_list = os_conn.get_servers()
|
for srv in srv_list:
|
||||||
for srv in srv_list:
|
for sg in srv.security_groups:
|
||||||
for sg in srv.security_groups:
|
srv.remove_security_group(sg['name'])
|
||||||
srv.remove_security_group(sg['name'])
|
self.show_step(22)
|
||||||
srv.add_security_group('default')
|
for srv in srv_list:
|
||||||
# need add tcp rule for ssh to instances
|
srv.add_security_group('default')
|
||||||
tcp["security_group_rule"]["security_group_id"] = \
|
|
||||||
[
|
|
||||||
sg['id']
|
|
||||||
for sg in os_conn.neutron.list_security_groups()[
|
|
||||||
'security_groups']
|
|
||||||
if sg['tenant_id'] == os_conn.get_tenant(SERVTEST_TENANT).id
|
|
||||||
if sg['name'] == 'default'][0]
|
|
||||||
tcp["security_group_rule"]["direction"] = "ingress"
|
|
||||||
os_conn.neutron.create_security_group_rule(tcp)
|
|
||||||
time.sleep(20) # need wait to update rules on dvs ports
|
|
||||||
|
|
||||||
self.show_step(23)
|
time.sleep(30) # need wait to update rules on dvs ports
|
||||||
with self.fuel_web.get_ssh_for_node(controller.name) as ssh_contr:
|
self.show_step(23)
|
||||||
openstack.check_connection_vms(
|
openstack.check_connection_vms(
|
||||||
os_conn, floating_ip, remote=ssh_contr,
|
os_conn, floating_ip, remote=ssh_contr,
|
||||||
command='pingv4')
|
command='pingv4')
|
||||||
|
|
||||||
self.show_step(24)
|
self.show_step(24)
|
||||||
for ips in ip_pair:
|
for ips in ip_pair:
|
||||||
openstack.remote_execute_command(ips[0], ips[1], ' ')
|
openstack.remote_execute_command(ips[0], ips[1], ' ')
|
||||||
|
|
||||||
@test(depends_on=[dvs_vcenter_systest_setup],
|
@test(depends_on=[dvs_vcenter_systest_setup],
|
||||||
groups=["dvs_vcenter_tenants_isolation", 'dvs_vcenter_system'])
|
groups=["dvs_vcenter_tenants_isolation", 'dvs_vcenter_system'])
|
||||||
@ -835,7 +821,7 @@ class TestDVSSystem(TestBasic):
|
|||||||
ip_version=4)
|
ip_version=4)
|
||||||
|
|
||||||
self.show_step(8)
|
self.show_step(8)
|
||||||
router = admin.create_router('router_1', tenant=tenant)
|
router = admin.create_router('router_1', tenant=tenant_admin)
|
||||||
admin.add_router_interface(
|
admin.add_router_interface(
|
||||||
router_id=router["id"],
|
router_id=router["id"],
|
||||||
subnet_id=subnet["id"])
|
subnet_id=subnet["id"])
|
||||||
|
Loading…
Reference in New Issue
Block a user