Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions org.dawnsci.squishtests/suite_autoprocessing/Read Me.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
###################################################################################################
# #
# Copyright (c) 2017 Diamond Light Source Ltd. #
# #
# All rights reserved. This program and the accompanying materials are made available under the #
# terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available #
# at http://www.eclipse.org/legal/epl-v10.html #
# #
###################################################################################################
# #
# To perfom a validation run the script called 'validator.sh', by default it should do the #
# validation from its current location. #
# #
# To override these defaults, read the header of the validator.sh script file for more #
# information. #
# #
# Success will result in the following line being printed to the console: #
# #
# Success! The files are the same! #
# #
# and an exit code of 0 (zero) will be returned. If there is a problem a number of console error #
# strings and exit codes have been programmed in, again read the header of the validator.sh #
# script file for more information. #
# #
###################################################################################################
# #
# Last updated 2017-03-30 #
# #
# Author: Tim Snow (tim.snow@diamond.ac.uk) #
# #
###################################################################################################
33 changes: 33 additions & 0 deletions org.dawnsci.squishtests/suite_autoprocessing/Read Me.txt~
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
###################################################################################################
# #
# Copyright (c) 2017 Diamond Light Source Ltd. #
# #
# All rights reserved. This program and the accompanying materials are made available under the #
# terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available #
# at http://www.eclipse.org/legal/epl-v10.html #
# #
###################################################################################################
# #
# To perfom a validation run the script called 'validator.sh', by default it should do the #
# validation from its current location. #
# #
# To override these defaults, read the header of the validator.sh script file for more #
# information. #
# #
# Success will result in the following line being printed to the console: #
# #
# Success! The files are the same! #
# #
# and an exit code of 0 (zero) will be returned. If there is a problem a number of console error #
# strings and exit codes have been programmed in, again read the header of the validator.sh #
# script file for more information. #
# #
###################################################################################################
# #
# Last updated 2017-03-30 #
# #
# Author: Tim Snow (tim.snow@diamond.ac.uk) #
# #
###################################################################################################


Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"runDirectory": "/dls/i22/data/2017/sw17105-1", "name": "TestRun", "filePath": "path_to_file", "dataDimensions": [-1, -2], "processingPath": "/dls/i22/data/2017/sw17105-1/xml/templates/saxs_iQ_reduction_pipeline.nxs", "outputFilePath": "path_to_output", "deleteProcessingFile": false, "datasetPath": "/entry1/detector", "numberOfCores" : 1, "xmx" : 1024}
Binary file not shown.
Binary file not shown.
Binary file not shown.
95 changes: 95 additions & 0 deletions org.dawnsci.squishtests/suite_autoprocessing/h5FileComparer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/bin/bash


###################################################################################################
# #
# Copyright (c) 2017 Diamond Light Source Ltd. #
# #
# All rights reserved. This program and the accompanying materials are made available under the #
# terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available #
# at http://www.eclipse.org/legal/epl-v10.html #
# #
###################################################################################################
# #
# This bash script is designed to take the output from data reduced from a development version of #
# DAWN and compare it to data obtained from a stable version of DAWN to deduce whether the #
# processing pipeline (and therefore autoprocessing) has been killed accidentally. #
# #
###################################################################################################
# #
# Last updated 2017-03-30 #
# #
# Author: Tim Snow (tim.snow@diamond.ac.uk) #
# #
###################################################################################################

# Script usage:
#
# h5FileComparer.sh fileOne fileTwo
#
# Script inputs are:
#
# fileOne - First file for comparing
# fileTwo - Second file for comparing
#
# Script exit codes are:
#
# 0 - Success! The files were the same!
# 1 - Failure! The files weren't the same...
# 2 - Failure! The first and second files couldn't be opened!
# 3 - Failure! The first file couldn't be opened!
# 4 - Failure! The second file couldn't be opened!
# 255 - Failure! You broke the script. Well done?


# First do our 'imports' or module loadings...
module load dawn > /dev/null 2>&1

# This script will take two arguments, which are files, and compare them.
# If it will inform the user either way as to what happened.

# Get the file inputs from the console
fileOne="$1"
fileTwo="$2"

# Run h5ls to see if the file exists
fileOneCheck="$(h5ls "$fileOne" 2>&1)"
fileTwoCheck="$(h5ls "$fileTwo" 2>&1)"

# Do the check
if [ "$fileOneCheck" == "$fileOne: unable to open file" ] && [ "$fileTwoCheck" == "$fileTwo: unable to open file" ]
then
echo "Can't open either of the files given in the two arguments"
exit 2

elif [ "$fileOneCheck" == "$fileOne: unable to open file" ]
then
echo "Can't open the file given in the first argument"
exit 3

elif [ "$fileTwoCheck" == "$fileTwo: unable to open file" ]
then
echo "Can't open the file given in the second argument"
exit 4
fi

# Then set up some strings so that the comparison responses are uniform
successString="Success"
failureString="Failure"

# Compare the files, getting back the standard string
fileCompare=$(cmp --silent <(h5ls -d "$fileOne"/entry/result/data) <(h5ls -d "$fileTwo"/entry/result/data) && echo "$successString" || echo "$failureString")

# Do the appropriate action if the files are or are not equal and handling for crazy results too
if [ "$fileCompare" == "$successString" ]
then
echo "Success! The files are the same!"
exit 0
elif [ "$fileCompare" == "$failureString" ]
then
echo "Failure! The files are not the same!"
exit 1
else
echo "Failure! Somehow you've broken this script"
exit 255
fi
96 changes: 96 additions & 0 deletions org.dawnsci.squishtests/suite_autoprocessing/h5FileComparer.sh~
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/bash


###################################################################################################
# #
# Copyright (c) 2017 Diamond Light Source Ltd. #
# #
# All rights reserved. This program and the accompanying materials are made available under the #
# terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available #
# at http://www.eclipse.org/legal/epl-v10.html #
# #
###################################################################################################
# #
# This bash script is designed to take the output from data reduced from a development version of #
# DAWN and compare it to data obtained from a stable version of DAWN to deduce whether the #
# processing pipeline (and therefore autoprocessing) has been killed accidentally. #
# #
# #
###################################################################################################
# #
# Last updated 2017-03-30 #
# #
# Author: Tim Snow (tim.snow@diamond.ac.uk) #
# #
###################################################################################################

# Script usage:
#
# h5FileComparer.sh fileOne fileTwo
#
# Script inputs are:
#
# fileOne - First file for comparing
# fileTwo - Second file for comparing
#
# Script exit codes are:
#
# 0 - Success! The files were the same!
# 1 - Failure! The files weren't the same...
# 2 - Failure! The first and second files couldn't be opened!
# 3 - Failure! The first file couldn't be opened!
# 4 - Failure! The second file couldn't be opened!
# 255 - Failure! You broke the script. Well done?


# First do our 'imports' or module loadings...
module load dawn > /dev/null 2>&1

# This script will take two arguments, which are files, and compare them.
# If it will inform the user either way as to what happened.

# Get the file inputs from the console
fileOne="$1"
fileTwo="$2"

# Run h5ls to see if the file exists
fileOneCheck="$(h5ls "$fileOne" 2>&1)"
fileTwoCheck="$(h5ls "$fileTwo" 2>&1)"

# Do the check
if [ "$fileOneCheck" == "$fileOne: unable to open file" ] && [ "$fileTwoCheck" == "$fileTwo: unable to open file" ]
then
echo "Can't open either of the files given in the two arguments"
exit 2

elif [ "$fileOneCheck" == "$fileOne: unable to open file" ]
then
echo "Can't open the file given in the first argument"
exit 3

elif [ "$fileTwoCheck" == "$fileTwo: unable to open file" ]
then
echo "Can't open the file given in the second argument"
exit 4
fi

# Then set up some strings so that the comparison responses are uniform
successString="Success"
failureString="Failure"

# Compare the files, getting back the standard string
fileCompare=$(cmp --silent <(h5ls -d "$fileOne"/entry/result/data) <(h5ls -d "$fileTwo"/entry/result/data) && echo "$successString" || echo "$failureString")

# Do the appropriate action if the files are or are not equal and handling for crazy results too
if [ "$fileCompare" == "$successString" ]
then
echo "Success! The files are the same!"
exit 0
elif [ "$fileCompare" == "$failureString" ]
then
echo "Failure! The files are not the same!"
exit 1
else
echo "Failure! Somehow you've broken this script"
exit 255
fi
Loading