Ubuntu Server EC2 AMI
The following tests are to be run on each candidate AMI (each combination of region, arch, root-device). Some utilities for launching all instances and collecting data is available at lp:~smoser/+junk/ec2-test.
Multiple Instance Run
Start 10 instances ('--instance-count') in the same availability zone. [optional for EBS root]
Start an instance of each type ('--instance-type').
- i386: m1.small c1.medium
- x86_64: m1.large m1.xlarge c1.xlarge . Optional: m2.xlarge m2.2xlarge m2.4xlarge
Start an instance in each availability zone ('--availability-zone') [optional for EBS root].
For each of the instances, verify it is functional:
'ssh-keyscan -t rsa,dsa $hostname': should differ for each instance
you can ssh to instance as 'ubuntu@${hostname}'
ubuntu user can 'sudo' without password prompt, and that 'sudo -l' contains '(ALL) NOPASSWD: ALL'
attempt to ssh to instance as 'root@${hostname' denies access and provides a message suggesting use of 'ubuntu' user.
run 'apt-get update' and verify that an ec2 mirror (<region>.archive.ubuntu.com) is used.
'ec2-get-console-output' returns console output with with boot messages
For each EBS instance, additionally verify:
'ec2-stop-instances' will stop the instances. After a short delay, state should be 'stopped' in 'ec2-describe-instances' output.
'ec2-start-instances' will start the instances. The instance will have a different hostname in 'ec2-describe-instances'.
the remote ssh keys ('ssh-keyscan $hostname') should be the same as before the start/stop.
'ssh ubuntu@$hostname' functions.
User Data Test
User data tests are run by starting an instance ('--user-data-file=ud-cloudconfig-01.txt') with a given user-data file and then verifying that the user-data was consumed by the instance in the appropriate manner.
Start an instance passing a user-data script (#!) ud-simple-01 {download}. Verify:
- 'Hello World' message is present on the console
/root/OUTPUT-simple-01.txt file is present in the instance
Start an instance passing multi-part user data ud-multipart-01 {download} . Verify:
- presence of the following files:
- /root/OUTPUT-my-user-script-1.sh
- /root/OUTPUT-my-user-script-2.sh
- /root/OUTPUT-my-upstart-job.conf
- /etc/init/my-upstart-job.conf
- /root/OUTPUT-upstartjob1.txt
- /etc/init/upstartjob1.txt.conf
- /root/OUTPUT-include-compressed-script-01.txt
- /root/OUTPUT-include-script-01.txt
- 'pastebinit' package is installed
- presence of the following files:
Start an instance passing ud-cloudconfig-01 {download}. Verify each of the following:
'apt-get update' and 'apt-get upgrade' were run (output should be in console)
mirror used in /etc/apt/sources.list is us.archive.ubuntu.com.
ubuntu-on-ec2/ec2-tools ppa has been added in /etc/apt/sources.list.d/.
alestic ppa has been added in /etc/apt/sources.list.d/
- the following packages are installed: runurl and pastbinit
ephemeral0 storage is mounted on /opt (run df /opt)
- swap is disabled (nothing listed in /proc/swaps)
- 'cloudconfig@test' key is present in /home/ubuntu/.ssh/authorized_keys
/root/runcmd.date.txt file exists, has 'date' output in it