]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
admin_socket: make test optional
authorSage Weil <sage@newdream.net>
Tue, 24 Jul 2012 22:25:56 +0000 (15:25 -0700)
committerSage Weil <sage@newdream.net>
Tue, 24 Jul 2012 22:26:06 +0000 (15:26 -0700)
If it's not there, we just verify the output is valid json.

teuthology/task/admin_socket.py

index 147402ef2e0dc5db6dacbf8e5ac6c33938018788..e16605e6317fb6ffaa96866345da2de34b67bc36 100644 (file)
@@ -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), \