home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / test / run-nightly < prev    next >
Text File  |  2010-09-29  |  3KB  |  118 lines

  1. #!/bin/sh
  2. #
  3. #
  4. #
  5. #set -x
  6.  
  7. if [ $# -lt 1 ]; then
  8.    echo "Usage: $0 <tagnames>"
  9.    echo "        e.g. $0 HEAD Orange-Branch"
  10.    exit 0
  11. fi
  12.  
  13. # CVS tags to check out and test
  14. #CVSTAGS="HEAD Orange-Branch"
  15. #CVSTAGS="Orange-Branch"
  16. CVSTAGS=$*
  17. echo "Testing tags $CVSTAGS"
  18.  
  19. export CVSROOT=cvs.parl.clemson.edu:/projects/cvsroot
  20. export CVS_RSH=/usr/bin/ssh
  21.  
  22. # directory paths
  23. PATH_SUFFIX=$(cd `dirname $0`; pwd)
  24. thedate=`date +%Y%m%d`
  25. base_dir=/tmp/$USER/pvfs2-nightly/$thedate
  26. #auto_dir=/usr/local/pvfs2-nightly/test/automated
  27. auto_dir=${PATH_SUFFIX}/automated
  28. orange_tests_dir=/usr/local/pvfs2-nightly/orange-tests.d
  29.  
  30. # diff files we want to be emailed 
  31. email_diffs=""
  32. email="${USER}@clemson.edu"
  33.  
  34.  
  35. # cleans up previous runs and makes new run directory
  36. initial_setup () {
  37.   # remove any previous run
  38.   if [ ! -d /tmp/$USER/pvfs2-nightly ]; then
  39.     mkdir -p /tmp/$USER/pvfs2-nightly
  40.   fi
  41.   if [ -d $base_dir ]; then
  42.         new_name=$base_dir.`ls -ld --time-style=long-iso $base_dir | cut -d ' ' -f 7`
  43.         echo "Renaming existing test directory $base_dir to $new_name."
  44.         mv $base_dir $new_name
  45.   fi
  46.   rm -fr $base_dir 2>&1 > /dev/null
  47.   mkdir -p $base_dir
  48. }
  49.  
  50.  
  51.  
  52. # show differences between CVS tags
  53. diff_pvfs_tags () {
  54.   diffs_exist=0
  55.   cd $base_dir
  56.   # do a cvs rdiff on each branch tag
  57.   for tag1 in $CVSTAGS
  58.   do
  59.     for tag2 in $CVSTAGS
  60.     do
  61.       if [ "$tag1" != "$tag2" ]; then
  62.         diffs_exist=1
  63.         cvs -Q rdiff -R -s -r $tag1 -r $tag2 pvfs2 >  ${tag1}_vs_${tag2}.diff 
  64.       fi
  65.     done
  66.   done
  67.   # email any requested diffs
  68.   if [ "$diffs_exists" = "1" ]; then
  69.     cd $base_dir
  70.     for file1 in `ls *.diff`
  71.     do
  72.       for file2 in $email_diffs
  73.       do
  74.         if [ "$file1" = "$file2" ]; then
  75.           mailx -s "orange nightly: $file2" $email < $base_dir/$file2
  76.         fi
  77.       done
  78.     done
  79.   fi
  80. }
  81.  
  82.  
  83. # Runs the standard PVFS build tests and also runs
  84. # the orange performance tests
  85. run_pvfs_tests () {
  86.   tag=$1
  87.   mkdir -p $base_dir/$tag
  88.   mkdir -p $base_dir/$tag/mount
  89.   cd $auto_dir
  90.   # generate the test config file 
  91.   cat > /tmp/$USER/nightly-tests.cfg << EOF
  92. export CVS_TAG="$tag"
  93. export PVFS2_DEST=$base_dir/$tag
  94. #export PVFS2_MOUNTPOINT=/scratch/pvfs2-nightly
  95. export PVFS2_MOUNTPOINT=$base_dir/$tag/mount
  96. EOF
  97.   # Run the standard PVFS tests
  98.   ./testscrpt.sh
  99.  
  100.   # now run the orange performance tests
  101. #  cd $orange_tests_dir
  102. #  for i in `ls *.pbs` 
  103. #  do
  104. #    cd $base_dir/$tag
  105. #    ssh -t user001 qsub -v CVS_TAG=$tag,PVFS2_DEST=$base_dir/$tag -o $base_dir/$tag/${i}-${tag}.stdout -e $base_dir/$tag/${i}-${tag}.stderr $orange_tests_dir/$i
  106. #  done
  107. }
  108.  
  109.  
  110. ### Main program
  111. initial_setup
  112. diff_pvfs_tags
  113.  
  114. for tag in $CVSTAGS
  115. do
  116.   run_pvfs_tests $tag
  117. done
  118.