# Allow the retargetable and tempest api tests to be executed as part
-# of the same job by ensuring that tests from both tests are
-# discovered.
+# of the same job by ensuring that tests from both paths are discovered.
def _discover(loader, path, pattern):
loader = unittest.loader.TestLoader()
suite.addTests(_discover(loader, "./neutron/tests/api", pattern))
- # TODO(marun) Remove once the tempest tests have been moved to api/
- suite.addTests(_discover(loader,
- "./neutron/tests/tempest/api/network",
- pattern))
suite.addTests(_discover(loader,
"./neutron/tests/retargetable",
pattern))
# License for the specific language governing permissions and limitations
# under the License.
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest.common import tempest_fixtures as fixtures
from neutron.tests.tempest import test
# License for the specific language governing permissions and limitations
# under the License.
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
-from neutron.tests.api.contrib import clients
+from neutron.tests.api import base
+from neutron.tests.api import clients
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base_routers as base
+from neutron.tests.api import base_routers as base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.api.contrib import clients
+from neutron.tests.api import clients
from neutron.tests.tempest import config
from neutron.tests.tempest import exceptions
import neutron.tests.tempest.test
# License for the specific language governing permissions and limitations
# under the License.
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
class BaseRouterTest(base.BaseAdminNetworkTest):
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
class BaseSecGroupTest(base.BaseNetworkTest):
+++ /dev/null
-This path contains artifacts from tempest that have been modified to
-support the execution of api tests from the neutron tree. These
-artifacts are intended to be a stop-gap to support test migration, and
-it is hoped that changes to tempest and tempest-lib will render it
-unnecessary at some point in the future.
import netaddr
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
# under the License.
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
import netaddr
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import config
from neutron.tests.tempest import exceptions
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from oslo_log import log as logging
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest.common import custom_matchers
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
import netaddr
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base
-from neutron.tests.tempest.api.network import base_security_groups as sec_base
+from neutron.tests.api import base
+from neutron.tests.api import base_security_groups as sec_base
from neutron.tests.tempest.common import custom_matchers
from neutron.tests.tempest import config
from neutron.tests.tempest import test
import netaddr
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base_routers as base
-from neutron.tests.api.contrib import clients
+from neutron.tests.api import base_routers as base
+from neutron.tests.api import clients
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base_routers as base
+from neutron.tests.api import base_routers as base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
import six
from tempest_lib.common.utils import data_utils
-from neutron.tests.tempest.api.network import base_security_groups as base
+from neutron.tests.api import base_security_groups as base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base_security_groups as base
+from neutron.tests.api import base_security_groups as base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
from tempest_lib import decorators
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.tempest.api.network import base
+from neutron.tests.api import base
from neutron.tests.tempest import config
from neutron.tests.tempest import test
WARNING
=======
-The files under this path are maintained automatically by the script
-tools/copy_api_tests_from_tempest.sh. It's contents should not be
-manually modified until further notice.
-
-Note that neutron.tests.tempest.config uses the global cfg.CONF
-instance for now and importing it outside of the api tests has the
-potential to break Neutron's use of cfg.CONF.
+The files under this path were copied from tempest as part of the move
+of the api tests, and they will be removed as the required
+functionality is transitioned from tempest to tempest-lib. While it
+exists, only neutron.tests.api and neutron.tests.retargetable should
+be importing files from this path. neutron.tests.tempest.config uses
+the global cfg.CONF instance and importing it outside of the api tests
+has the potential to break Neutron's use of cfg.CONF.
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
-from neutron.tests.api.contrib import clients
+from neutron.tests.api import clients
from neutron.tests.tempest.common import cred_provider
from neutron.tests.tempest import config
from neutron.tests.tempest import exceptions
import testscenarios
import testtools
-from neutron.tests.api.contrib import clients
+from neutron.tests.api import clients
from neutron.tests.tempest.common import credentials
import neutron.tests.tempest.common.generator.valid_generator as valid
from neutron.tests.tempest import config
exit 1
fi
-NEUTRON_PATH=${NEUTRON_PATH:-$(cd $(dirname "$0")/.. && pwd)}
+NEUTRON_PATH=${NEUTRON_PATH:-$(cd "$(dirname "$0")/.." && pwd)}
NEUTRON_TEST_PATH=$NEUTRON_PATH/neutron/tests
function copy_files {
local tempest_dep_paths=(
'tempest'
- 'tempest/api/network'
- 'tempest/api/network/admin'
'tempest/common'
'tempest/common/generator'
'tempest/common/utils'
for tempest_dep_path in ${tempest_dep_paths[@]}; do
local target_path=$NEUTRON_TEST_PATH/$tempest_dep_path
if [[ ! -d "$target_path" ]]; then
- mkdir -p $target_path
+ mkdir -p "$target_path"
fi
- cp $TEMPEST_PATH/$tempest_dep_path/*.py $target_path
+ cp $TEMPEST_PATH/$tempest_dep_path/*.py "$target_path"
done
- touch $NEUTRON_TEST_PATH/tempest/api/__init__.py
-
local paths_to_remove=(
"$NEUTRON_TEST_PATH/tempest/clients.py"
)
for path_to_remove in ${paths_to_remove[@]}; do
if [ -f "$path_to_remove" ]; then
- rm ${path_to_remove}
+ rm "$path_to_remove"
fi
done
+
+ # Tests are now maintained in neutron/tests/api
+ cp $TEMPEST_PATH/tempest/api/network/*.py $NEUTRON_TEST_PATH/api
+ cp $TEMPEST_PATH/tempest/api/network/admin/*.py \
+ $NEUTRON_TEST_PATH/api/admin
}
function rewrite_imports {
regexes=(
's/tempest.common.generator/neutron.tests.tempest.common.generator/'
+ "s/tempest.api.network/neutron.tests.api/"
's/tempest.test/neutron.tests.tempest.test/'
's/from tempest.openstack.common import lockutils/from oslo_concurrency import lockutils/'
's/from tempest.openstack.common import importutils/from oslo_utils import importutils/'
's/tempest.openstack.common/neutron.openstack.common/'
- 's/from tempest(?!_lib) import clients/from neutron.tests.api.contrib import clients/'
+ 's/from tempest(?!_lib) import clients/from neutron.tests.api import clients/'
's/from tempest(?!_lib)/from neutron.tests.tempest/'
's/CONF.lock_path/CONF.oslo_concurrency.lock_path/'
)
- files=$(find $NEUTRON_TEST_PATH/tempest -name '*.py')
+ files=$(find "$NEUTRON_TEST_PATH/tempest" "$NEUTRON_TEST_PATH/api" -name '*.py')
for ((i = 0; i < ${#regexes[@]}; i++)); do
perl -p -i -e "${regexes[$i]}" $files
done