mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Revert Autopsy regression test of JNI HashDB which is now tested in the TSK JNI unit test.
This commit is contained in:
parent
6c407691ad
commit
4207869db9
@ -29,7 +29,6 @@ import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Files;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -61,9 +60,6 @@ import org.netbeans.junit.NbModuleSuite;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.autopsy.keywordsearch.*;
|
||||
import org.sleuthkit.datamodel.SleuthkitJNI;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
import org.sleuthkit.datamodel.TskException;
|
||||
|
||||
/**
|
||||
* This test expects the following system properties to be set: img_path: The
|
||||
@ -97,8 +93,7 @@ public class RegressionTest extends TestCase {
|
||||
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(RegressionTest.class).
|
||||
clusters(".*").
|
||||
enableModules(".*");
|
||||
conf = conf.addTest("testHashDbJni"
|
||||
, "testNewCaseWizardOpen",
|
||||
conf = conf.addTest("testNewCaseWizardOpen",
|
||||
"testNewCaseWizard",
|
||||
"testStartAddDataSource",
|
||||
"testConfigureIngest1",
|
||||
@ -108,8 +103,7 @@ public class RegressionTest extends TestCase {
|
||||
"testAddSourceWizard1",
|
||||
"testIngest",
|
||||
"testGenerateReportToolbar",
|
||||
"testGenerateReportButton"
|
||||
);
|
||||
"testGenerateReportButton");
|
||||
return NbModuleSuite.create(conf);
|
||||
|
||||
|
||||
@ -131,73 +125,6 @@ public class RegressionTest extends TestCase {
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
public void testHashDbJni() {
|
||||
logger.info("HashDb JNI");
|
||||
try
|
||||
{
|
||||
String hashfn = "regtestHash.kdb";
|
||||
//String md5hash = "b8c51089ebcdf9f11154a021438f5bd6";
|
||||
String md5hash = "2c875b03541ffa970679986b48dca943";
|
||||
String md5hash2 = "cb4aca35f3fd54aacf96da9cd9acadb8";
|
||||
String md5hashBad = "35b299c6fcf47ece375b3221bdc16969";
|
||||
|
||||
// logger.info("Opening existing kdb file...");
|
||||
// int handle = SleuthkitJNI.openHashDatabase(hashfn);
|
||||
// logger.info("handle = " + handle);
|
||||
|
||||
// Make sure we start with a clean slate
|
||||
File f = new File(hashfn);
|
||||
if (f.exists()) {
|
||||
if (!f.delete()) {
|
||||
// Probably a file permission issue
|
||||
logger.warning("Cleaning test file failed.");
|
||||
}
|
||||
}
|
||||
|
||||
logger.info("Creating hash db " + hashfn);
|
||||
int handle = SleuthkitJNI.createHashDatabase(hashfn);
|
||||
logger.info("handle = " + handle);
|
||||
|
||||
logger.info("hashDatabaseCanBeReindexed?");
|
||||
boolean retIndexable = SleuthkitJNI.hashDatabaseCanBeReindexed(handle);
|
||||
logger.info("return value = " + Boolean.toString(retIndexable));
|
||||
|
||||
logger.info("getHashDatabasePath?");
|
||||
String retDbpath = SleuthkitJNI.getHashDatabasePath(handle);
|
||||
logger.info("return value = " + retDbpath);
|
||||
|
||||
logger.info("getHashDatabaseIndexPath?");
|
||||
String retIndexDbpath = SleuthkitJNI.getHashDatabaseIndexPath(handle);
|
||||
logger.info("return value = " + retIndexDbpath);
|
||||
|
||||
logger.info("Adding hash " + md5hash);
|
||||
SleuthkitJNI.addToHashDatabase("", md5hash, "", "", handle);
|
||||
|
||||
logger.info("Adding hash " + md5hash2);
|
||||
SleuthkitJNI.addToHashDatabase("", md5hash2, "", "", handle);
|
||||
|
||||
logger.info("Querying for known hash " + md5hash);
|
||||
TskData.FileKnown k = SleuthkitJNI.lookupInHashDatabase(md5hash, handle);
|
||||
logger.info("Query result: " + k.toString());
|
||||
|
||||
logger.info("Querying for unknown hash " + md5hashBad);
|
||||
TskData.FileKnown k2 = SleuthkitJNI.lookupInHashDatabase(md5hashBad, handle);
|
||||
logger.info("Query result: " + k2.toString());
|
||||
|
||||
logger.info("Test: hashDatabaseHasLookupIndex() ");
|
||||
boolean b = SleuthkitJNI.hashDatabaseHasLookupIndex(handle);
|
||||
logger.info("Result: " + Boolean.toString(b));
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (TskException ex) {
|
||||
logger.log(Level.WARNING, "Database creation error: ", ex);
|
||||
logger.info("A TskException occurred.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void testNewCaseWizardOpen() {
|
||||
logger.info("New Case");
|
||||
NbDialogOperator nbdo = new NbDialogOperator("Welcome");
|
||||
|
Loading…
x
Reference in New Issue
Block a user