mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Revert "Add logical files set to regression tests"
This commit is contained in:
parent
8e6383feb1
commit
907c7a265b
@ -29,7 +29,6 @@ import java.io.IOException;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -51,8 +50,8 @@ import org.netbeans.jellytools.WizardOperator;
|
|||||||
import org.netbeans.jemmy.Timeout;
|
import org.netbeans.jemmy.Timeout;
|
||||||
import org.netbeans.jemmy.Timeouts;
|
import org.netbeans.jemmy.Timeouts;
|
||||||
import org.netbeans.jemmy.operators.JButtonOperator;
|
import org.netbeans.jemmy.operators.JButtonOperator;
|
||||||
|
import org.netbeans.jemmy.operators.JListOperator;
|
||||||
import org.netbeans.jemmy.operators.JCheckBoxOperator;
|
import org.netbeans.jemmy.operators.JCheckBoxOperator;
|
||||||
import org.netbeans.jemmy.operators.JComboBoxOperator;
|
|
||||||
import org.netbeans.jemmy.operators.JDialogOperator;
|
import org.netbeans.jemmy.operators.JDialogOperator;
|
||||||
import org.netbeans.jemmy.operators.JFileChooserOperator;
|
import org.netbeans.jemmy.operators.JFileChooserOperator;
|
||||||
import org.netbeans.jemmy.operators.JLabelOperator;
|
import org.netbeans.jemmy.operators.JLabelOperator;
|
||||||
@ -81,7 +80,6 @@ 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;
|
||||||
private static final File img_path = new File(System.getProperty("img_path"));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor required by JUnit
|
* Constructor required by JUnit
|
||||||
@ -98,10 +96,9 @@ public class RegressionTest extends TestCase {
|
|||||||
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(RegressionTest.class).
|
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(RegressionTest.class).
|
||||||
clusters(".*").
|
clusters(".*").
|
||||||
enableModules(".*");
|
enableModules(".*");
|
||||||
if (img_path.isFile()) {
|
|
||||||
conf = conf.addTest("testNewCaseWizardOpen",
|
conf = conf.addTest("testNewCaseWizardOpen",
|
||||||
"testNewCaseWizard",
|
"testNewCaseWizard",
|
||||||
"testStartAddImageFileDataSource",
|
"testStartAddDataSource",
|
||||||
"testConfigureIngest1",
|
"testConfigureIngest1",
|
||||||
"testConfigureHash",
|
"testConfigureHash",
|
||||||
"testConfigureIngest2",
|
"testConfigureIngest2",
|
||||||
@ -110,22 +107,6 @@ public class RegressionTest extends TestCase {
|
|||||||
"testIngest",
|
"testIngest",
|
||||||
"testGenerateReportToolbar",
|
"testGenerateReportToolbar",
|
||||||
"testGenerateReportButton");
|
"testGenerateReportButton");
|
||||||
}
|
|
||||||
|
|
||||||
if (img_path.isDirectory()) {
|
|
||||||
conf = conf.addTest("testNewCaseWizardOpen",
|
|
||||||
"testNewCaseWizard",
|
|
||||||
"testStartAddLogicalFilesDataSource",
|
|
||||||
"testConfigureIngest1",
|
|
||||||
"testConfigureHash",
|
|
||||||
"testConfigureIngest2",
|
|
||||||
"testConfigureSearch",
|
|
||||||
"testAddSourceWizard1",
|
|
||||||
"testIngest",
|
|
||||||
"testGenerateReportToolbar",
|
|
||||||
"testGenerateReportButton");
|
|
||||||
}
|
|
||||||
|
|
||||||
return NbModuleSuite.create(conf);
|
return NbModuleSuite.create(conf);
|
||||||
|
|
||||||
|
|
||||||
@ -171,7 +152,7 @@ public class RegressionTest extends TestCase {
|
|||||||
wo.btFinish().clickMouse();
|
wo.btFinish().clickMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testStartAddImageFileDataSource() {
|
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);
|
||||||
@ -184,22 +165,6 @@ public class RegressionTest extends TestCase {
|
|||||||
wo.btNext().clickMouse();
|
wo.btNext().clickMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testStartAddLogicalFilesDataSource() {
|
|
||||||
logger.info("Starting Add Logical Files process");
|
|
||||||
WizardOperator wo = new WizardOperator("Add Data");
|
|
||||||
JComboBoxOperator comboBoxOperator = new JComboBoxOperator(wo);
|
|
||||||
// select the item indexed 2 (Logical Files) from the drop-down list.
|
|
||||||
comboBoxOperator.selectItem(2);
|
|
||||||
JButtonOperator addButtonOperator = new JButtonOperator(wo, "Add");
|
|
||||||
addButtonOperator.pushNoBlock();
|
|
||||||
JFileChooserOperator fileChooserOperator = new JFileChooserOperator();
|
|
||||||
fileChooserOperator.setCurrentDirectory(img_path);
|
|
||||||
// set the current directory one level above the directory containing logicalFileSet folder.
|
|
||||||
fileChooserOperator.goUpLevel();
|
|
||||||
fileChooserOperator.chooseFile(img_path.getName());
|
|
||||||
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()) {
|
||||||
|
@ -743,11 +743,11 @@ class TestConfiguration(object):
|
|||||||
self.build_path = build_path
|
self.build_path = build_path
|
||||||
|
|
||||||
def _init_imgs(self, parsed_config):
|
def _init_imgs(self, parsed_config):
|
||||||
"""Initialize the list of images to run tests on. Logical file set also included."""
|
"""Initialize the list of images to run tests on."""
|
||||||
for element in parsed_config.getElementsByTagName("image"):
|
for element in parsed_config.getElementsByTagName("image"):
|
||||||
value = element.getAttribute("value").encode().decode("utf_8")
|
value = element.getAttribute("value").encode().decode("utf_8")
|
||||||
print ("Image in Config File: " + value)
|
print ("Image in Config File: " + value)
|
||||||
if file_exists(value) or dir_exists(value):
|
if file_exists(value):
|
||||||
self.images.append(value)
|
self.images.append(value)
|
||||||
else:
|
else:
|
||||||
msg = "File: " + value + " doesn't exist"
|
msg = "File: " + value + " doesn't exist"
|
||||||
|
7
test/script/regression_utils.py
Executable file → Normal file
7
test/script/regression_utils.py
Executable file → Normal file
@ -71,8 +71,6 @@ def required_input_file(name):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def image_type(image_file):
|
def image_type(image_file):
|
||||||
if (dir_exists(image_file)):
|
|
||||||
return IMGTYPE.LOGICAL
|
|
||||||
ext_start = image_file.rfind(".")
|
ext_start = image_file.rfind(".")
|
||||||
if (ext_start == -1):
|
if (ext_start == -1):
|
||||||
return IMGTYPE.UNKNOWN
|
return IMGTYPE.UNKNOWN
|
||||||
@ -88,15 +86,12 @@ def image_type(image_file):
|
|||||||
|
|
||||||
# Returns the type of image file, based off extension
|
# Returns the type of image file, based off extension
|
||||||
class IMGTYPE:
|
class IMGTYPE:
|
||||||
RAW, ENCASE, SPLIT, LOGICAL, UNKNOWN = range(5)
|
RAW, ENCASE, SPLIT, UNKNOWN = range(4)
|
||||||
|
|
||||||
def get_image_name(image_file):
|
def get_image_name(image_file):
|
||||||
path_end = image_file.rfind("/")
|
path_end = image_file.rfind("/")
|
||||||
path_end2 = image_file.rfind("\\")
|
path_end2 = image_file.rfind("\\")
|
||||||
ext_start = image_file.rfind(".")
|
ext_start = image_file.rfind(".")
|
||||||
if (image_type(image_file) == IMGTYPE.LOGICAL):
|
|
||||||
name = image_file[path_end2+1:]
|
|
||||||
return name
|
|
||||||
if(ext_start == -1):
|
if(ext_start == -1):
|
||||||
name = image_file
|
name = image_file
|
||||||
if(path_end2 != -1):
|
if(path_end2 != -1):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user