refstack-client test fails when testing with the test-list option. To fix this issue, refstack-client needs to initialize the environment variables "TEMPEST_CONFIG_DIR" and "TEMPEST_CONFIG" with the configuration file path value passed in by the caller.
(.venv)cdiep@cdiep-VirtualBox:~/refstack-client-20151115-list-tests/refstack-client$ ./refstack-client test -c ~/tempest.conf.142.short -v --test-list ~/2015.07.required.txt
2015-11-15 14:47:35,467 refstack_client:126 DEBUG The .testrepository/next-stream file was not found. Assuming subunit results will be stored in file 0.
2015-11-15 14:47:35,589 refstack_client:313 INFO Starting Tempest test...
2015-11-15 14:47:35,589 refstack_client:323 INFO Normalizing test list...
2015-11-15 14:47:36.149 24769 INFO tempest [-] Using tempest config file /etc/tempest/tempest.conf
Non-zero exit code (2) from test listing.
2015-11-15 14:47:37,018 refstack_client.list_parser:53 ERROR None
Traceback (most recent call last):
File "./refstack-client", line 31, in <module>
getattr(test, args.func)()
File "/home/cdiep/refstack-client-20151115-list-tests/refstack-client/refstack_client/refstack_client.py", line 326, in test
list_file = parser.get_normalized_test_list(self.args.test_list)
File "/home/cdiep/refstack-client-20151115-list-tests/refstack-client/refstack_client/list_parser.py", line 199, in get_normalized_test_list
tempest_test_ids = self._get_tempest_test_ids()
File "/home/cdiep/refstack-client-20151115-list-tests/refstack-client/refstack_client/list_parser.py", line 55, in _get_tempest_test_ids
' '.join(cmd))
subprocess.CalledProcessError: Command '/home/cdiep/refstack-client-20151115-list-tests/refstack-client/.tempest/tools/with_venv.sh testr list-tests' returned non-zero exit status 3
With test-list option, refstack-client will first normalize the user input test lists to the test list of the current installed Tempest. There seems to be some updates in the recent release that "testr list-tests" would require a valid tempest.conf for test listing. The path of the tempest.conf file is determined by the .tempest/tempest/config.py file. If a tempest.conf file is not found, then the failsafe file is used (/etc/tempest/tempest.conf".
def __init__(self, parse_conf=True, config_path=None): """Initialize a configuration from a conf directory and conf file.""" super(TempestConfigPrivate, self).__init__() config_files = [] failsafe_path = "/etc/tempest/" + self.DEFAULT_CONFIG_FILE
# only parse the config file if we expect one to exist. This is needed
# to remove an issue with the config file up to date checker.
if parse_conf: config_files.append(path) logging.register_options(_CONF)
if os.path.isfile(path): _CONF([], project='tempest', default_config_files=config_files)
else: _CONF([], project='tempest') logging.setup(_CONF, 'tempest')
LOG = logging.getLogger('tempest') LOG.info("Using tempest config file %s" % path) register_opts() self._set_attrs()
if parse_conf: _CONF.log_opt_values(LOG, std_logging.DEBUG)
refstack-client test fails when testing with the test-list option. To fix this issue, refstack-client needs to initialize the environment variables "TEMPEST_ CONFIG_ DIR" and "TEMPEST_CONFIG" with the configuration file path value passed in by the caller.
(.venv) cdiep@cdiep- VirtualBox: ~/refstack- client- 20151115- list-tests/ refstack- client$ ./refstack-client test -c ~/tempest. conf.142. short -v --test-list ~/2015. 07.required. txt /next-stream file was not found. Assuming subunit results will be stored in file 0. tempest. conf client. list_parser: 53 ERROR None client" , line 31, in <module> cdiep/refstack- client- 20151115- list-tests/ refstack- client/ refstack_ client/ refstack_ client. py", line 326, in test get_normalized_ test_list( self.args. test_list) cdiep/refstack- client- 20151115- list-tests/ refstack- client/ refstack_ client/ list_parser. py", line 199, in get_normalized_ test_list test_ids = self._get_ tempest_ test_ids( ) cdiep/refstack- client- 20151115- list-tests/ refstack- client/ refstack_ client/ list_parser. py", line 55, in _get_tempest_ test_ids CalledProcessEr ror: Command '/home/ cdiep/refstack- client- 20151115- list-tests/ refstack- client/ .tempest/ tools/with_ venv.sh testr list-tests' returned non-zero exit status 3
2015-11-15 14:47:35,467 refstack_client:126 DEBUG The .testrepository
2015-11-15 14:47:35,589 refstack_client:313 INFO Starting Tempest test...
2015-11-15 14:47:35,589 refstack_client:323 INFO Normalizing test list...
2015-11-15 14:47:36.149 24769 INFO tempest [-] Using tempest config file /etc/tempest/
Non-zero exit code (2) from test listing.
2015-11-15 14:47:37,018 refstack_
Traceback (most recent call last):
File "./refstack-
getattr(test, args.func)()
File "/home/
list_file = parser.
File "/home/
tempest_
File "/home/
' '.join(cmd))
subprocess.
With test-list option, refstack-client will first normalize the user input test lists to the test list of the current installed Tempest. There seems to be some updates in the recent release that "testr list-tests" would require a valid tempest.conf for test listing. The path of the tempest.conf file is determined by the .tempest/ tempest/ config. py file. If a tempest.conf file is not found, then the failsafe file is used (/etc/tempest/ tempest. conf".
def __init__(self, parse_conf=True, config_path=None):
"""Initialize a configuration from a conf directory and conf file."""
super( TempestConfigPr ivate, self).__init__()
config_ files = []
failsafe_ path = "/etc/tempest/" + self.DEFAULT_ CONFIG_ FILE
if config_path:
conf_ dir = os.environ. get('TEMPEST_ CONFIG_ DIR',
self. DEFAULT_ CONFIG_ DIR)
conf_ file = os.environ. get('TEMPEST_ CONFIG' ,
self. DEFAULT_ CONFIG_ FILE)
path = config_path
else:
# Environment variables override defaults...
path = os.path. join(conf_ dir, conf_file)
if not os.path. isfile( path):
path = failsafe_path
# only parse the config file if we expect one to exist. This is needed
config_ files.append( path)
logging. register_ options( _CONF) isfile( path):
_CONF( [], project='tempest', default_ config_ files=config_ files)
_CONF( [], project='tempest')
logging. setup(_ CONF, 'tempest') getLogger( 'tempest' )
LOG.info( "Using tempest config file %s" % path)
register_ opts()
self._ set_attrs( )
_CONF. log_opt_ values( LOG, std_logging.DEBUG)
# to remove an issue with the config file up to date checker.
if parse_conf:
if os.path.
else:
LOG = logging.
if parse_conf: