Your changes fail when we pass LAVA_TEST_PLAN="test_abc(option_abc):100, test_bcd":
python ./get_latest_ci_hwpack
Traceback (most recent call last):
File "./get_latest_ci_hwpack", line 94, in <module>
lava_test_install_command["parameters"]["tests"].append(r.group("testcase"))
AttributeError: 'NoneType' object has no attribute 'group'
The following changes fix the above problem and includes other changes like aligning to 80 columns rule.
=== modified file 'get_latest_ci_hwpack'
--- get_latest_ci_hwpack 2012-05-09 12:01:28 +0000
+++ get_latest_ci_hwpack 2012-05-14 08:49:26 +0000
@@ -16,7 +16,7 @@
job_name = os.getenv("KERNEL_JOB_NAME", "unknown") + '_' + \ os.getenv("HWPACK_BUILD_DATE", "unknown") + '_daily test'
-# where in the template dict we shall insert test commands
+# The positions in the template dict to insert test install/run commands
install_cmd_pos = 1
run_cmd_pos = 2
Your changes fail when we pass LAVA_TEST_ PLAN="test_ abc(option_ abc):100, test_bcd": ci_hwpack latest_ ci_hwpack" , line 94, in <module> test_install_ command[ "parameters" ]["tests" ].append( r.group( "testcase" ))
python ./get_latest_
Traceback (most recent call last):
File "./get_
lava_
AttributeError: 'NoneType' object has no attribute 'group'
The following changes fix the above problem and includes other changes like aligning to 80 columns rule. ci_hwpack' ci_hwpack 2012-05-09 12:01:28 +0000 ci_hwpack 2012-05-14 08:49:26 +0000 "KERNEL_ JOB_NAME" , "unknown") + '_' + \
os. getenv( "HWPACK_ BUILD_DATE" , "unknown") + '_daily test'
=== modified file 'get_latest_
--- get_latest_
+++ get_latest_
@@ -16,7 +16,7 @@
job_name = os.getenv(
-testplan = os.getenv( "LAVA_TEST_ PLAN", "ltp,pwrmgmt") "LAVA_TEST_ PLAN", "ltp, pwrmgmt")
+testplan = os.getenv(
template = { 'kernel. git_log_ info'] = os.getenv( "GIT_LOG" , "unknown") 'hwpack. type'] = hwpacktype 'hwpack. date'] = hwpackdate id.split( '.') 'rootfs. type'] = imagetype 'rootfs. date'] = rootfsdate 'rootfs. build'] = rootfsbuild 'actions' ][0]['metadata' ] = metadata
"timeout": 20000,
@@ -66,50 +66,48 @@
metadata[
metadata[
metadata[
-
-
rootfsdate, rootfsbuild = rootfs_
metadata[
metadata[
metadata[
-
template[
testcases = testplan.split(',') "(?P<testcase> ^\w+)(\ ((?P<options> [^\)]+) \))?(:( ?P<timeout> \d+))?" ) split(' ,')] "(?P<testcase> ^\w+)(\ ((?P<options> [^\)]+) \))?"\ timeout> \d+))?" ) install_ command = {} install_ command[ "command" ] = "lava_test_install" install_ command[ "parameters" ] = { "tests" : [], "timeout" : 4000 }
-
-regex = re.compile(
-
-# lava_test_install command
-
+testcases = [tc.strip() for tc in testplan.
+regex = re.compile(
+ "(:(?P<
+
+# Dict for lava_test_install
lava_test_
lava_test_
lava_test_
-# where in the template dict we shall insert test commands
+# The positions in the template dict to insert test install/run commands
install_cmd_pos = 1
run_cmd_pos = 2
for testcase in testcases: testcase) install_ command[ "parameters" ]["tests" ].append( r.group( "testcase" )) run_command = {} run_command[ "command" ] = "lava_test_run" run_command[ "parameters" ] = { "test_name" : r.group( 'testcase' ), run_command[ "parameters" ]["test_ options" ] = r.group("options") 'actions' ].insert( run_cmd_ pos, lava_test_ run_command) install_ command[ "parameters" ]["tests" ].\ r.group( "testcase" )) run_command = {} run_command[ "command" ] = "lava_test_run" run_command[ "parameters" ] = {"test_name" : r.group( 'testcase' ), run_command[ "parameters" ]["test_ options" ] = r.group("options") 'actions' ].insert( run_cmd_ pos, lava_test_ run_command)
r = regex.search(
- lava_test_
-
- # append lava_test_run commands
- timeout = 4800
- if r.group('timeout'):
- timeout = r.group('timeout')
-
- lava_test_
- lava_test_
- lava_test_
- "timeout" : timeout }
-
- if r.group("options"):
- lava_test_
-
- template[
- run_cmd_pos = run_cmd_pos + 1
+ if r.group("testcase") != None:
+ lava_test_
+ append(
+
+ # append lava_test_run commands
+ timeout = 4800
+ if r.group('timeout'):
+ timeout = r.group('timeout')
+
+ lava_test_
+ lava_test_
+ lava_test_
+ "timeout" : timeout }
+
+ if r.group("options"):
+ lava_test_
+
+ template[
+ run_cmd_pos = run_cmd_pos + 1
# append the lava test install command 'actions' ].insert( install_ cmd_pos, lava_test_ install_ command) template, indent=2)
template[
-
print json.dumps(