1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
10 """ Handler for yardstick command 'testcase' """
11 from __future__ import absolute_import
12 from __future__ import print_function
17 from yardstick.common import constants as consts
19 LOG = logging.getLogger(__name__)
22 class Testsuite(object):
25 Set of commands to discover and display test cases.
28 def list_all(self, args):
29 """List existing test cases"""
31 testsuite_list = self._get_testsuite_file_list()
35 def _get_testsuite_file_list(self):
37 testsuite_files = sorted(os.listdir(consts.TESTSUITE_DIR))
39 LOG.exception('Failed to list dir:\n%s\n', consts.TESTSUITE_DIR)
42 return testsuite_files