Browse Source

verify Trying to fix the command line

Mike Smith 11 years ago
parent
commit
367147c29a
1 changed files with 22 additions and 5 deletions
  1. 22 5
      toolset/run-tests.py

+ 22 - 5
toolset/run-tests.py

@@ -49,17 +49,33 @@ def main(argv=None):
     clientUser = os.environ.get('TFB_CLIENT_USER')
     clientUser = os.environ.get('TFB_CLIENT_USER')
     clientIden = os.environ.get('TFB_CLIENT_IDENTITY_FILE')
     clientIden = os.environ.get('TFB_CLIENT_IDENTITY_FILE')
     databaHost = os.getenv('TFB_DATABASE_HOST', clientHost)
     databaHost = os.getenv('TFB_DATABASE_HOST', clientHost)
+    databaUser = os.getenv('TFB_DATABASE_USER', clientUser)
+    dbIdenFile = os.getenv('TFB_DATABASE_IDENTITY_FILE', clientIden)
+
+    if serverHost != None:
+        defaults["server-host"] = serverHost
+    if clientHost != None:
+        defaults["client-host"] = clientHost
+    if clientUser != None:
+        defaults["client-user"] = clientUser
+    if clientIden != None:
+        defaults["client-identity-file"] = clientIden
+    if databaHost != None:
+        defaults["--database-host"] = databaHost
+    if databaUser != None:
+        defaults["--database-user"] = databaUser
+    if dbIdenFile != None:
+        defaults["--database-identity-file"] = dbIdenFile
 
 
     ##########################################################
     ##########################################################
     # Set up argument parser
     # Set up argument parser
     ##########################################################
     ##########################################################
     parser = argparse.ArgumentParser(description='Run the Framework Benchmarking test suite.',
     parser = argparse.ArgumentParser(description='Run the Framework Benchmarking test suite.',
         parents=[conf_parser])
         parents=[conf_parser])
-    parser.add_argument('server-host', default=serverHost, help='The application server.')
-    parser.add_argument('client-host', default=clientHost, help='The client / load generation server.')
-    parser.add_argument('client-user', default=clientUser, help='The username to use for SSH to the client instance.')
-    parser.add_argument('client-identity-file', default=clientIden, help='The key to use for SSH to the client instance.')
-    parser.add_argument('database-host', default=databaHost, help='The database server.  If not provided, defaults to the value of --client-host.')
+    parser.add_argument('client-host', help='The client / load generation server.')
+    parser.add_argument('client-user', help='The username to use for SSH to the client instance.')
+    parser.add_argument('client-identity-file', dest='client_identity_file', help='The key to use for SSH to the client instance.')
+    parser.add_argument('--database-host', help='The database server.  If not provided, defaults to the value of --client-host.')
     parser.add_argument('--database-user', help='The username to use for SSH to the database instance.  If not provided, defaults to the value of --client-user.')
     parser.add_argument('--database-user', help='The username to use for SSH to the database instance.  If not provided, defaults to the value of --client-user.')
     parser.add_argument('--database-identity-file', dest='database_identity_file', help='The key to use for SSH to the database instance.  If not provided, defaults to the value of --client-identity-file.')
     parser.add_argument('--database-identity-file', dest='database_identity_file', help='The key to use for SSH to the database instance.  If not provided, defaults to the value of --client-identity-file.')
     parser.add_argument('-p', dest='password_prompt', action='store_true')
     parser.add_argument('-p', dest='password_prompt', action='store_true')
@@ -85,6 +101,7 @@ def main(argv=None):
     parser.add_argument('--database-os', choices=['linux', 'windows'], default='linux', help='The operating system of the database server.')
     parser.add_argument('--database-os', choices=['linux', 'windows'], default='linux', help='The operating system of the database server.')
     parser.add_argument('-v', '--verbose', action='store_true', default=False, help='Causes the configuration to print before any other commands are executed.')
     parser.add_argument('-v', '--verbose', action='store_true', default=False, help='Causes the configuration to print before any other commands are executed.')
     parser.set_defaults(**defaults) # Must do this after add, or each option's default will override the configuration file default
     parser.set_defaults(**defaults) # Must do this after add, or each option's default will override the configuration file default
+
     args = parser.parse_args(remaining_argv)
     args = parser.parse_args(remaining_argv)
 
 
     if args.verbose:
     if args.verbose: