Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
test framework changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BuzzTroll committed Aug 16, 2010
1 parent fb1dca9 commit 446b505
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
9 changes: 5 additions & 4 deletions tests/bt-nimbus.sh
@@ -1,16 +1,18 @@
#!/bin/bash

work_dir=$1
bkdate=`date +%s`
function on_exit()
{
# rm -rf $work_dir
echo "Cleaning up! $bkdate"
rm -rf $work_dir
rm -rf ~/.nimbus
rm -rf ~/.globus
mv ~/.nimbus.$bkdate ~/.nimbus
mv ~/.globus.$bkdate ~/.globus
mv ~/.ssh.$bkdate ~/.ssh
}

bkdate=`date +%s`
if [ "X$work_dir" == "X" ]; then
work_dir=`mktemp --tmpdir=$HOME -d -t tmp.XXXXXXXXXX`
mv ~/.ssh ~/.ssh.$bkdate
Expand Down Expand Up @@ -52,10 +54,9 @@ cd $src_dir
cnt="0"
error_cnt="0"
error_ts=""
touch test.log
for t in *test.{sh,py}
do
./$t | tee -a test.log
./$t 2>&1 | tee $t.log
if [ $PIPESTATUS -ne 0 ]; then
echo "$cnt parent tests passed (many more subtests were run)"
echo "the test $t failed"
Expand Down
Empty file modified tests/cc-list-test.py 100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions tests/cc1-test.sh
@@ -1,5 +1,7 @@
#!/bin/bash

ls -l ~/.ssh/

cd $CLOUD_CLIENT_HOME
./bin/grid-proxy-init.sh
./bin/cloud-client.sh --delete --name group
Expand Down
11 changes: 11 additions & 0 deletions tests/install-nim.py
@@ -1,5 +1,7 @@
import pexpect
import sys
from ConfigParser import SafeConfigParser


cmd = "%s %s" % (sys.argv[1], sys.argv[2])
logfile = sys.stdout
Expand All @@ -12,3 +14,12 @@
child.sendline ('localhost')
x = child.readlines()
print x

try:
print "setting up ssh knowhosts"
child = pexpect.spawn (cmd, timeout=8, maxread=20000, logfile=logfile)
child.expect ('(yes/no)?')
print child.before
child.sendline ('yes')
except:
pass
19 changes: 17 additions & 2 deletions tests/make-test-env.sh
Expand Up @@ -7,6 +7,21 @@ if [ "X$work_dir" == "X" ]; then
exit 1
fi

if [ -e $HOME/.ssh ]; then
echo "this will destroy your .ssh dir! please back it up first"
exit 1
fi
if [ -e $HOME/.globus ]; then
echo "this will destroy your .globus dir! please back it up first"
exit 1
fi
if [ -e $HOME/.nimbus ]; then
echo "this will destroy your .nimbus dir! please back it up first"
exit 1
fi



bd=`dirname $0`
cd $bd
src_dir=`pwd`
Expand Down Expand Up @@ -38,13 +53,13 @@ echo "Configuring propagation only mode"
echo "========================================="

cp -r $repo_dir/nimbus/control/ $work_dir
ssh-keygen -N "" -f $work_dir/keys
ssh-keygen -N "" -f ~/.ssh/id_rsa
cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys.back.$bkdate
touch ~/.ssh/authorized_keys
cat $work_dir/keys.pub >> ~/.ssh/authorized_keys
user=`whoami`

sed -e "s^@KEY@^$work_dir/keys^" -e "s/@WHO@/$user/" $src_dir/autoconfig-decisions.sh.in > $install_dir/services/share/nimbus-autoconfig/autoconfig-decisions.sh
sed -e "s^@KEY@^$HOME/.ssh/id_rsa^" -e "s/@WHO@/$user/" $src_dir/autoconfig-decisions.sh.in > $install_dir/services/share/nimbus-autoconfig/autoconfig-decisions.sh

cat $install_dir/services/share/nimbus-autoconfig/autoconfig-decisions.sh

Expand Down

0 comments on commit 446b505

Please sign in to comment.