This post will lead you through the creation of an environment to run automated test plans against a Eucalyptus installation. The tools used were described in my previous post, namely Jenkins (orchestrator), Testlink (planning & metadata), Eutester (functional testing framework). The use case we will be attacking is that of the Developer QA system sandbox.
The only requirements for this setup:
- Your machine can run Jenkins
- Python 2.6 or greater installed
- Python virtualenv is installed (easy_install virtualenv)
- Git is installed
Once complete you should be able to run test plans against a running cloud with the click of a button. This has only been tested on my Macbook but should work on any platform that can meet these requirements.
The first step in getting this system up and running is to download and install Jenkins on the desired host machine. When completing this exercise I was using my Mac laptop which led me to use the installer found on the right side of this page: Download Jenkins. Further installation instructions for Linux and Windows can be found here: Installing Jenkins.
Once the installation is complete, point your we browser to port 8080 of the machine you installed Jenkins on, for example http://yourjenkins.machine:8080. You should now be presented with the main Jenkins dashboard which looks like this:
Installing Jenkins Plugins
The setup we are trying to achieve requires that you install a Jenkins plugin. Luckily for us Jenkins makes this installation a breeze:
- Go to your Jenkins URL in a web browser
- Click Manage Jenkins on the left
- Click Manage Plugins
- Click the Available tab
- Install the following required plugin by clicking the checkbox on the left of the row on all of them and then clicking “Download now and install after restart” at the bottom of the page
- Once the installation is complete click the checkbox to restart Jenkins when there are no jobs running (ie now).
Configure Testlink Plugin
In order to access standardized test plans that are implemented by Eutester scripts and cataloged by Testlink we need to setup the Jenkins Testlink plugin as follows:
- Click Manage Jenkinson the left
- Click Configure System
- Scroll down to the Testlink Section and click the Add button to configure a new Testlink installation to use when pulling test plans and test cases
- Configure the options presented as follows:
- Click Save at the bottom of the page
Now that we have Jenkins and its Testlink plugin configured we need to add a job that uses this functionality. For users not wishing know the internals of the job, instructions follow for importing the pre-built job. For the advanced/curious user the internals of the job are explained in another blog post.
Importing the Pre-configured Job
- Go to your Jenkins home directory (Mac: /Users/Shared/Jenkins/Home, Linux: /var/lib/jenkins) in a terminal
- Create a directory called testlink-testplan in the $JENKINS_HOME/jobs directory
- Copy this config file to that directory: Job Config
- Change the ownership of the entire testlink-testplan directory to the jenkins user:
- chown -R jenkins:jenkins $JENKINS_HOME/jobs/testlink-testplan
- Go to the Manage Jenkins page then click Reload Configuration from Disk
- Upon returning to the main dashboard you should see your job ready to run.
- You can now skip down to the section below entitled Running and Viewing Your Test if you do not care to know the internals of the job.
Running and Viewing Your Test
Running the test
- In order to run the test job we have just configured return to the Jenkins main dashboard by clicking Jenkinsin the top left corner of the Jenkins page.
- Click the Build Now button on the left of the testlink-testplan job
- Ensure that parameters are set properly. The defaults should work other than the topology which will require the IPs of the machines you are trying to test against.
Viewing the test
- On the left side of the screen you should see the Build History which should now show at least 1 job running. Look for a build with a blue progress bar under it.
- If you would like to see the console output of the currently running test click the blue progress bar.
- If you would like to see the main page for the build click the date above the blue progress bar. This screen shows a summary of the test results and any archived artifacts when the build has completed.
- The trend button will show a plot of the test duration over time.
You can rinse and repeat as many times as you’d like with this procedure.
Testcases and Testplans
Currently the only testplan available is CloudBasics but soon more testcases and plans will be added. I will make sure to update this blog post with the latest list.