diff --git a/avocado/plugins/runner.py b/avocado/plugins/runner.py index 4ddeb94db7b391f98da83e4fc90fe2eb003f39aa..8fd89d8f43e46949748356e37283eb7d0613a6fe 100644 --- a/avocado/plugins/runner.py +++ b/avocado/plugins/runner.py @@ -96,11 +96,11 @@ class TestRunner(plugin.Plugin): help='Run a list of test modules or dropin tests (space separated)') parser.add_argument('url', type=str, default=None, - help=('Test module names or paths to dropin tests ' - '(space separated)')) + help=('List of test IDs (aliases or paths)'), + nargs='?') parser.add_argument('-z', '--archive', action='store_true', default=False, - help='Archive (ZIP) files generated by tests.') + help='Archive (ZIP) files generated by tests') parser.add_argument('-m', '--multiplex-file', type=str, default=None, help=('Path to an avocado multiplex ' @@ -108,7 +108,7 @@ class TestRunner(plugin.Plugin): nargs='?') parser.add_argument('--keep-tmp-files', action='store_true', default=False, - help='Keep temporary files generated by tests.') + help='Keep temporary files generated by tests') parser.add_argument('--unique-id', type=str, default=None, help=('Unique Job id. Used by a server when job ' @@ -116,6 +116,7 @@ class TestRunner(plugin.Plugin): 'different test machine')) parser.set_defaults(func=self.run_tests) + self.parser = parser self.configured = True def run_tests(self, args): @@ -125,7 +126,10 @@ class TestRunner(plugin.Plugin): :param args: Command line args received from the run subparser. """ job_instance = job.Job(args) - return job_instance.run() + rc = job_instance.run() + if args.url is None: + self.parser.print_help() + return rc class SystemInformation(plugin.Plugin): diff --git a/selftests/all/functional/avocado/basic_tests.py b/selftests/all/functional/avocado/basic_tests.py index 0834656fcfeca95664539a8190ab63d87400cd76..678add1c2b2afa7c875e03bd3aaa2b8ff7f46f28 100644 --- a/selftests/all/functional/avocado/basic_tests.py +++ b/selftests/all/functional/avocado/basic_tests.py @@ -168,9 +168,11 @@ class RunnerOperationTest(unittest.TestCase): cmd_line = './scripts/avocado run' result = process.run(cmd_line, ignore_status=True) expected_rc = 2 - expected_output = 'avocado run: error: too few arguments' + expected_output = 'Empty test ID. A test path or alias must be provided' + expected_output_2 = 'usage:' self.assertEqual(result.exit_status, expected_rc) self.assertIn(expected_output, result.stderr) + self.assertIn(expected_output_2, result.stdout) def test_not_found(self): os.chdir(basedir)