Last active
August 29, 2015 14:25
-
-
Save kushaldas/1bd8a6339ca59399a960 to your computer and use it in GitHub Desktop.
Example script to test the cloud images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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