Why Testing of a Release Artifact Matters
For an apache project, a VOTE on a release candidate is a very important process. By voting (particularly for PPMC members and committers), you are saying to the world that "yes, I have download, verified and tested using the project's procedure for testing". Your +1, 0 or -1 vote is an indication of the success of the steps listed.
The more time that each individual spends reviewing the artifacts, the higher confidence we can have in both the release itself and our ability to pass an IPMC vote later on. Remember, we, as a podling, are going to be held to a higher standard for our releases! The IPMC (and our mentors) are looking for us to show that we understand what it means to have a high quality release.
Test with source code release
To setup an environment for CloudStack, usually it will take a while, e.g install a hypervisor host, install Mysql server etc. Here we'll use DevCloud(http://wiki.cloudstack.org/display/COMM/DevCloud) to simplify the test procedure.
Following steps are tested on Mint 13, should work on ubuntu 12.04. The same basic workflow should also work on Mac 10.7, with different specific commands for the prerequisite setup steps. For Windows, you will need to run in cygwin and rename the genisoimage.exe file to mkisofs.
Unless specified specifically, instruction steps should be assumed to be run from your local machine, not from within the DevCloud VM. The DevCloud VM is the target runtime environment of the tests, but the instructions will push the code to that VM at the right time.
You can follow the following screencast to watch the entire procedure.
Install the devcloud VM image.
DevCloud is a 1.5 GB download. It is a VM image running Ubuntu 12.04, including an installation of the Xen Hypervisor. We use DevCloud as a "cloud in a box" environment for basic functional testing of CloudStack.
- Install VirtualBox(https://www.virtualbox.org/wiki/Downloads) on your machine.
- Note: If you are on Mac OS X(10.6 or below), must enable 64bit(http://support.apple.com/kb/HT3773)
- Download DevCloud image from http://download.cloud.com/templates/devcloud/DevCloud.ova into your machine.
- Import DevCloud.ova into VirtualBox:
- Open VirtualBox, File->Import Appliance->choose DevCloud.ova
- NOTE: Change the memory to 2046
- NOTE: please do NOT select "re-initialize the MAC address of all network cards"
- Start devcloud VM
- For more information about how to install devcloud, please refer to http://wiki.cloudstack.org/display/COMM/DevCloud
Install your required development tools (if not already available)
These pre-requisite development tools are not part of the release validation itself. The instructions are being provided for those testers that may not normally have these tools installed on their test system, and want to perform the expected tests. The pre-requisites listed may not be 100% complete (for example, we assume you have git, tar, etc... installed). If you run into any issues, please ask on the firstname.lastname@example.org mailing list.
Setup Pre-requisites on an Ubuntu 12.04 or Mint 13 machine
Install Boto (assumes you have Python and Setup Tools installed):
Setup Pre-requisites on OSX
OSX users should be able to use their default JVM for this testing.
OSX users need to have Apache Ant and Maven 3 installed.
Ant may already be on your system. Run
which ant to see. If not, Ant can be installed via MacPorts or from source.
Maven 3 can be installed with Homebrew, or can be downloaded and installed from the Maven homepage.
Next, you will need to install OS X tools:
- Install XCode from the AppStore (Xcode is around 1.53 GB, so it will take a while before this completes. Look at the "Purchases" window of the App Store to view the download progress)
- On Mac OS X, installation of Xcode via App Store doesn't actually install Xcode - you will need to go to Finder -> Applications -> Xcode and then you will be prompted to install Xcode.
- After the Xcode installation goes through, you will need to install the Command Line Tools for Xcode. To do this, open Xcode, and then, on the top left corner of the screen, click on Xcode -> Preferences. In the dialog box that opens, click on Downloads. There, click on Install for Command Line Tools.
Then you will need cdrtools, which is available as package in both Homebrew and MacPorts.
If after the above steps, for any reason,
mkisofs is still not installed, download it from the net. One good link to get mkisofs for Mac OS X is from Helios. Follow the instructions in the section "Download HELIOS 'mkisofs' tested binary versions". Use the
macosx86 binary if you're running mac os x on an intel platform. After downloading the
mkisofs binary, copy it over to
Next, you will need to install JSch.
First download the binary distribution of Ant.
Unpack the archive, and run:
Install Boto (assumes you have Python and Python Setup Tools already installed):
Test the Build
Clean up your environment (and DevCloud)
Since we have graduated from the incubator, the git remote URL thats embedded in the original DevCloud image is incorrect. Before following the step below, ssh into the devcloud image (run "ssh root@localhost -p 2222" and password is "password") and edit /opt/cloudstack/incubator-cloudstack/.git/config to modify the URL from https://git-wip-us.apache.org/repos/asf/*incubator-*cloudstack.git (https://git-wip-us.apache.org/repos/asf/*incubator\-*cloudstack.git) to https://git-wip-us.apache.org/repos/asf/cloudstack.git
Once that's done, exit from your ssh session back to your local system.
Type the password "password" when prompted to by SSH.
Download the source build
Some versions of wget will require that you add the --no-check-certificate param to the commands below. You need this, if you get an error stating "ERROR: The certificate of `dist.apache.org' is not trusted.".
Download the artifacts:
VERSION with the version you are testing.
Install gpg (if needed): sudo apt-get install gpg
This can be done by importing the keys stored in the source distribution's KEYS file: gpg --import KEYS
Alternatively, you could download the signing keys (ID's found in the KEYS file) individually via a keyserver. Ex: gpg --recv-keys CC56CEA8
Verify signatures and hash files:
This command should return "Good Signature".
Each of these commands should return no output. If there is any output from them, then there is a difference between the hash you generated locally and the hash that has been pulled from the server.
Extract the source code and verify the contents:
Get the commit hash from the VOTE email (ex: 4cd60f3d1683a3445c3248f48ae064fb573db2a1). The value will change between releases.
Create two new temporary directories:
Pull down the git repo:
Unpack the release artifact:
Compare the contents of the release artifact with the contents pulled from the repo:
Nothing should be different.
Verify the Code's License Headers
The build should FAIL if there are any non-compliant files that are not specifically excluded from the ASF license header requirement. You can optionally review the target/rat.txt file after the run completes. If the build passes, RAT is saying that we are compliant and this test passes.
Note: If you're on Ubuntu and using the PPA:natecarlson/maven3 (viz. Installing tools above), you've to use mvn3 instead of mvn, so mvn3 -P deps
Deploy into the DevCloud VM
Start CloudStack management server
Configure CloudStack management server
- Access web UI: http://localhost:8080/client
- Login with admin/password
- Choose "I have used cloudstack before, skip this guide"
- Click "Infrastructure", click the "View All" button in the "Zones" display box, click "add zone"
- Select "basic zone" during the add zone wizard.
- Type name "test cloud", dns1 "184.108.40.206", internal dns1 "10.0.2.3", hypervisor "Xenserver", select "local storage enabled" (Say Yes if prompted to agree), then click next.
- Skip "physical network setup" page
- In "pod" page, type: pod name: 'test pod', reserved system gateway: 10.0.2.2, reserved system mask: 255.255.255.0, start reserved system ip: 10.0.2.200, end reserved system ip: 10.0.2.220
- In "guest traffic" page, guest gateway: 10.0.2.2, netmask: 255.255.255.0, guest start ip: 10.0.2.100, guest end ip: 10.0.2.199
- In "cluster" page, type cluster name: "test cluster"
- In "host " page, host name: 10.0.2.15, user name: root, password: password
- In "secondary storage" page, server: 10.0.2.15, path: /opt/storage/secondary
- In "zone creation comple", select "yes" to enable zone.
Wait for secondary storage VM coming up.
Depending on your local system configuration, and available RAM / Disk IO / Net IO, this step will take varied amounts of time. It's reasonable to expect 30 minutes (or more), but it could be less.
You can tell if the SSVM has been started by navigating to the Infrastructure page, and clicking on System VMs. There should be 2 listed, and their status needs to be displayed as "Started".
Add a new instance
- In the first step of "Add instance " wizard , select template,
- In step 2, select "tiny Linux"
- In step 3, select "tinyOffering"
- In step 4, select "No thanks"
- Skip step 5 and 6.
- Launch VM
Set some Global Settings
In the UI, set the following global settings:
- expunge.interval = 120
- expunge.delay = 120
- enable.ec2.api = true
Now CTL-C your rdebug, and then "ant rdebug" again (to restart the management server). This step is critical!
Go to the instances list, click on the name of your new instance, and then click on the "show console" button. The console of the VM should appear in a new window.
Stop the instance
Destroy the instance.
Wait for at least 2 minutes for the instance to be expunged (you can confirm that it has, by ssh'ing into devcloud and running xe vm-list to see if it's no longer listed).
Destroying the instance is important, and confirming that it was expunged prior to trying to test the EC2 API. This is due to the resource constraints on the DevCloud image.
- Under Accounts, generate keys for the admin user in the admin account (save these for future use)
- Under service offerings, rename tinyOffering as m1.small
- In your Virtual Box settings, forward port 7080 to local port 7080
- In your local machine, cd into the awsapi-setup/setup folder of the source
- Use the python script cloudstack-aws-api-register to register the user. Like so:
In case you don't have a X509 ssl certificate, this is how you can generate one:
You can specify an empty file as cert but use the keys generated in the GUI (ex: touch /tmp/cert.pem). Executing this with an empty cert file will result in an error that can be ignored for this test. Regardless of this error, if the registration works you should see the credentials in the cloudbridge database in the usercredentials table.
Within the DevCloud VM (as root):
select * from usercredentials;
You should see your account as the only row in that table.
- Use a python script similar as below (change the keys) to launch an instance:
- Confirm that the instance started via the GUI.
If we made it this far, the release has at least been reasonably "smoke tested".