aws-missing-tools/ec2-automate-backup/Resources/ec2ab-test-plan.txt

61 lines
3.5 KiB
Plaintext
Raw Normal View History

2014-04-20 00:34:18 +00:00
ec2ab_exec="../ec2-automate-backup-awscli.sh"
#create two volumes
volume_1=$(ec2-create-volume --size 5 GB --availability-zone us-east-1c --type io1 --iops 100)
volume_2=$(ec2-create-volume --size 2 GB --availability-zone us-east-1c)
#get volume id of both volumes
2014-04-20 00:34:18 +00:00
volume_1_id=$(echo "$volume_1" | cut -f 2)
volume_2_id=$(echo "$volume_2" | cut -f 2)
#tag volume_1 with Backup=true
ec2-create-tags $volume_1_id --tag Backup=true
#test backing up only volume with tag Backup=true
# if testing ec2-automate-backup.sh
$ec2ab_exec -s tag -t Backup=true
# if testing ec2-automate-backup-awscli.sh
$ec2ab_exec -s tag -t Backup,Values=true
#expected result - snapshot only taken of volume_1
#test backing up only EBS volume with IDs "x" and "y"
$ec2ab_exec -v "$volume_1_id $volume_2_id"
#expected result - snapshot only taken of volume_1 and volume_2
#test backing up only EBS volume with IDs "x" and "y" and tagging them with "name"
$ec2ab_exec -v "$volume_1_id $volume_2_id" -n
#expected result - snapshot only taken of volume_1 and volume_2 each with tag "name" set to ec2ab_$volume_id_$current_date
#test backing up only EBS volume with IDs "x" and "y" and tagging them with "user tags"
$ec2ab_exec -v "$volume_1_id $volume_2_id" -u
#expected result - snapshot only taken of volume_1 and volume_2 each with tag "user tags" set to Volume=$ebs_selected and Created=$current_date
#test backing up only EBS volume with IDs "x" and "y" and tagging them with a tag "PurgeAfterFE=$current_date+604800"
$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 7
2014-04-20 00:34:18 +00:00
echo "PurgeAfterFE=$(date -v +604800S -u +%s)"
echo "PurgeAfterFE=$(date -d +604800sec -u +%s)"
#expected result - snapshot taken of volume_1 and volume_2 each with tags "PurgeAfterFE=$current_date+604800" and "PurgeAllow=true"
#test backing up only EBS volume with IDs "x" and "y" and tagging them with a tag "PurgeAfterFE=$current_date+604800"
$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 7 -n
2014-04-20 00:34:18 +00:00
echo "PurgeAfterFE=$(date -v+604800S -u +%s)"
echo "PurgeAfterFE=$(date -d +604800sec -u +%s)"
#expected result - snapshot taken of volume_1 and volume_2 each with tag "name" set to ec2ab_$volume_id_$date_current a with a tag "PurgeAfterFE=$current_date+604800"
#test backing up only EBS volume with IDs "x" and "y" and tagging them with a tag "PurgeAfterFE=$current_date+3600"
$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 1h -n
2014-04-20 00:34:18 +00:00
echo "PurgeAfterFE=$(date -v+3600S -u +%s)"
echo "PurgeAfterFE=$(date -d +3600sec -u +%s)"
#expected result - snapshot taken of volume_1 and volume_2 each with tag "name" set to ec2ab_$volume_id_$date_current a with a tag "PurgeAfterFE=$current_date+3600"
#test backing up only EBS volume with IDs "x" and "y" and tagging them with a tag "PurgeAfterFE=$current_date+3600"
$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 30m -n
2014-04-20 00:34:18 +00:00
echo "PurgeAfterFE=$(date -v+1800S -u +%s)"
echo "PurgeAfterFE=$(date -d +1800sec -u +%s)"
#expected result - snapshot taken of volume_1 and volume_2 each with tag "name" set to ec2ab_$volume_id_$date_current a with a tag "PurgeAfterFE=$current_date+3600"
#test backing up only EBS volume with IDs "x" and "y" and tagging them with a tag "PurgeAfterFE=$current_date+60" and purging snapshots
$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 1m -n -p
2014-04-20 00:34:18 +00:00
echo "PurgeAfterFE=$(date -v+60S -u +%s)"
echo "PurgeAfterFE=$(date -d +60sec -u +%s)"
#expected result - snapshot taken of volume_1 and volume_2 each with tag "name" set to ec2ab_$volume_id_$date_current a with a tag "PurgeAfterFE=$current_date+60" and if run twice after 60 seconds, volumes purged