compare-to-references.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 status=0
4 
5 prefix=$CETPKG_SOURCE/test/MessageService
6 refsubdir=$prefix/output-references/ELdestinationTester
7 
8 for testdir in `find -type d -wholename "*test/MessageService/*.d"`
9 do
10 
11  # Get reference directory
12  dirSuffix=${testdir#*messagefacility_}
13  dirId=${dirSuffix%_t.d}
14  refdir=$refsubdir/$dirId
15 
16  # If testdir is not empty, redact timestamps, which will not be
17  # the same wrt reference
18  if test "$(ls -A "$testdir")"; then
19  for file in $testdir/*
20  do
21  sed -r -f $prefix/filter-timestamps.sed $file > tmp
22  mv tmp $file
23  done
24  else
25  if [ -d ${refdir} ]; then
26  echo Directory $testdir should not be empty! It should contain:
27  echo `ls ${refdir}/`
28  else continue
29  fi
30  fi
31 
32  # Compare outputs
33  diff -rq $testdir $refdir
34 
35 done
36 
37 exit $status