Skip to content

Instantly share code, notes, and snippets.

@kushaldas
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kushaldas/1bd8a6339ca59399a960 to your computer and use it in GitHub Desktop.
Save kushaldas/1bd8a6339ca59399a960 to your computer and use it in GitHub Desktop.
Example script to test the cloud images
# Let us download the image first
wget $1
if [ $? -ne 0 ]
then
echo "Downloading $1 failed."
exit 1
fi
# Now we need the filename
FILENAME=`basename $1`
cat > /root/fedora.txt << EOF
curl -O https://kushal.fedorapeople.org/tunirtests.tar.gz
tar -xzvf tunirtests.tar.gz
sudo python -m unittest tunirtests.cloudtests
sudo systemctl stop crond.service
@@ sudo systemctl disable crond.service
@@ sudo reboot
SLEEP 30
sudo python -m unittest tunirtests.cloudservice.TestServiceManipulation
@@ sudo reboot
SLEEP 30
sudo python -m unittest tunirtests.cloudservice.TestServiceAfter
EOF
cat > /root/fedora.json << EOF
{ "name": "fedora", "type": "vm", "image": "file:///root/$FILENAME", "ram": 2048, "user": "fedora", "password": "passw0rd"}
EOF
tunir --job fedora --stateless
if [ $? -ne 0 ]
then
echo "Tests failed."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment