From 9bc86171ac4d197e06b856ff123cbad776c4423a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 24 Jul 2012 15:25:56 -0700 Subject: [PATCH] admin_socket: make test optional If it's not there, we just verify the output is valid json. --- teuthology/task/admin_socket.py | 40 ++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/teuthology/task/admin_socket.py b/teuthology/task/admin_socket.py index 147402ef2e..e16605e631 100644 --- a/teuthology/task/admin_socket.py +++ b/teuthology/task/admin_socket.py @@ -109,26 +109,30 @@ def _run_tests(ctx, client, tests): ) for command, config in tests.iteritems(): + if config is None: + config = {} log.debug('Testing %s with config %s', command, str(config)) - assert 'test' in config, \ - 'admin_socket task requires a test script' - test_path = os.path.join(tmp_dir, command) - remote.run( - args=[ - 'wget', - '-q', - '-O', - test_path, - '--', - config['test'], - run.Raw('&&'), - 'chmod', - 'u=rx', - '--', - test_path, - ], - ) + test_path = None + if 'test' in config: + test_path = os.path.join(tmp_dir, command) + remote.run( + args=[ + 'wget', + '-q', + '-O', + test_path, + '--', + config['test'], + run.Raw('&&'), + 'chmod', + 'u=rx', + '--', + test_path, + ], + ) + else: + test_path = '/bin/true' args = config.get('args', []) assert isinstance(args, list), \ -- 2.39.5