progress on getting a working test configuration
diff --git a/tools/build_uec.sh b/tools/build_uec.sh
index bbb8b37..2fb8b50 100755
--- a/tools/build_uec.sh
+++ b/tools/build_uec.sh
@@ -187,6 +187,29 @@
ROOTSLEEP=0
`cat $TOP_DIR/localrc`
LOCAL_EOF
+EOF
+
+# Setup stack user with our key
+if [ -e ~/.ssh/id_rsa.pub ]; then
+ cat > $vm_dir/uec/user-data<<EOF
+mkdir -p /opt/stack
+useradd stack -s /bin/bash -d /opt/stack -G libvirtd || true
+echo stack:pass | chpasswd
+mkdir -p /opt/stack/.ssh
+echo `cat ~/.ssh/id_rsa.pub` > /opt/stack/.ssh/authorized_keys
+chown -R stack /opt/stack
+chmod 700 /opt/stack/.ssh
+chmod 600 /opt/stack/.ssh/authorized_keys
+
+grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers ||
+ echo "#includedir /etc/sudoers.d" >> /etc/sudoers
+( umask 226 && echo "stack ALL=(ALL) NOPASSWD:ALL" \
+ > /etc/sudoers.d/50_stack_sh )
+EOF
+fi
+
+# Run stack.sh
+cat > $vm_dir/uec/user-data<<EOF
./stack.sh
EOF
diff --git a/tools/jenkins/adapters/euca.sh b/tools/jenkins/adapters/euca.sh
index 3cd9710..b49ce9f 100755
--- a/tools/jenkins/adapters/euca.sh
+++ b/tools/jenkins/adapters/euca.sh
@@ -1,3 +1,8 @@
#!/bin/bash
+# Echo commands, exit on error
+set -o xtrace
+set -o errexit
-echo "$0 SUCCESS!"
+TOP_DIR=$(cd ../../.. && pwd)
+HEAD_IP=`cat $TOP_DIR/addresses | grep HEAD | cut -d "=" -f2`
+ssh stack@$HEAD_IP 'cd devstack && source openrc && cd exercises && ./euca.sh'
diff --git a/tools/jenkins/configurations/kvm.sh b/tools/jenkins/configurations/kvm.sh
index 7c641d2..a6ac297 100755
--- a/tools/jenkins/configurations/kvm.sh
+++ b/tools/jenkins/configurations/kvm.sh
@@ -49,3 +49,6 @@
EOF
cd tools
sudo ./build_uec.sh
+
+# Make the address of the instances available to test runners
+echo HEAD=`cat /var/lib/libvirt/dnsmasq/$BASE_NAME.leases | cut -d " " -f3` > $TOP_DIR/addresses
diff --git a/tools/jenkins/jenkins_home/build_jenkins.sh b/tools/jenkins/jenkins_home/build_jenkins.sh
index 567a056..1a3407f 100755
--- a/tools/jenkins/jenkins_home/build_jenkins.sh
+++ b/tools/jenkins/jenkins_home/build_jenkins.sh
@@ -10,6 +10,13 @@
exit 1
fi
+# Make sure user has configured an ssh pubkey
+if [ ! -e /root/.ssh/id_rsa.pub ]; then
+ echo "Public key is missing. This is used to ssh into your instances."
+ echo "Please run ssh-keygen before proceeding"
+ exit 1
+fi
+
# This directory
CUR_DIR=$(cd $(dirname "$0") && pwd)
diff --git a/tools/setup_stack_user.sh b/tools/setup_stack_user.sh
index 231a20f..fcb9733 100755
--- a/tools/setup_stack_user.sh
+++ b/tools/setup_stack_user.sh
@@ -49,10 +49,6 @@
cp $TOP_DIR/files/sudo/* $STAGING_DIR/etc/sudoers.d/
sed -e "s,%USER%,$USER,g" -i $STAGING_DIR/etc/sudoers.d/*
-# and has sudo ability (in the future this should be limited to only what
-# stack requires)
-echo "stack ALL=(ALL) NOPASSWD: ALL" >> $STAGING_DIR/etc/sudoers
-
# Gracefully cp only if source file/dir exists
function cp_it {
if [ -e $1 ] || [ -d $1 ]; then