modified to seperate callback url from test id

Change-Id: Icc3b8eb6fe1b39d38adfb980b2fcf4830cac79aa
This commit is contained in:
david 2014-04-07 07:33:11 -07:00
parent a2c119a1a3
commit 37ae3f5e42
2 changed files with 19 additions and 6 deletions

View File

@ -63,4 +63,4 @@ RUN /usr/local/bin/pip install -r /tempest/test-requirements.txt
# CONF_JSON - JSON string that contains portion of the Tempest
# config. For example, the passwords of the users.
CMD wget http://${APP_SERVER_ADDRESS}/get-script -O execute_test.py && python execute_test.py --callback ${APP_SERVER_ADDRESS} ${TEST_ID} --conf-json ${CONF_JSON} --tempest-home /tempest -v
CMD wget http://${APP_SERVER_ADDRESS}/get-script -O execute_test.py && python execute_test.py --callback ${APP_SERVER_ADDRESS} --test-id ${TEST_ID} --conf-json ${CONF_JSON} --tempest-home /tempest -v

View File

@ -37,6 +37,7 @@ class Test:
console_log_handle = logging.StreamHandler()
console_log_handle.setFormatter(logging.Formatter(log_format))
self.logger.addHandler(console_log_handle)
if os.environ.get("DEBUG"):
self.logger.setLevel(logging.DEBUG)
elif args.verbose:
@ -46,15 +47,21 @@ class Test:
self.app_server_address = None
self.test_id = None
if args.callback:
self.app_server_address, self.test_id = args.callback
self.app_server_address = args.callback
if args.test_id:
self.test_id = args.test_id
self.mini_conf_dict = json.loads(self.get_mini_config())
self.extra_conf_dict = dict()
if args.conf_json:
self.extra_conf_dict = args.conf_json
self.testcases = {"testcases": ["tempest"]}
if args.testcases:
self.testcases = {"testcases": args.testcases}
@ -410,12 +417,18 @@ if __name__ == '__main__':
conflict_group = parser.add_mutually_exclusive_group()
conflict_group.add_argument("--callback",
nargs=2,
metavar=("APP_SERVER_ADDRESS", "TEST_ID"),
type=str,
help="refstack API IP address and test ID to\
action='store',
help="refstack API IP address \
retrieve configurations. i.e.:\
--callback 127.0.0.1:8000 1234")
--callback 127.0.0.1:8000")
conflict_group.add_argument("--test-id",
action='store',
dest='test_key',
type=str,
help="refstack test ID i.e.:\
--test-id 1234 ")
parser.add_argument("--tempest-home",
help="tempest directory path")