Skip to content
Snippets Groups Projects
Commit fb41d4a3 authored by anttil's avatar anttil
Browse files

BIS-487 / SP-813: Make archive verifier runnable through datastore_server.sh

SVN: 29662
parent f09a0a5b
No related branches found
No related tags found
No related merge requests found
...@@ -265,6 +265,8 @@ case "$command" in ...@@ -265,6 +265,8 @@ case "$command" in
echo " $0 debug-db-connections on / off - switch on / off database connection debug logging" echo " $0 debug-db-connections on / off - switch on / off database connection debug logging"
echo " $0 record-stacktrace-db-connections on / off - switch on / off database connection stacktrace recording" echo " $0 record-stacktrace-db-connections on / off - switch on / off database connection stacktrace recording"
echo " $0 no-record-stacktrace-db-connections - switch off database connection stacktrace recording" echo " $0 no-record-stacktrace-db-connections - switch off database connection stacktrace recording"
echo " $0 verify-archives - verify integrity of dataset archives created by ZipArchiver"
;; ;;
version) version)
${CMD} --version ${CMD} --version
...@@ -278,6 +280,10 @@ case "$command" in ...@@ -278,6 +280,10 @@ case "$command" in
show-command-queue) show-command-queue)
${CMD} --show-command-queue ${CMD} --show-command-queue
;; ;;
verify-archives)
shift
java -cp lib/datastore_server.jar:lib/commons-lang.jar:lib/commons-io.jar:lib/postgresql.jar ch.systemsx.cisd.openbis.dss.archiveverifier.cli.Main etc/service.properties $*
;;
log-thread-dump) log-thread-dump)
if [ -f $PIDFILE ]; then if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE 2> /dev/null` PID=`cat $PIDFILE 2> /dev/null`
......
...@@ -87,7 +87,7 @@ public class DataSetArchiveVerificationBatchFactory ...@@ -87,7 +87,7 @@ public class DataSetArchiveVerificationBatchFactory
{ {
if (args.length < 2) if (args.length < 2)
{ {
return error("Usage: java -jar ..adsfadf"); return error("Usage: datastore_server.sh verify-archives [dataset code 1] [dataset code 2] ...");
} }
String servicePropertiesPath = args[0]; String servicePropertiesPath = args[0];
...@@ -95,14 +95,14 @@ public class DataSetArchiveVerificationBatchFactory ...@@ -95,14 +95,14 @@ public class DataSetArchiveVerificationBatchFactory
File serviceProperties = new File(servicePropertiesPath); File serviceProperties = new File(servicePropertiesPath);
if (serviceProperties.exists() == false) if (serviceProperties.exists() == false)
{ {
return error("No service.properties given"); return error("File " + serviceProperties.getAbsolutePath() + " does not exist");
} }
Properties properties = DssPropertyParametersUtil.loadProperties(serviceProperties.getAbsolutePath()); Properties properties = DssPropertyParametersUtil.loadProperties(serviceProperties.getAbsolutePath());
String defaultArchiveDirectoryPath = properties.getProperty(DEFAULT_ARCHIVE_FOLDER); String defaultArchiveDirectoryPath = properties.getProperty(DEFAULT_ARCHIVE_FOLDER);
if (defaultArchiveDirectoryPath == null) if (defaultArchiveDirectoryPath == null)
{ {
return error("Given service.properties files does not contain mandatory property " + DEFAULT_ARCHIVE_FOLDER); return error("Given service.properties file does not contain mandatory property " + DEFAULT_ARCHIVE_FOLDER);
} }
IArchiveFileMetaDataRepository pathInfoRepository = null; IArchiveFileMetaDataRepository pathInfoRepository = null;
......
...@@ -60,10 +60,14 @@ public class ResultPrinter ...@@ -60,10 +60,14 @@ public class ResultPrinter
out.println(" " + error); out.println(" " + error);
} }
failed++; failed++;
} else } else if (result.getErrors().isEmpty())
{ {
out.println("NOT TESTED - " + dataSet + " (file not found)"); out.println("NOT TESTED - " + dataSet + " (file not found)");
notTested++; notTested++;
} else
{
out.println(result.getErrors().get(0));
return;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment