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.openide.util.Exceptions;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.keywordsearch.*;
|
import org.sleuthkit.autopsy.keywordsearch.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test expects the following system properties to be set:
|
* This test expects the following system properties to be set: img_path: The
|
||||||
* img_path: The fully qualified path to the image file (if split, the first file)
|
* fully qualified path to the image file (if split, the first file) out_path:
|
||||||
* out_path: The location where the case will be stored
|
* The location where the case will be stored nsrl_path: Path to the nsrl
|
||||||
* nsrl_path: Path to the nsrl database
|
* database known_bad_path: Path to a database of known bad hashes keyword_path:
|
||||||
* known_bad_path: Path to a database of known bad hashes
|
* Path to a keyword list xml file ignore_unalloc: Boolean whether to ignore
|
||||||
* keyword_path: Path to a keyword list xml file
|
* unallocated space or not
|
||||||
* ignore_unalloc: Boolean whether to ignore unallocated space or not
|
*
|
||||||
*
|
* Without these properties set, the test will fail to run correctly. To run
|
||||||
* Without these properties set, the test will fail to run correctly.
|
* this test correctly, you should use the script 'regression.py' located in the
|
||||||
* To run this test correctly, you should use the script 'regression.py'
|
* 'script' directory of the Testing module.
|
||||||
* 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());
|
private static final Logger logger = Logger.getLogger(RegressionTest.class.getName());
|
||||||
long start;
|
long start;
|
||||||
|
|
||||||
/** Constructor required by JUnit */
|
/**
|
||||||
|
* Constructor required by JUnit
|
||||||
|
*/
|
||||||
public RegressionTest(String name) {
|
public RegressionTest(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/** Creates suite from particular test cases. */
|
* Creates suite from particular test cases.
|
||||||
|
*/
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
// run tests with specific configuration
|
// run tests with specific configuration
|
||||||
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(RegressionTest.class).
|
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(RegressionTest.class).
|
||||||
@ -100,33 +103,36 @@ public class RegressionTest extends TestCase{
|
|||||||
"testAddSourceWizard1",
|
"testAddSourceWizard1",
|
||||||
"testIngest",
|
"testIngest",
|
||||||
"testGenerateReportToolbar",
|
"testGenerateReportToolbar",
|
||||||
"testGenerateReportButton"
|
"testGenerateReportButton");
|
||||||
);
|
return NbModuleSuite.create(conf);
|
||||||
return NbModuleSuite.create(conf);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Method called before each test case. */
|
/**
|
||||||
|
* Method called before each test case.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
|
|
||||||
logger.info("######## " + System.getProperty("img_path") + " #######");
|
logger.info("######## " + System.getProperty("img_path") + " #######");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Method called after each test case. */
|
/**
|
||||||
|
* Method called after each test case.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNewCaseWizardOpen() {
|
public void testNewCaseWizardOpen() {
|
||||||
logger.info("New Case");
|
logger.info("New Case");
|
||||||
NbDialogOperator nbdo = new NbDialogOperator("Welcome");
|
NbDialogOperator nbdo = new NbDialogOperator("Welcome");
|
||||||
JButtonOperator jbo = new JButtonOperator(nbdo, 0); // the "New Case" button
|
JButtonOperator jbo = new JButtonOperator(nbdo, 0); // the "New Case" button
|
||||||
jbo.pushNoBlock();
|
jbo.pushNoBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNewCaseWizard(){
|
public void testNewCaseWizard() {
|
||||||
logger.info("New Case Wizard");
|
logger.info("New Case Wizard");
|
||||||
WizardOperator wo = new WizardOperator("New Case Information");
|
WizardOperator wo = new WizardOperator("New Case Information");
|
||||||
JTextFieldOperator jtfo1 = new JTextFieldOperator(wo, 1);
|
JTextFieldOperator jtfo1 = new JTextFieldOperator(wo, 1);
|
||||||
@ -141,25 +147,29 @@ public class RegressionTest extends TestCase{
|
|||||||
start = System.currentTimeMillis();
|
start = System.currentTimeMillis();
|
||||||
wo.btFinish().clickMouse();
|
wo.btFinish().clickMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testStartAddDataSource() {
|
public void testStartAddDataSource() {
|
||||||
logger.info("Starting Add Image process");
|
logger.info("Starting Add Image process");
|
||||||
WizardOperator wo = new WizardOperator("Add Data");
|
WizardOperator wo = new WizardOperator("Add Data");
|
||||||
JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 0);
|
JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 0);
|
||||||
String imageDir = System.getProperty("img_path");
|
String img_path = System.getProperty("img_path");
|
||||||
((JTextField)jtfo0.getSource()).setText(imageDir);
|
if (img_path.startsWith("\\")) {
|
||||||
|
img_path = "\\" + img_path;
|
||||||
|
}
|
||||||
|
String imageDir = img_path;
|
||||||
|
((JTextField) jtfo0.getSource()).setText(imageDir);
|
||||||
wo.btNext().clickMouse();
|
wo.btNext().clickMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAddSourceWizard1() {
|
public void testAddSourceWizard1() {
|
||||||
WizardOperator wo = new WizardOperator("Add Data");
|
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
|
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();
|
wo.btFinish().clickMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConfigureIngest1() {
|
public void testConfigureIngest1() {
|
||||||
logger.info("Ingest 1");
|
logger.info("Ingest 1");
|
||||||
WizardOperator wo = new WizardOperator("Add Data");
|
WizardOperator wo = new WizardOperator("Add Data");
|
||||||
@ -169,7 +179,7 @@ public class RegressionTest extends TestCase{
|
|||||||
JButtonOperator jbo1 = new JButtonOperator(wo, "Advanced");
|
JButtonOperator jbo1 = new JButtonOperator(wo, "Advanced");
|
||||||
jbo1.pushNoBlock();
|
jbo1.pushNoBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConfigureHash() {
|
public void testConfigureHash() {
|
||||||
logger.info("Hash Configure");
|
logger.info("Hash Configure");
|
||||||
JDialog hashMainDialog = JDialogOperator.waitJDialog("Hash Database Configuration", false, false);
|
JDialog hashMainDialog = JDialogOperator.waitJDialog("Hash Database Configuration", false, false);
|
||||||
@ -199,17 +209,17 @@ public class RegressionTest extends TestCase{
|
|||||||
JButtonOperator jbo4 = new JButtonOperator(hashMainDialogOperator, "OK", 0);
|
JButtonOperator jbo4 = new JButtonOperator(hashMainDialogOperator, "OK", 0);
|
||||||
jbo4.pushNoBlock();
|
jbo4.pushNoBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConfigureIngest2() {
|
public void testConfigureIngest2() {
|
||||||
logger.info("Ingest 2");
|
logger.info("Ingest 2");
|
||||||
WizardOperator wo = new WizardOperator("Add Data");
|
WizardOperator wo = new WizardOperator("Add Data");
|
||||||
JTableOperator jto = new JTableOperator(wo, 0);
|
JTableOperator jto = new JTableOperator(wo, 0);
|
||||||
int row = jto.findCellRow("Keyword Search", 1, 0);
|
int row = jto.findCellRow("Keyword Search", 1, 0);
|
||||||
jto.clickOnCell(row, 1);
|
jto.clickOnCell(row, 1);
|
||||||
JButtonOperator jbo1 = new JButtonOperator(wo, "Advanced");
|
JButtonOperator jbo1 = new JButtonOperator(wo, "Advanced");
|
||||||
jbo1.pushNoBlock();
|
jbo1.pushNoBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConfigureSearch() {
|
public void testConfigureSearch() {
|
||||||
logger.info("Search Configure");
|
logger.info("Search Configure");
|
||||||
JDialog jd = JDialogOperator.waitJDialog("Advanced Keyword Search Configuration", false, false);
|
JDialog jd = JDialogOperator.waitJDialog("Advanced Keyword Search Configuration", false, false);
|
||||||
@ -221,13 +231,13 @@ public class RegressionTest extends TestCase{
|
|||||||
JFileChooserOperator jfco0 = new JFileChooserOperator();
|
JFileChooserOperator jfco0 = new JFileChooserOperator();
|
||||||
jfco0.chooseFile(words);
|
jfco0.chooseFile(words);
|
||||||
JTableOperator jto = new JTableOperator(jdo, 0);
|
JTableOperator jto = new JTableOperator(jdo, 0);
|
||||||
jto.clickOnCell(0, 0);
|
jto.clickOnCell(0, 0);
|
||||||
JCheckBoxOperator jcbo = new JCheckBoxOperator(jdo, "Enable for ingest", 0);
|
JCheckBoxOperator jcbo = new JCheckBoxOperator(jdo, "Enable for ingest", 0);
|
||||||
if(!jcbo.isSelected()) {
|
if (!jcbo.isSelected()) {
|
||||||
jcbo.doClick();
|
jcbo.doClick();
|
||||||
}
|
}
|
||||||
new Timeout("pausing", 1000).sleep(); // give it a second to process
|
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);
|
JTabbedPaneOperator jtpo = new JTabbedPaneOperator(jdo);
|
||||||
jtpo.selectPage("String Extraction");
|
jtpo.selectPage("String Extraction");
|
||||||
JCheckBoxOperator jcbo0 = new JCheckBoxOperator(jtpo, "Arabic (Arabic)");
|
JCheckBoxOperator jcbo0 = new JCheckBoxOperator(jtpo, "Arabic (Arabic)");
|
||||||
@ -240,22 +250,22 @@ public class RegressionTest extends TestCase{
|
|||||||
jbo2.pushNoBlock();
|
jbo2.pushNoBlock();
|
||||||
WizardOperator wo = new WizardOperator("Add Data");
|
WizardOperator wo = new WizardOperator("Add Data");
|
||||||
JCheckBoxOperator jbco0 = new JCheckBoxOperator(wo, "Process Unallocated Space");
|
JCheckBoxOperator jbco0 = new JCheckBoxOperator(wo, "Process Unallocated Space");
|
||||||
if(Boolean.parseBoolean(System.getProperty("ignore_unalloc"))) {
|
if (Boolean.parseBoolean(System.getProperty("ignore_unalloc"))) {
|
||||||
jbco0.doClick();
|
jbco0.doClick();
|
||||||
}
|
}
|
||||||
wo.btNext().clickMouse();
|
wo.btNext().clickMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIngest() {
|
public void testIngest() {
|
||||||
logger.info("Ingest 3");
|
logger.info("Ingest 3");
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
IngestManager man = IngestManager.getDefault();
|
IngestManager man = IngestManager.getDefault();
|
||||||
while(man.isEnqueueRunning()) {
|
while (man.isEnqueueRunning()) {
|
||||||
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
||||||
}
|
}
|
||||||
logger.info("Enqueue took " + (System.currentTimeMillis()-start) + "ms");
|
logger.info("Enqueue took " + (System.currentTimeMillis() - start) + "ms");
|
||||||
while(man.isIngestRunning()) {
|
while (man.isIngestRunning()) {
|
||||||
|
|
||||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||||
}
|
}
|
||||||
new Timeout("pausing", 15000).sleep(); // give it a second (or fifteen) to process
|
new Timeout("pausing", 15000).sleep(); // give it a second (or fifteen) to process
|
||||||
@ -263,16 +273,16 @@ public class RegressionTest extends TestCase{
|
|||||||
while (man.areModulesRunning()) {
|
while (man.areModulesRunning()) {
|
||||||
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
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
|
// allow keyword search to finish saving artifacts, just in case
|
||||||
// but randomize the timing so that we don't always get the same error
|
// but randomize the timing so that we don't always get the same error
|
||||||
// consistently, making it seem like default behavior
|
// consistently, making it seem like default behavior
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
new Timeout("pausing", 10000 + (rand.nextInt(15000) + 5000)).sleep();
|
new Timeout("pausing", 10000 + (rand.nextInt(15000) + 5000)).sleep();
|
||||||
screenshot("Finished Ingest");
|
screenshot("Finished Ingest");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGenerateReportToolbar() {
|
public void testGenerateReportToolbar() {
|
||||||
|
|
||||||
logger.info("Generate Report Toolbars");
|
logger.info("Generate Report Toolbars");
|
||||||
@ -284,7 +294,7 @@ public class RegressionTest extends TestCase{
|
|||||||
jbo.pushNoBlock();
|
jbo.pushNoBlock();
|
||||||
new Timeout("pausing", 1000).sleep();
|
new Timeout("pausing", 1000).sleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGenerateReportButton() throws IOException {
|
public void testGenerateReportButton() throws IOException {
|
||||||
logger.info("Generate Report Button");
|
logger.info("Generate Report Button");
|
||||||
JDialog reportDialog = JDialogOperator.waitJDialog("Generate Report", false, false);
|
JDialog reportDialog = JDialogOperator.waitJDialog("Generate Report", false, false);
|
||||||
@ -308,7 +318,7 @@ public class RegressionTest extends TestCase{
|
|||||||
System.setProperty("ReportStr", datenotime);
|
System.setProperty("ReportStr", datenotime);
|
||||||
screenshot("Done Testing");
|
screenshot("Done Testing");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void screenshot(String name) {
|
public void screenshot(String name) {
|
||||||
logger.info("Taking screenshot.");
|
logger.info("Taking screenshot.");
|
||||||
try {
|
try {
|
||||||
@ -321,12 +331,12 @@ public class RegressionTest extends TestCase{
|
|||||||
logger.log(Level.WARNING, "IOException taking screenshot.", ex);
|
logger.log(Level.WARNING, "IOException taking screenshot.", ex);
|
||||||
} catch (AWTException ex) {
|
} catch (AWTException ex) {
|
||||||
logger.log(Level.WARNING, "AWTException taking screenshot.", ex);
|
logger.log(Level.WARNING, "AWTException taking screenshot.", ex);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void setListForIngest()
|
|
||||||
{
|
private void setListForIngest() {
|
||||||
KeywordSearchListsXML curr = KeywordSearchListsXML.getCurrent();
|
KeywordSearchListsXML curr = KeywordSearchListsXML.getCurrent();
|
||||||
curr.setUseForIngest("URLs", true);
|
curr.setUseForIngest("URLs", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user