Revision 69df44f7b79e82ded025ccbee4b1153c8b844204 authored by Emmanuel Thomé on 24 November 2010, 11:15:57 UTC, committed by Emmanuel Thomé on 24 November 2010, 11:15:57 UTC
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/cado-nfs/trunk@441 3eaf19af-ecc0-40f6-b43f-672aa0c71c71
1 parent 879dcae
Raw File
nightly-test
#!/bin/sh
# Usage: nightly-test <MAKE_ARGS>
# If you use this in your crontab, since cron does not have access to
# ssh-agent, a trick is the following:
# 1) run from your home directory: ssh-keygen -N "" -t rsa -f .ssh/cle_gforge
#    This will create a ssh key with empty passphrase in .ssh/cle_gforge,
#    with the public key in .ssh/cle_gforge.pub
# 2) add the content of .ssh/cle_gforge.pub in the list of your ssh keys on
#    gforge.inria.fr (this will be added in authorized_keys)
# 3) add the following lines in your .ssh/config file:
# Host scm.gforge.inria.fr
#    IdentityFile /users/mygroup/mylogin/.ssh/cle_gforge
# 4) you need to add also the lines:
# Host localhost
#    StrictHostKeyChecking no
#    UserKnownHostsFile /dev/null
#    IdentityFile /users/mygroup/mylogin/.ssh/cle_gforge
#    in the .ssh/config file on the computer on which you run nightly-test, and
#    to add the content of cle_gforge.pub in the authorized_keys on that computer.
set -e
# If the DIR variable is set, then use it as the basename of the temp directory.
if ! [ "$DIR" ] ; then
    DIR=`mktemp -d /tmp/cado-nightly.XXXXXXXX`
else
    /bin/rm -fr "$DIR"
    mkdir "$DIR"
fi

# The following test should be useless, but let's be paranoid.
test ! -h "$DIR"
cd $DIR

# If the USER variable is set, use it instead of the login name for doing
# the checkout.
: ${USER=`whoami`}

if [ "$GIT" ] ; then
    git clone --depth 2 $GIT scm
    SCM=scm/
else
    svn checkout -q svn://scm.gforge.inria.fr/svn/cado-nfs/trunk/ scm
    SCM=scm
fi

CADO_VERSION=snapshot-`date +%Y%m%d%H%M`
export CADO_VERSION

# first build a tarball
make -C $SCM dist

# now extract the tarball and test it
tar zxf $SCM/cado-nfs-$CADO_VERSION.tar.gz

# If the cado repository contains a local.sh for this machine, use it.
h=`hostname`
if [ -f "$SCM/local.sh.$h" ] ; then
    echo "Using local.sh.$h"
    cp -f $SCM/local.sh.$h  cado-nfs-$CADO_VERSION/local.sh
fi

cd cado-nfs-$CADO_VERSION
echo -n "Starting compilation at: "
date
make "$@"
echo -n "Starting factorization at: "
date
CADO_COLOR=0 ./factor.sh 71641520761751435455133616475667090434063332228247871795429 -t 4 -ssh expected_factorization=200429218120815554269743635437,357440504101388365610785389017
CADO_COLOR=0 ./factor.sh 90377629292003121684002147101760858109247336549001090677693 -t 2 expected_factorization=260938498861057,588120598053661,760926063870977,773951836515617

/bin/rm -fr "$DIR"
back to top