OSDN Git Service

tc-testing: Add newline when writing test case files
authorLucas Bates <lucasb@mojatatu.com>
Thu, 29 Mar 2018 19:58:10 +0000 (15:58 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Mar 2018 18:22:51 +0000 (14:22 -0400)
When using the -i feature to generate random ID numbers for test
cases in tdc, the function that writes the JSON to file doesn't
add a newline character to the end of the file, so we have to
add our own.

Signed-off-by: Lucas Bates <lucasb@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/tc-testing/tdc.py

index 44de4a2..87a04a8 100755 (executable)
@@ -490,6 +490,7 @@ def generate_case_ids(alltests):
                     testlist.append(t)
         outfile = open(f, "w")
         json.dump(testlist, outfile, indent=4)
+        outfile.write("\n")
         outfile.close()
 
 def filter_tests_by_id(args, testlist):