Переглянути джерело

HPCC-19197 ./ecl-test -fabcdef causes an error

Remove parameter value checking
Add try-except block around the parameter processing
Remove unused imports

Tested manually

Signed-off-by: AttilaVamos <attila.vamos@gmail.com>
AttilaVamos 7 роки тому
батько
коміт
34762f3c06
2 змінених файлів з 8 додано та 6 видалено
  1. 7 2
      testing/regress/ecl-test
  2. 1 4
      testing/regress/hpcc/util/util.py

+ 7 - 2
testing/regress/ecl-test

@@ -151,7 +151,8 @@ class RegressMain:
         commonParser.add_argument('-X', help="sets the stored input value (stored('name')).",
                             nargs=1, type=checkXParam,  default='None',  metavar="name1=value1[,name2=value2...]")
         commonParser.add_argument('-f', help="set an ECL option (equivalent to #option and multiple -f can be use in a command line).", action="append",
-                            type=checkXParam,  metavar="optionA=valueA[,optionB=valueB...]")
+                            metavar="optionA=valueA[,optionB=valueB...]")
+
 
         commonParser.add_argument('--pq', help="Parallel query execution with threadNumber threads. (If threadNumber is '-1' on a single node system then threadNumber = numberOfLocalCore * 2 )",
                                 type=checkPqParam,  default = 0,   metavar="threadNumber")
@@ -200,7 +201,11 @@ class RegressMain:
         self.parser_query.add_argument('--publish', '-p', help="Publish compiled query instead of run.",
                                 action='store_true')
 
-        self.args = parser.parse_args()
+        try:
+            self.args = parser.parse_args()
+        except Error as e:
+            logging.critical(e)
+            exit(e.getErrorCode());
 
         regressionSuiteMainDir = os.path.dirname(__file__)
         regressionSuiteFullPath = os.path.realpath(regressionSuiteMainDir)

+ 1 - 4
testing/regress/hpcc/util/util.py

@@ -22,8 +22,6 @@ import platform
 import logging
 import os
 import subprocess
-import urllib2
-import base64
 
 from ..common.error import Error
 from ..common.shell import Shell
@@ -49,8 +47,7 @@ def checkXParam(string):
         if ('=' in param) or ('None' == param):
             value = param
         else:
-            #logging.error("%s. Missing or wrong argument '%s' after -X parameter!\nIt should be 'name=val[,name2=val2..]'\n5000\n" % (1,  param))
-            value="5000"
+            raise Error("5000",  err="But got argument:'%s'" % (param) )
     else:
         msg = "Missing argument of -X parameter!"
         raise argparse.ArgumentTypeError(msg)