def test_Stack(self):
        rndFileName = ''.join(
            random.choice(string.ascii_uppercase) for _ in range(15))
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            # Add stuff to stack
            for i in xrange(0, 10):
                entry_fields = settings.EntriesFields(
                    EntryType=settings.__APPCOMPAT__,
                    FilePath='C:\Windows',
                    FileName=rndFileName,
                    Size=i,
                    ExecFlag='True')
                add_entry(DB, "TestHost01", entry_fields)

            # Run
            ret = main([
                self.testset1, "stack", "FileName", "FilePath = 'c:\Windows'"
            ])

        # Check status count == db count
        count = int([i[1][0] for i in ret if rndFileName in i[1]][0])
        self.assertEquals(count, 10, "test_Stack failed!")
    def test_TStack(self):
        rndFileName = 'randomfilename.rnd'
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            # Add stuff to stack
            for i in xrange(0, 10):
                entry_fields = settings.EntriesFields(
                    EntryType=settings.__APPCOMPAT__,
                    FilePath='C:\Windows',
                    FileName=rndFileName,
                    Size=i,
                    LastModified='1000-01-01 00:00:0' + str(i))
                add_entry(DB, "TestHost01", entry_fields)

            # Run
            ret = main([self.testset1, "tstack", '1000-01-01', '1000-01-02'])

        # Check we found the right file
        self.assertEquals(ret[1][1][0], rndFileName, "test_TStack failed!")
        # Check expected in count
        self.assertEquals(int(ret[1][1][1]), 10, "test_TStack failed!")
        # Check expected out count
        self.assertEquals(int(ret[1][1][2]), 0, "test_TStack failed!")
Exemple #3
0
    def test_AmCache_LiteralSearch(self):
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            for i in xrange(0, 10):
                entry_fields = settings.EntriesFields(
                    EntryType=settings.__AMCACHE__,
                    FilePath='C:\Temp',
                    FileName='calc.exe',
                    Size=i,
                    ExecFlag='True')
                add_entry(DB, "TestHost01", entry_fields)

        # Get temp file name for the DB
        with tempfile.NamedTemporaryFile(
                suffix='.txt', prefix='Output',
                dir=tempfile.gettempdir()) as temp_file:
            # Search
            (num_hits, num_hits_suppressed, results) = main([
                "-o", temp_file.name, self.testset1, "search", "-F", "calc.exe"
            ])
            # Check we got at least as many as we added into the DB
            self.assertTrue(
                num_hits >= 10,
                sys._getframe().f_code.co_name + " num_hits: %d" % num_hits)
            # Check output has the expected result
            self.assertEquals(
                num_hits, self.count_lines_regex(temp_file.name, "calc\.exe"),
                sys._getframe().f_code.co_name +
                " Output regex count doesn't match num_hits!")
Exemple #4
0
    def test_AppCompat_IndexedSearch2(self):
        rndFileName = ''.join(
            random.choice(string.ascii_uppercase) for _ in range(20))
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            for i in xrange(0, 20):
                entry_fields = settings.EntriesFields(
                    EntryType=settings.__APPCOMPAT__,
                    FilePath='C:\Temp',
                    FileName=rndFileName,
                    Size=i,
                    ExecFlag='True')
                add_entry(DB, "TestHost01", entry_fields)

        # Get temp file name for the DB
        with tempfile.NamedTemporaryFile(
                suffix='.txt',
                prefix='test_AppCompat_IndexedSearch',
                dir=tempfile.gettempdir()) as temp_file_indexed:
            with tempfile.NamedTemporaryFile(
                    suffix='.txt',
                    prefix='test_AppCompat_NormalSearch',
                    dir=tempfile.gettempdir()) as temp_file_normal:
                # Indexed Search
                (num_hits, num_hits_suppressed, results) = main([
                    "-o", temp_file_indexed.name, self.testset1, "fsearch",
                    "FileName", "-F", rndFileName
                ])
                # Standard Search
                (num_hits2, num_hits_suppressed2, results2) = main([
                    "-o", temp_file_normal.name, self.testset1, "search", "-F",
                    "\\" + rndFileName
                ])
                # Check we got the same number of hits
                self.assertTrue(
                    num_hits == num_hits2,
                    sys._getframe().f_code.co_name +
                    " num_hits: %d" % num_hits)
                # Check output has the expected results
                self.assertEquals(
                    num_hits - num_hits_suppressed,
                    self.count_lines_regex(temp_file_indexed.name,
                                           rndFileName),
                    sys._getframe().f_code.co_name +
                    " Output regex count doesn't match num_hits!")
                # Check output has the expected results
                self.assertEquals(
                    num_hits2 - num_hits_suppressed2,
                    self.count_lines_regex(temp_file_normal.name, rndFileName),
                    sys._getframe().f_code.co_name +
                    " Output regex count doesn't match num_hits!")
                # Check standard and indexed search produced the same results
                self.assertTrue(
                    self.compare_output_files(temp_file_normal.name,
                                              temp_file_indexed.name),
                    "Results differ!")
Exemple #5
0
    def test_AppCompat_LiteralSearch_Suppressed(self):
        rndFileName = ''.join(
            random.choice(string.ascii_uppercase) for _ in range(15))
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            # Add 10 entries
            for i in xrange(0, 10):
                entry_fields = settings.EntriesFields(
                    EntryType=settings.__APPCOMPAT__,
                    FilePath='C:\Temp',
                    FileName=rndFileName,
                    Size=i,
                    ExecFlag='True')
                add_entry(DB, "TestHost01", entry_fields)

            # Add 10 entries which will be deduped to 1 on search
            for i in xrange(0, 10):
                entry_fields = settings.EntriesFields(
                    EntryType=settings.__APPCOMPAT__,
                    FilePath='C:\Temp',
                    FileName=rndFileName,
                    Size=1000,
                    ExecFlag='True')
                add_entry(DB, "TestHost01", entry_fields)

        # Get temp file name for the DB
        with tempfile.NamedTemporaryFile(
                suffix='.txt', prefix='Output',
                dir=tempfile.gettempdir()) as temp_file:
            # Search
            (num_hits, num_hits_suppressed, results) = main([
                "-o", temp_file.name, self.testset1, "search", "-F",
                rndFileName
            ])
            # Check we got as many hits as we expect
            self.assertTrue(
                num_hits == 10 + 10,
                sys._getframe().f_code.co_name + " num_hits: %d - %s" %
                (num_hits, self.testset1))
            # Check supression worked as expected
            self.assertTrue(
                num_hits_suppressed == 9,
                sys._getframe().f_code.co_name + " num_hits: %d" % num_hits)
            # Check output has the expected result
            self.assertEquals(
                num_hits - num_hits_suppressed,
                self.count_lines_regex(temp_file.name, rndFileName),
                sys._getframe().f_code.co_name +
                " Output regex count doesn't match num_hits!")
    def test_Leven2(self):
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            # Add stuff
            entry_fields = settings.EntriesFields(EntryType=settings.__APPCOMPAT__, FilePath='C:\Windows\System32',
                FileName='svchosts.exe')
            add_entry(DB, "TestHost01", entry_fields)

            # Run
            ret = main([self.testset1, "leven"])
            # Check we found the right file
            self.assertEquals('svchosts.exe' in ret[1][1][1], True, "test_Leven2 failed!")
    def test_Leven(self):
        rndFileName = ''.join(random.choice(string.ascii_uppercase) for _ in range(15))
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            # Add stuff
            entry_fields = settings.EntriesFields(EntryType=settings.__APPCOMPAT__, FilePath='C:\Windows\System32', FileName=rndFileName)
            add_entry(DB, "TestHost01", entry_fields)

            # Run
            leven_fileName = 'a' + rndFileName
            ret = main([self.testset1, "leven", leven_fileName])
            # Check we found the right file
            self.assertEquals(ret[1][1][1], "'"+rndFileName+"'", "test_Leven failed!")
Exemple #8
0
    def test_Filehitcount1(self):
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            entry_fields = settings.EntriesFields(EntryType=settings.__APPCOMPAT__, FilePath='C:\Temp', FileName='test123.exe')
            add_entry(DB, "TestHost01", entry_fields)
            entry_fields = settings.EntriesFields(EntryType=settings.__APPCOMPAT__, FilePath='C:\Temp', FileName='test1234.exe')
            add_entry(DB, "TestHost01", entry_fields)
            entry_fields = settings.EntriesFields(EntryType=settings.__APPCOMPAT__, FilePath='C:\\test123.exe', FileName='nohit.exe')
            add_entry(DB, "TestHost01", entry_fields)

            # Get temp db name for the test
            temp_file = tempfile.NamedTemporaryFile(suffix='.db', prefix='testCase', dir=tempfile.gettempdir())
            temp_file.close()
            with open(temp_file.name, 'w') as fh:
                fh.write('test123.exe')

            try:
                ret = main([self.testset1, "filehitcount", temp_file.name])
            except Exception as e:
                print traceback.format_exc()
                self.fail(e.message + "\n" + traceback.format_exc())

            # Remove temp file
            os.remove(temp_file.name)

            num_hits = len(ret)
            self.assertEquals(num_hits, 2, sys._getframe().f_code.co_name)
            self.assertEquals(ret[1][1][1][0], 'test123.exe', "test_Tstomp1 failed!")
            self.assertEquals(int(ret[1][1][1][1]), 1, "test_Tstomp1 failed!")
Exemple #9
0
    def test_AppCompat_IndexedSearchFilePath(self):
        rndFileName = ''.join(
            random.choice(string.ascii_uppercase) for _ in range(20))
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            for i in xrange(0, 20):
                entry_fields = settings.EntriesFields(
                    EntryType=settings.__APPCOMPAT__,
                    FilePath='C:\\' + rndFileName,
                    FileName="calc.exe",
                    Size=i,
                    ExecFlag='True')
                add_entry(DB, "TestHost01", entry_fields)

        # Get temp file name for the DB
        with tempfile.NamedTemporaryFile(
                suffix='.txt',
                prefix='test_AppCompat_IndexedSearch',
                dir=tempfile.gettempdir()) as temp_file:
            # Search
            (num_hits, num_hits_suppressed, results) = main([
                "-o", temp_file.name, self.testset1, "fsearch", "FilePath",
                "-F", "C:\\" + rndFileName
            ])
            # Check we got at least as many as we added into the DB
            self.assertTrue(
                num_hits == 20,
                sys._getframe().f_code.co_name + " num_hits: %d" % num_hits)
            # Check output has the expected result
            self.assertEquals(
                num_hits - num_hits_suppressed,
                self.count_lines_regex(temp_file.name, rndFileName),
                sys._getframe().f_code.co_name +
                " Output regex count doesn't match num_hits!")
Exemple #10
0
    def test_TcorrTest_prog1(self):
        with appDB.DBClass(self.testset1, settings.__version__) as DB:
            DB.appInitDB()
            conn = DB.appConnectDB()

            # TestHost01
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='AAA.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost01", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='BBB.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost01", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='CCC.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost01", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='DDD.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost01", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='EEE.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost01", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='FFF.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost01", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='GGG.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost01", entry_fields)

            # TestHost02
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='AAA.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost02", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='BBB.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost02", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='CCC.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost02", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='DDD.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost02", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='EEE.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost02", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='FFF.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost02", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='GGG.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost02", entry_fields)

            try:
                directCorrelationData = main(
                    [self.testset1, "tcorr", "DDD.exe", "-w 1"])
            except Exception as e:
                print traceback.format_exc()
                self.fail(e.message + "\n" + traceback.format_exc())

            # Check Names
            self.assertEquals(directCorrelationData[1][3], "CCC.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[0][3], "EEE.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Before
            self.assertEquals(directCorrelationData[1][6], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[0][6], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check After
            self.assertEquals(directCorrelationData[1][7], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[0][7], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check InvBond
            self.assertEquals(directCorrelationData[1][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[0][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Total_Count
            self.assertEquals(directCorrelationData[1][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[0][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")

            try:
                directCorrelationData = main(
                    [self.testset1, "tcorr", "DDD.exe", "-w 2"])
            except Exception as e:
                print traceback.format_exc()
                self.fail(e.message + "\n" + traceback.format_exc())

            # Check Names
            self.assertEquals(directCorrelationData[0][3], "CCC.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][3], "EEE.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][3], "BBB.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][3], "FFF.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Before
            self.assertEquals(directCorrelationData[0][6], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][6], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][6], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][6], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check After
            self.assertEquals(directCorrelationData[0][7], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][7], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][7], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][7], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check InvBond
            self.assertEquals(directCorrelationData[0][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Total_Count
            self.assertEquals(directCorrelationData[0][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Weight
            self.assertTrue(
                directCorrelationData[0][8] > directCorrelationData[2][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[0][8] > directCorrelationData[3][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[1][8] > directCorrelationData[2][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[1][8] > directCorrelationData[3][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[0][8] == directCorrelationData[1][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[2][8] == directCorrelationData[3][8],
                "test_TcorrTest_prog1 - Name failed!")

            try:
                directCorrelationData = main(
                    [self.testset1, "tcorr", "DDD.exe", "-w 3"])
            except Exception as e:
                print traceback.format_exc()
                self.fail(e.message + "\n" + traceback.format_exc())

            # Check Names
            self.assertEquals(directCorrelationData[0][3], "CCC.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][3], "EEE.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][3], "BBB.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][3], "FFF.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[4][3], "AAA.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[5][3], "GGG.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Before
            self.assertEquals(directCorrelationData[0][6], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][6], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][6], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][6], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[4][6], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[5][6], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check After
            self.assertEquals(directCorrelationData[0][7], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][7], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][7], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][7], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[4][7], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[5][7], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check InvBond
            self.assertEquals(directCorrelationData[0][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[4][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[5][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Total_Count
            self.assertEquals(directCorrelationData[0][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[2][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[3][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[4][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[5][10], 2,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Weight
            self.assertTrue(
                directCorrelationData[0][8] > directCorrelationData[2][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[0][8] > directCorrelationData[3][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[0][8] > directCorrelationData[4][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[0][8] > directCorrelationData[5][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[1][8] > directCorrelationData[2][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[1][8] > directCorrelationData[3][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[1][8] > directCorrelationData[4][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[1][8] > directCorrelationData[5][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[0][8] == directCorrelationData[1][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[2][8] == directCorrelationData[3][8],
                "test_TcorrTest_prog1 - Name failed!")
            self.assertTrue(
                directCorrelationData[4][8] == directCorrelationData[5][8],
                "test_TcorrTest_prog1 - Name failed!")

            # TestHost03
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='AAA.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost03", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='BBB.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost03", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='CCC.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost03", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='DDD.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost03", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='EEE.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost03", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='FFF.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost03", entry_fields)
            entry_fields = settings.EntriesFields(
                EntryType=settings.__APPCOMPAT__,
                FilePath='C:\Temp',
                FileName='GGG.exe',
                Size=1,
                ExecFlag='True')
            add_entry(DB, "TestHost03", entry_fields)

            try:
                directCorrelationData = main(
                    [self.testset1, "tcorr", "DDD.exe", "-w 1"])
            except Exception as e:
                print traceback.format_exc()
                self.fail(e.message + "\n" + traceback.format_exc())

            # Check Names
            self.assertEquals(directCorrelationData[0][3], "CCC.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][3], "EEE.exe",
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Before
            self.assertEquals(directCorrelationData[0][6], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][6], 3,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check After
            self.assertEquals(directCorrelationData[0][7], 3,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][7], 0,
                              "test_TcorrTest_prog1 - Name failed!")
            # Check InvBond
            self.assertEquals(directCorrelationData[0][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][9], "True",
                              "test_TcorrTest_prog1 - Name failed!")
            # Check Total_Count
            self.assertEquals(directCorrelationData[0][10], 3,
                              "test_TcorrTest_prog1 - Name failed!")
            self.assertEquals(directCorrelationData[1][10], 3,
                              "test_TcorrTest_prog1 - Name failed!")