Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
org.sleuthkit.autopsy.integrationtesting.IntegrationTestService Class Reference

Classes

class  AllConnectionInfo
 
class  IntegrationTestDiffException
 
class  IntegrationTestServiceException
 

Public Member Functions

void runIntegrationTests () throws IntegrationTestDiffException, IntegrationTestServiceException
 

Private Member Functions

void addDataSourcesToCase (List< String > pathStrings, String caseName)
 
Case createCaseWithDataSources (String workingDirectory, String caseOutputPath, String caseName, CaseType caseType, List< String > dataSourcePaths) throws CaseActionException, NoCurrentCaseException, IllegalStateException, IllegalArgumentException
 
CentralRepoDbChoice getCurrentChoice ()
 
int parseIntOrDefault (String toBeParsed, int defaultVal)
 
ConnectionConfig pushActiveMqSettings (ConnectionConfig connectionInfo) throws UserPreferencesException
 
ConnectionConfig pushCentralRepoSettings (ConnectionConfig connectionInfo) throws CentralRepoException
 
CentralRepoDbChoice pushCurrentCrChoice (CentralRepoDbChoice curChoice) throws CentralRepoException
 
AllConnectionInfo pushNewMultiUserSettings (AllConnectionInfo connectionInfo) throws UserPreferencesException, CentralRepoException
 
ConnectionConfig pushPostgresSettings (ConnectionConfig connectionInfo) throws UserPreferencesException
 
ConnectionConfig pushSolrSettings (ConnectionConfig connectionInfo)
 
ConnectionConfig pushZookeeperSettings (ConnectionConfig connectionInfo)
 
void runIngest (Case openCase, IngestJobSettings ingestJobSettings, String caseName)
 
Object runIntegrationTestMethod (IntegrationTestGroup testGroup, Method testMethod, Object[] parameters)
 
OutputResults runIntegrationTests (TestingConfig testSuiteConfig)
 
void runIntegrationTestSuite (EnvConfig envConfig, CaseType caseType, TestSuiteConfig testSuiteConfig) throws CaseActionException, NoCurrentCaseException, IllegalStateException, IllegalArgumentException
 
void setCurrentChoice (CaseType caseType) throws CentralRepoException
 
boolean writeDiff (String outputPath, String goldPath, String diffPath) throws DiffServiceException
 

Static Private Attributes

static final ConfigDeserializer configDeserializer = new ConfigDeserializer()
 
static final ConfigurationModuleManager configurationModuleManager = new ConfigurationModuleManager()
 
static final int DEFAULT_ACTIVEMQ_PORT = 61616
 
static final int DEFAULT_POSTGRES_PORT = 5432
 
static final int DEFAULT_SOLR_PORT = 8983
 
static final int DEFAULT_ZOOKEEPER_PORT = 9983
 
static final DiffService diffService = new DiffService()
 
static final Logger logger = Logger.getLogger(IntegrationTestService.class.getName())
 

Detailed Description

Main entry point for running integration tests. Handles processing parameters, ingesting data sources for cases, and running items implementing IntegrationTests.

Definition at line 76 of file IntegrationTestService.java.

Member Function Documentation

void org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.addDataSourcesToCase ( List< String >  pathStrings,
String  caseName 
)
private

Adds the data sources to the current case.

Parameters
pathStringsThe list of paths for the data sources.
caseNameThe name of the case (used for error messages).

Definition at line 642 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.testutils.IngestUtils.addDataSource(), and org.sleuthkit.autopsy.datasourceprocessors.DataSourceProcessorUtility.getOrderedListOfDataSourceProcessors().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.createCaseWithDataSources().

Case org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.createCaseWithDataSources ( String  workingDirectory,
String  caseOutputPath,
String  caseName,
CaseType  caseType,
List< String >  dataSourcePaths 
) throws CaseActionException, NoCurrentCaseException, IllegalStateException, IllegalArgumentException
private

Creates a case with the given data sources.

Parameters
workingDirectoryThe base working directory (if caseOutputPath or dataSourcePaths are relative, this is the working directory).
caseOutputPathThe case output path.
caseNameThe name of the case (unique case name appends time stamp).
caseTypeThe type of case (single user / multi user).
dataSourcePathsThe path to the data sources.
Returns
The generated case that is now the current case.

Definition at line 614 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.addDataSourcesToCase(), org.sleuthkit.autopsy.casemodule.Case.createAsCurrentCase(), org.sleuthkit.autopsy.coreutils.TimeStampUtils.createTimeStamp(), org.sleuthkit.autopsy.integrationtesting.PathUtil.getAbsolutePath(), org.sleuthkit.autopsy.integrationtesting.PathUtil.getAbsolutePaths(), and org.sleuthkit.autopsy.casemodule.Case.getCurrentCaseThrows().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTestSuite().

CentralRepoDbChoice org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.getCurrentChoice ( )
private
Returns
The currently selected CentralRepoDbChoice (i.e. Postgres, sqlite, etc.).

Definition at line 294 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager.getSelectedDbChoice().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTests().

int org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.parseIntOrDefault ( String  toBeParsed,
int  defaultVal 
)
private

Parses a string to an integer or uses the default value.

Parameters
toBeParsedThe string to be parsed to an integer.
defaultValThe default value to be used if no integer can be parsed.
Returns
The determined value.

Definition at line 542 of file IntegrationTestService.java.

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushPostgresSettings(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushSolrSettings(), and org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushZookeeperSettings().

ConnectionConfig org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushActiveMqSettings ( ConnectionConfig  connectionInfo) throws UserPreferencesException
private

Updates active mq connection settings returning the previous settings. If connectionInfo is null or missing necessary data, no update occurs and null is returned.

Parameters
connectionInfoThe connection configuration or null.
Returns
The previous settings.
Exceptions
UserPreferencesException

Definition at line 401 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.events.MessageServiceConnectionInfo.getHost(), org.sleuthkit.autopsy.core.UserPreferences.getMessageServiceConnectionInfo(), org.sleuthkit.autopsy.events.MessageServiceConnectionInfo.getPassword(), org.sleuthkit.autopsy.events.MessageServiceConnectionInfo.getPort(), org.sleuthkit.autopsy.events.MessageServiceConnectionInfo.getUserName(), and org.sleuthkit.autopsy.core.UserPreferences.setMessageServiceConnectionInfo().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushNewMultiUserSettings().

ConnectionConfig org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushCentralRepoSettings ( ConnectionConfig  connectionInfo) throws CentralRepoException
private
CentralRepoDbChoice org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushCurrentCrChoice ( CentralRepoDbChoice  curChoice) throws CentralRepoException
private
AllConnectionInfo org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushNewMultiUserSettings ( AllConnectionInfo  connectionInfo) throws UserPreferencesException, CentralRepoException
private

Updates all multi user settings to those provided in connectionInfo. If connectionInfo or child items (i.e. postgres/mq/solr) are null, they are ignored and null is returned.

Parameters
connectionInfoThe connection info or null if no setup to be done.
Returns
The old settings (used for reverting).
Exceptions
UserPreferencesException

Definition at line 335 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushActiveMqSettings(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushCentralRepoSettings(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushPostgresSettings(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushSolrSettings(), and org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushZookeeperSettings().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTests().

ConnectionConfig org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushPostgresSettings ( ConnectionConfig  connectionInfo) throws UserPreferencesException
private

Updates postgres connection settings returning the previous settings. If connectionInfo is null or missing necessary data, no update occurs and null is returned.

Parameters
connectionInfoThe connection configuration or null.
Returns
The previous settings.
Exceptions
UserPreferencesException

Definition at line 361 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.centralrepository.datamodel.PostgresConnectionSettings.DEFAULT_PORT, org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.DEFAULT_POSTGRES_PORT, org.sleuthkit.autopsy.core.UserPreferences.getDatabaseConnectionInfo(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.parseIntOrDefault(), and org.sleuthkit.autopsy.core.UserPreferences.setDatabaseConnectionInfo().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushNewMultiUserSettings().

ConnectionConfig org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushSolrSettings ( ConnectionConfig  connectionInfo)
private
ConnectionConfig org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushZookeeperSettings ( ConnectionConfig  connectionInfo)
private
void org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIngest ( Case  openCase,
IngestJobSettings  ingestJobSettings,
String  caseName 
)
private

Runs ingest on the current case.

Parameters
openCaseThe currently open case.
ingestJobSettingsThe ingest job settings to be used.
caseNameThe name of the case to be used for error messages.

Definition at line 671 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.casemodule.Case.getDataSources(), and org.sleuthkit.autopsy.testutils.IngestUtils.runIngestJob().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTestSuite().

Object org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTestMethod ( IntegrationTestGroup  testGroup,
Method  testMethod,
Object[]  parameters 
)
private

Runs a test method in a test suite on the current case.

Parameters
testGroupThe test suite to which the method belongs.
testMethodThe java reflection method to run.
parametersThe parameters to use with this method or none/empty array.
Returns
The results of running the method.

Definition at line 748 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.integrationtesting.IntegrationTestGroup.setup(), and org.sleuthkit.autopsy.integrationtesting.IntegrationTestGroup.tearDown().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTests().

void org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTests ( ) throws IntegrationTestDiffException, IntegrationTestServiceException

Main entry point for running all integration tests.

Definition at line 141 of file IntegrationTestService.java.

References org.sleuthkit.autopsy.integrationtesting.PathUtil.getAbsolutePath(), org.sleuthkit.autopsy.integrationtesting.config.IntegrationCaseType.getCaseTypes(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getCrConnection(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.getCurrentChoice(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getDbConnection(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getDiffOutputPath(), org.sleuthkit.autopsy.integrationtesting.config.IntegrationTestConfig.getEnvConfig(), org.sleuthkit.autopsy.integrationtesting.config.ConfigDeserializer.getIntegrationTestConfig(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getMqConnection(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getRootGoldPath(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getRootTestOutputPath(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getSolrConnection(), org.sleuthkit.autopsy.integrationtesting.config.IntegrationTestConfig.getTestSuites(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getWorkingDirectory(), org.sleuthkit.autopsy.integrationtesting.config.EnvConfig.getZkConnection(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushCurrentCrChoice(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.pushNewMultiUserSettings(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTestSuite(), org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.setCurrentChoice(), and org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.writeDiff().

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTestSuite().

OutputResults org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTests ( TestingConfig  testSuiteConfig)
private
void org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTestSuite ( EnvConfig  envConfig,
CaseType  caseType,
TestSuiteConfig  testSuiteConfig 
) throws CaseActionException, NoCurrentCaseException, IllegalStateException, IllegalArgumentException
private
void org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.setCurrentChoice ( CaseType  caseType) throws CentralRepoException
private
boolean org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.writeDiff ( String  outputPath,
String  goldPath,
String  diffPath 
) throws DiffServiceException
private

Writes any differences found between gold and output to a diff file. Only works if a gold and diff location are specified in the EnvConfig. If there is a diff, throw an exception.

Parameters
outputPathPath to yaml output directory.
goldPathPath to yaml gold directory.
diffPathPath to where diff should be written if there is a diff.
Returns
True if a diff was created.

Definition at line 784 of file IntegrationTestService.java.

Referenced by org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.runIntegrationTests().

Member Data Documentation

final ConfigDeserializer org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.configDeserializer = new ConfigDeserializer()
staticprivate

Definition at line 133 of file IntegrationTestService.java.

final ConfigurationModuleManager org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.configurationModuleManager = new ConfigurationModuleManager()
staticprivate

Definition at line 135 of file IntegrationTestService.java.

final int org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.DEFAULT_ACTIVEMQ_PORT = 61616
staticprivate

Definition at line 125 of file IntegrationTestService.java.

final int org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.DEFAULT_POSTGRES_PORT = 5432
staticprivate
final int org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.DEFAULT_SOLR_PORT = 8983
staticprivate

Definition at line 126 of file IntegrationTestService.java.

final int org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.DEFAULT_ZOOKEEPER_PORT = 9983
staticprivate
final DiffService org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.diffService = new DiffService()
staticprivate

Definition at line 134 of file IntegrationTestService.java.

final Logger org.sleuthkit.autopsy.integrationtesting.IntegrationTestService.logger = Logger.getLogger(IntegrationTestService.class.getName())
staticprivate

Definition at line 131 of file IntegrationTestService.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2022 Basis Technology. Generated on: Wed Sep 28 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.