blob: 2e19bf2bdf83f7cdfc381dd43b4d4a14e72191c2 [file] [log] [blame]
Matthew Treinish87f772c2013-12-16 20:07:42 +00001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2013 IBM Corp.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17import os
18import unittest
19
20
21def load_tests(loader, tests, pattern):
22 suite = unittest.TestSuite()
23 base_path = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0]
24 base_path = os.path.split(base_path)[0]
25 for test_dir in ['./tempest/api', './tempest/cli', './tempest/scenario',
26 './tempest/thirdparty']:
27 if not pattern:
28 suite.addTests(loader.discover(test_dir, top_level_dir=base_path))
29 else:
30 suite.addTests(loader.discover(test_dir, pattern=pattern,
31 top_level_dir=base_path))
32 return suite