mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Fixed use of network share drives
Signed-off-by: Smoss <Smoss117@gmail.com>
This commit is contained in:
parent
3da6a71a68
commit
d453da65cf
@ -60,31 +60,34 @@ import org.netbeans.junit.NbModuleSuite;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.autopsy.keywordsearch.*;
|
||||
|
||||
/**
|
||||
* This test expects the following system properties to be set:
|
||||
* img_path: The fully qualified path to the image file (if split, the first file)
|
||||
* out_path: The location where the case will be stored
|
||||
* nsrl_path: Path to the nsrl database
|
||||
* known_bad_path: Path to a database of known bad hashes
|
||||
* keyword_path: Path to a keyword list xml file
|
||||
* ignore_unalloc: Boolean whether to ignore unallocated space or not
|
||||
* This test expects the following system properties to be set: img_path: The
|
||||
* fully qualified path to the image file (if split, the first file) out_path:
|
||||
* The location where the case will be stored nsrl_path: Path to the nsrl
|
||||
* database known_bad_path: Path to a database of known bad hashes keyword_path:
|
||||
* Path to a keyword list xml file ignore_unalloc: Boolean whether to ignore
|
||||
* unallocated space or not
|
||||
*
|
||||
* Without these properties set, the test will fail to run correctly.
|
||||
* To run this test correctly, you should use the script 'regression.py'
|
||||
* located in the 'script' directory of the Testing module.
|
||||
* Without these properties set, the test will fail to run correctly. To run
|
||||
* this test correctly, you should use the script 'regression.py' located in the
|
||||
* 'script' directory of the Testing module.
|
||||
*/
|
||||
public class RegressionTest extends TestCase{
|
||||
public class RegressionTest extends TestCase {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RegressionTest.class.getName());
|
||||
long start;
|
||||
|
||||
/** Constructor required by JUnit */
|
||||
/**
|
||||
* Constructor required by JUnit
|
||||
*/
|
||||
public RegressionTest(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
|
||||
/** Creates suite from particular test cases. */
|
||||
/**
|
||||
* Creates suite from particular test cases.
|
||||
*/
|
||||
public static Test suite() {
|
||||
// run tests with specific configuration
|
||||
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(RegressionTest.class).
|
||||
@ -100,21 +103,24 @@ public class RegressionTest extends TestCase{
|
||||
"testAddSourceWizard1",
|
||||
"testIngest",
|
||||
"testGenerateReportToolbar",
|
||||
"testGenerateReportButton"
|
||||
);
|
||||
return NbModuleSuite.create(conf);
|
||||
"testGenerateReportButton");
|
||||
return NbModuleSuite.create(conf);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/** Method called before each test case. */
|
||||
/**
|
||||
* Method called before each test case.
|
||||
*/
|
||||
@Override
|
||||
public void setUp() {
|
||||
|
||||
logger.info("######## " + System.getProperty("img_path") + " #######");
|
||||
}
|
||||
|
||||
/** Method called after each test case. */
|
||||
/**
|
||||
* Method called after each test case.
|
||||
*/
|
||||
@Override
|
||||
public void tearDown() {
|
||||
}
|
||||
@ -126,7 +132,7 @@ public class RegressionTest extends TestCase{
|
||||
jbo.pushNoBlock();
|
||||
}
|
||||
|
||||
public void testNewCaseWizard(){
|
||||
public void testNewCaseWizard() {
|
||||
logger.info("New Case Wizard");
|
||||
WizardOperator wo = new WizardOperator("New Case Information");
|
||||
JTextFieldOperator jtfo1 = new JTextFieldOperator(wo, 1);
|
||||
@ -146,17 +152,21 @@ public class RegressionTest extends TestCase{
|
||||
logger.info("Starting Add Image process");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 0);
|
||||
String imageDir = System.getProperty("img_path");
|
||||
((JTextField)jtfo0.getSource()).setText(imageDir);
|
||||
String img_path = System.getProperty("img_path");
|
||||
if (img_path.startsWith("\\")) {
|
||||
img_path = "\\" + img_path;
|
||||
}
|
||||
String imageDir = img_path;
|
||||
((JTextField) jtfo0.getSource()).setText(imageDir);
|
||||
wo.btNext().clickMouse();
|
||||
}
|
||||
|
||||
public void testAddSourceWizard1() {
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
while(!wo.btFinish().isEnabled()) {
|
||||
while (!wo.btFinish().isEnabled()) {
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
logger.info("Add image took " + (System.currentTimeMillis()-start) + "ms");
|
||||
logger.info("Add image took " + (System.currentTimeMillis() - start) + "ms");
|
||||
wo.btFinish().clickMouse();
|
||||
}
|
||||
|
||||
@ -223,11 +233,11 @@ public class RegressionTest extends TestCase{
|
||||
JTableOperator jto = new JTableOperator(jdo, 0);
|
||||
jto.clickOnCell(0, 0);
|
||||
JCheckBoxOperator jcbo = new JCheckBoxOperator(jdo, "Enable for ingest", 0);
|
||||
if(!jcbo.isSelected()) {
|
||||
if (!jcbo.isSelected()) {
|
||||
jcbo.doClick();
|
||||
}
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second to process
|
||||
if(Boolean.parseBoolean(System.getProperty("mugen_mode"))){
|
||||
if (Boolean.parseBoolean(System.getProperty("mugen_mode"))) {
|
||||
JTabbedPaneOperator jtpo = new JTabbedPaneOperator(jdo);
|
||||
jtpo.selectPage("String Extraction");
|
||||
JCheckBoxOperator jcbo0 = new JCheckBoxOperator(jtpo, "Arabic (Arabic)");
|
||||
@ -240,7 +250,7 @@ public class RegressionTest extends TestCase{
|
||||
jbo2.pushNoBlock();
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JCheckBoxOperator jbco0 = new JCheckBoxOperator(wo, "Process Unallocated Space");
|
||||
if(Boolean.parseBoolean(System.getProperty("ignore_unalloc"))) {
|
||||
if (Boolean.parseBoolean(System.getProperty("ignore_unalloc"))) {
|
||||
jbco0.doClick();
|
||||
}
|
||||
wo.btNext().clickMouse();
|
||||
@ -250,11 +260,11 @@ public class RegressionTest extends TestCase{
|
||||
logger.info("Ingest 3");
|
||||
long start = System.currentTimeMillis();
|
||||
IngestManager man = IngestManager.getDefault();
|
||||
while(man.isEnqueueRunning()) {
|
||||
while (man.isEnqueueRunning()) {
|
||||
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
logger.info("Enqueue took " + (System.currentTimeMillis()-start) + "ms");
|
||||
while(man.isIngestRunning()) {
|
||||
logger.info("Enqueue took " + (System.currentTimeMillis() - start) + "ms");
|
||||
while (man.isIngestRunning()) {
|
||||
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
@ -263,7 +273,7 @@ public class RegressionTest extends TestCase{
|
||||
while (man.areModulesRunning()) {
|
||||
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
logger.info("Ingest (including enqueue) took " + (System.currentTimeMillis()-start) + "ms");
|
||||
logger.info("Ingest (including enqueue) took " + (System.currentTimeMillis() - start) + "ms");
|
||||
// allow keyword search to finish saving artifacts, just in case
|
||||
// but randomize the timing so that we don't always get the same error
|
||||
// consistently, making it seem like default behavior
|
||||
@ -324,9 +334,9 @@ public class RegressionTest extends TestCase{
|
||||
|
||||
}
|
||||
}
|
||||
private void setListForIngest()
|
||||
{
|
||||
KeywordSearchListsXML curr = KeywordSearchListsXML.getCurrent();
|
||||
curr.setUseForIngest("URLs", true);
|
||||
}
|
||||
|
||||
private void setListForIngest() {
|
||||
KeywordSearchListsXML curr = KeywordSearchListsXML.getCurrent();
|
||||
curr.setUseForIngest("URLs", true);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user