From cbb8cc1a3fdc93a590611e65d912dca8d6a1e68b Mon Sep 17 00:00:00 2001 From: alexjacks92 Date: Mon, 28 Apr 2014 16:43:53 -0400 Subject: [PATCH 01/24] First pass at id/path swapping. --- test/script/tskdbdiff.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/script/tskdbdiff.py b/test/script/tskdbdiff.py index 0220d757b9..abbf2e3aa4 100644 --- a/test/script/tskdbdiff.py +++ b/test/script/tskdbdiff.py @@ -268,6 +268,7 @@ class TskDbDiff(object): class TskDbDiffException(Exception): pass + def replace_id(line, table): """Remove the object id from a line. @@ -275,15 +276,19 @@ def replace_id(line, table): line: a String, the line to remove the object id from. table: a map from object ids to file paths. """ - index = line.find('INSERT INTO "tsk_files"') - if (index != -1): - # take the portion of the string between the open parenthesis and the comma (ie, the object id) - obj_id = line[line.find('(') + 1 : line.find(',')] + files_index = line.find('INSERT INTO "tsk_files"') + path_index = line.find('INSERT INTO "tsk_files_path"') + # take the portion of the string between the open parenthesis and the comma (ie, the object id) + obj_id = line[line.find('(') + 1 : line.find(',')] + if files_index != -1: # takes everything from the beginning of the string up to the opening # parenthesis, the path associated with the object id, and everything after # the first comma, and concactenate it newLine = (line[:line.find('('):] + '(' + table[int(obj_id)] + line[line.find(','):]) return newLine + elif path_index != -1: + newLine = (line[:line.find('('):] + '(' + table[int(obj_id)] + line[line.find(','):]) + return newLine else: return line From a0b4a2d32f84e039a849f730cb4c83eb821163f0 Mon Sep 17 00:00:00 2001 From: alexjacks92 Date: Tue, 29 Apr 2014 16:53:15 -0400 Subject: [PATCH 02/24] Replacing more IDs with file paths - now tsk_files_path and tsk_objects tables as well. --- .../netbeans/core/startup/Bundle.properties | 2 +- .../core/windows/view/ui/Bundle.properties | 2 +- test/script/regression.py | 23 ++++++++++--------- test/script/tskdbdiff.py | 20 +++++++++++++--- 4 files changed, 31 insertions(+), 16 deletions(-) mode change 100644 => 100755 test/script/tskdbdiff.py diff --git a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index 28783ec7c0..d22a89c799 100644 --- a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Tue, 22 Apr 2014 16:06:14 -0400 +#Tue, 29 Apr 2014 10:05:28 -0400 LBL_splash_window_title=Starting Autopsy SPLASH_HEIGHT=288 SPLASH_WIDTH=538 diff --git a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties index fe9124784d..fe8e0abbcc 100644 --- a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties +++ b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Tue, 22 Apr 2014 16:06:14 -0400 +#Tue, 29 Apr 2014 10:05:28 -0400 CTL_MainWindow_Title=Autopsy 3.1.0_Beta CTL_MainWindow_Title_No_Project=Autopsy 3.1.0_Beta diff --git a/test/script/regression.py b/test/script/regression.py index 7c33e62d33..e689fdccff 100755 --- a/test/script/regression.py +++ b/test/script/regression.py @@ -818,7 +818,7 @@ class TestResultsDiffer(object): logging.critical(traceback.format_exc()) return False - def _compare_report_files(a_path, b_path): + def _compare_report_files(gold_path, output_path): """Compares the two specified report html files. Args: @@ -830,17 +830,18 @@ class TestResultsDiffer(object): unordered list in the html report files, or (0, 0) if the lenghts are the same. """ - a_file = open(a_path) - b_file = open(b_path) - a = a_file.read() - b = b_file.read() - a = a[a.find("