diff --git a/oem/ami/test_ami.sh b/oem/ami/test_ami.sh index ecab82cfcf..0377bc286d 100755 --- a/oem/ami/test_ami.sh +++ b/oem/ami/test_ami.sh @@ -123,7 +123,37 @@ for host in ${ips[@]}; do done echo "OK" +AUTOTEST_DIR=$(mktemp -d) +trap 'cd /; rm -rf "${AUTOTEST_DIR}"' EXIT +cd "${AUTOTEST_DIR}" + +wget https://github.com/autotest/autotest/archive/0.15.1.tar.gz +tar -xzf 0.15.1.tar.gz +git clone git://github.com/coreos/coreos-autotest.git + +cp -r ./coreos-autotest/client/* ./autotest-0.15.1/client/tests + +cp ~/.ssh/config ~/.ssh/config.back + +for host in ${ips[@]}; do +echo <> ~/.ssh/config +Host $host +User core +IdentityFile $key_file +EOF +done + +sed -i 's_/usr/local/autotest,/home/autotest_/tmp/autotest_' /tmp/autotest-0.15.1/global_config.ini + +cd ./autotest-0.15.1 + +for file in find -wholename "./client/tests/coreos_*/control" +do + ./server/autotest-remote -m ${ips} -c ${file} --install-in-tmpdir --ssh-user core +done + echo -n "Cleaning up environment... " +cp ~/.ssh/config.back ~/.ssh/config ec2-terminate-instances $instances > /dev/null while ! $ec2_cmd | grep INSTANCE | grep -q terminated do sleep 10; done