Start to introduce tempest tests.
See if gate job executes first test. Change-Id: Ife68257a4c281299cedc4ed79db50ca5290375c5
This commit is contained in:
parent
e4c1f0e026
commit
219fb2b4d7
@ -26,3 +26,6 @@ FREEZER_REPO=${FREEZER_REPO:-${GIT_BASE}/openstack/freezer.git}
|
||||
FREEZER_BRANCH=${FREEZER_BRANCH:-master}
|
||||
|
||||
enable_service freezer
|
||||
|
||||
# Tell Tempest this project is present
|
||||
TEMPEST_SERVICES+=,freezer
|
||||
|
@ -182,3 +182,7 @@ def main():
|
||||
freezer_main(backup_args)
|
||||
except Exception as err:
|
||||
return fail(1, err, backup_args.quiet)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
sys.exit(main())
|
||||
|
6
freezer/tests/freezer_tempest_plugin/README.rst
Normal file
6
freezer/tests/freezer_tempest_plugin/README.rst
Normal file
@ -0,0 +1,6 @@
|
||||
===============================================
|
||||
Tempest Integration of Freezer
|
||||
===============================================
|
||||
|
||||
This directory contains Tempest tests to cover the freezer project.
|
||||
|
0
freezer/tests/freezer_tempest_plugin/__init__.py
Normal file
0
freezer/tests/freezer_tempest_plugin/__init__.py
Normal file
26
freezer/tests/freezer_tempest_plugin/config.py
Normal file
26
freezer/tests/freezer_tempest_plugin/config.py
Normal file
@ -0,0 +1,26 @@
|
||||
# Copyright 2015
|
||||
# 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.
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
|
||||
service_available_group = cfg.OptGroup(name="service_available",
|
||||
title="Available OpenStack Services")
|
||||
|
||||
ServiceAvailableGroup = [
|
||||
cfg.BoolOpt("freezer",
|
||||
default=True,
|
||||
help="Whether or not Freezer is expected to be available"),
|
||||
]
|
38
freezer/tests/freezer_tempest_plugin/plugin.py
Normal file
38
freezer/tests/freezer_tempest_plugin/plugin.py
Normal file
@ -0,0 +1,38 @@
|
||||
# Copyright 2015
|
||||
# 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 os
|
||||
|
||||
from tempest import config
|
||||
from tempest.test_discover import plugins
|
||||
|
||||
from freezer.tests.freezer_tempest_plugin import config as freezer_config
|
||||
|
||||
class FreezerTempestPlugin(plugins.TempestPlugin):
|
||||
def load_tests(self):
|
||||
base_path = os.path.split(os.path.dirname(
|
||||
os.path.abspath(__file__)))[0]
|
||||
test_dir = "freezer_tempest_plugin/tests"
|
||||
full_test_dir = os.path.join(base_path, test_dir)
|
||||
return full_test_dir, base_path
|
||||
|
||||
def register_opts(self, conf):
|
||||
config.register_opt_group(
|
||||
conf, freezer_config.service_available_group,
|
||||
freezer_config.ServiceAvailableGroup)
|
||||
|
||||
def get_opt_lists(self):
|
||||
pass
|
18
freezer/tests/freezer_tempest_plugin/tests/api/base.py
Normal file
18
freezer/tests/freezer_tempest_plugin/tests/api/base.py
Normal file
@ -0,0 +1,18 @@
|
||||
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
|
||||
#
|
||||
# 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 tempest.test
|
||||
|
||||
class BaseFreezerTest(tempest.test.BaseTestCase):
|
||||
pass
|
@ -0,0 +1,23 @@
|
||||
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
|
||||
#
|
||||
# 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.
|
||||
|
||||
from freezer.tests.freezer_tempest_plugin.tests.api import base
|
||||
from tempest import test
|
||||
|
||||
class TestFreezerVersion(base.BaseFreezerTest):
|
||||
|
||||
@test.attr(type="gate")
|
||||
def test_api_version(self):
|
||||
# See if tempest plugin tests run.
|
||||
self.assertEqual(1, 1, 'First test case')
|
@ -60,6 +60,9 @@ console_scripts =
|
||||
freezer-scheduler = freezer.scheduler.freezer_scheduler:main
|
||||
freezerc = freezer.main:main
|
||||
freezer-agent = freezer.main:main
|
||||
tempest.test_plugins =
|
||||
freezer_tempest_tests = freezer.tests.freezer_tempest_plugin.plugin:FreezerTempestPlugin
|
||||
|
||||
|
||||
[pbr]
|
||||
# Have pbr generate the module indexes like sphinx autodoc
|
||||
|
@ -9,3 +9,6 @@ sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 # BSD
|
||||
oslosphinx>=2.5.0,!=3.4.0 # Apache-2.0
|
||||
testrepository>=0.0.18
|
||||
testtools>=1.4.0
|
||||
|
||||
# Tempest Plugin
|
||||
tempest-lib>=0.14.0 # Apache-2.0
|
||||
|
Loading…
Reference in New Issue
Block a user