Skip to content

Commit

Permalink
what a rotten piece of software
Browse files Browse the repository at this point in the history
  • Loading branch information
ksrodarmer committed Jul 7, 2016
2 parents 9e5544c + b0f74e2 commit f33890e
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 9 deletions.
17 changes: 13 additions & 4 deletions test/fuse/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#
# ===========================================================================

default: slowtests
default: runtests

runtests:

TOP ?= $(abspath ../..)

Expand Down Expand Up @@ -60,11 +62,18 @@ $(TEST_BINDIR)/remote-fuser-test: $(REMOTE_FUSER_TEST_OBJ)
# slowtests: match output vs sra-pileup
#

slowtests: runtests

runtests: run-test
ifeq (linux,$(BUILD_OS))
ifneq (Ubuntu,$(OS_DISTRIBUTOR))
slowtests: run-test

run-test: $(TEST_BINDIR)/remote-fuser-test
@$(SRCDIR)/remote_fuser_test.sh standard 180 $(TARGDIR)/bin

else
slowtests:
endif
else
slowtests:
endif

.PHONY: run-test
52 changes: 49 additions & 3 deletions test/fuse/remote_fuser_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,15 @@ fi
####
## Checking config file data and prepareing environment
#
if [ -z "$USER" ]
EFF_USER=$USER
if [ -z "$EFF_USER" ]
then
_err_exit "Environment variable \$USER is not set"
EFF_USER=`id -n -u`
if [ -z "$EFF_USER" ]
then
EFF_USER="undefined-user"
# _err_exit "Environment variable \$USER is not set"
fi
fi

if [ -z "$TEST_DIR" ]
Expand All @@ -235,7 +241,7 @@ then
_err_exit "Can not stat directory '$TEST_DIR'"
fi

F_TEST_DIR=$TEST_DIR/$USER
F_TEST_DIR=$TEST_DIR/$EFF_USER
if [ ! -d "$F_TEST_DIR" ]
then
_msg "Creating directory '$F_TEST_DIR'"
Expand Down Expand Up @@ -314,6 +320,46 @@ then
_err_exit "Mount point is in use '$F_MOUNT_DIR'"
fi


## Here we are clearing old logs
##
DAYS_KEEP_LOG=10

SEC_IN_DAY=$(( 60 * 60 * 24 ))
NOW_DAY=$(( `date +%s` / $SEC_IN_DAY ))

check_remove ()
{
F2R=$1

if [ -n "$F2R" ]
then
FILE_DAY=$(( `stat --print="%X" $F2R` / $SEC_IN_DAY ))
DALT=$(( $NOW_DAY - $FILE_DAY ))
if [ $DAYS_KEEP_LOG -le $DALT ]
then
_msg Log file is $DALT days old, removing \'$F2R\'
echo rm -f $F2R
if [ $? -ne 0 ]
then
_wrn Can not remove file \'$F2R\'
fi
fi
fi
}

clear_old_logs ()
{
_msg Clearing old logs ...

for i in `ls $F_LOG_DIR`
do
check_remove $F_LOG_DIR/$i
done
}

clear_old_logs

## Here we are logging and execing
##
F_TIME_STAMP=`date +%Y-%m-%d_%H-%M-%S`
Expand Down
15 changes: 15 additions & 0 deletions test/kar/kar-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ test_list ()
echo "Testing test mode..."
if ! $KAR -t $ARCHIVE > /dev/null
then
STATUS=$?
echo "KAR listing failed"
cleanup
exit 1
Expand All @@ -168,6 +169,7 @@ test_list ()
echo " Testing option variation --test ..."
if ! $KAR --test $ARCHIVE > /dev/null
then
STATUS=$?
echo "KAR listing failed"
cleanup
exit 1
Expand All @@ -179,6 +181,7 @@ test_list_options ()
echo " Testing longlist: -l mode..."
if ! $KAR -l -t $ARCHIVE > /dev/null
then
STATUS=$?
echo "KAR long listing failed"
cleanup
exit 1
Expand All @@ -191,6 +194,7 @@ test_extract ()
DIR="extracted"
if ! $KAR -x $ARCHIVE -d $DIR
then
STATUS=$?
echo "KAR extraction failed"
cleanup
exit 1
Expand All @@ -202,6 +206,7 @@ test_extract ()
DIR="extracted"
if ! $KAR --extract $ARCHIVE -d $DIR
then
STATUS=$?
echo "KAR extraction failed"
cleanup
exit 1
Expand All @@ -223,20 +228,23 @@ test_cNew_txOld_cmp ()

if ! $OLDKAR -t $ARCHIVE > $RESULT/olist.txt
then
STATUS=$?
echo " legacy-KAR could not test the archive...failed"
cleanup
exit 1
fi

if ! $OLDKAR -l -t $ARCHIVE > $RESULT/ollist.txt
then
STATUS=$?
echo " legacy-KAR could not test the archive with longlist...failed"
cleanup
exit 1
fi

if ! $OLDKAR -x $ARCHIVE -d $RESULT/o_extracted
then
STATUS=$?
echo " legacy-KAR could not extract the archive...failed"
cleanup
exit 1
Expand All @@ -248,6 +256,7 @@ test_cNew_txOld_cmp ()
$KAR -t $ARCHIVE > $RESULT/nlist.txt
if ! diff -w $RESULT/olist.txt $RESULT/nlist.txt > $RESULT/diff.txt
then
STATUS=$?
echo " KAR listing differs from legacy...test failed"
cat $RESULT/diff.txt
cleanup
Expand All @@ -265,6 +274,7 @@ test_cNew_txOld_cmp ()

if [ -s $RESULT/diff.txt ]
then
STATUS=$?
echo " KAR extracting content differs from legacy...test failed"
cat $RESULT/diff.txt
cleanup
Expand Down Expand Up @@ -293,6 +303,7 @@ test_cOld_txNew_cmp ()

if ! $KAR -t $ARCHIVE > $RESULT/nlist.txt
then
STATUS=$?
echo " KAR could not test the archive...failed"
rm -rf $SS
cleanup
Expand All @@ -301,6 +312,7 @@ test_cOld_txNew_cmp ()

if ! $KAR -l -t $ARCHIVE > $RESULT/nllist.txt
then
STATUS=$?
echo " KAR could not test the archive with longlist...failed"
rm -rf $SS
cleanup
Expand All @@ -309,6 +321,7 @@ test_cOld_txNew_cmp ()

if ! $KAR -x $ARCHIVE -d $RESULT/n_extracted
then
STATUS=$?
echo " KAR could not extract the archive...failed"
rm -rf $SS
cleanup
Expand All @@ -321,6 +334,7 @@ test_cOld_txNew_cmp ()
$OLDKAR -t $ARCHIVE > $RESULT/olist.txt
if ! diff -w $RESULT/nlist.txt $RESULT/olist.txt > $RESULT/diff.txt
then
STATUS=$?
echo " KAR listing differs from legacy...test failed"
cat $RESULT/diff.txt
cleanup
Expand All @@ -338,6 +352,7 @@ test_cOld_txNew_cmp ()

if [ -s $RESULT/diff.txt ]
then
STATUS=$?
echo " KAR extracting content differs from legacy...test failed"
cat $RESULT/diff.txt
cleanup
Expand Down
4 changes: 2 additions & 2 deletions tools/bam-loader/loader-imp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2108,12 +2108,12 @@ static rc_t ProcessBAM(char const bamFile[], context_t *ctx, VDatabase *db,
else if (rl != clipped_rl) {
if (isPrimary) {
rc = RC(rcApp, rcFile, rcReading, rcConstraint, rcViolated);
(void)PLOGERR(klogErr, (klogErr, rc, "Primary alignment for '$(name)' has different length ($(len)) then previously recorded secondary alignment. Try to defer secondary alignment processing.",
(void)PLOGERR(klogErr, (klogErr, rc, "Primary alignment for '$(name)' has different length ($(len)) than previously recorded secondary alignment. Try to defer secondary alignment processing.",
"name=%s,len=%d", name, readlen));
}
else {
rc = SILENT_RC(rcApp, rcFile, rcReading, rcConstraint, rcViolated);
(void)PLOGERR(klogWarn, (klogWarn, rc, "Secondary alignment for '$(name)' has different length ($(len)) then previously recorded primary alignment; discarding secondary alignment.",
(void)PLOGERR(klogWarn, (klogWarn, rc, "Secondary alignment for '$(name)' has different length ($(len)) than previously recorded primary alignment; discarding secondary alignment.",
"name=%s,len=%d", name, readlen));
DISCARD_BAD_SECONDARY;
rc = CheckLimitAndLogError();
Expand Down

0 comments on commit f33890e

Please sign in to comment.