initial commit from code.google.com

This commit is contained in:
Colin Johnson
2012-06-17 22:46:53 +00:00
commit 52dcc5c58e
24 changed files with 1764 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
Format:
Test Procedure Name:
Last Tested Date: <Date, in format YYYY-MM-DD>
Last Tested Version: <Version Number>
Result: <Pass/Fail>
1.1 ASG Selection:
Last Tested Date: 2011-11-14
Last Tested Version: 0.1
Result: Pass
Test with ASG set correctly. Applies alarms to selected RDS instance.
Test with ASG set incorretly. Fails.
Test with ASG set and ALLASG set. Fails.
Test with ALLASG set. Applies alarms to all ASG resources.
1.2 Evaluation Period
Last Tested Date: 2011-11-14
Last Tested Version: 0.1
Result: Pass
Test with Evaluation Period not set.
Test with Evaluation Period set to 1.
Test with Evaluation Period set to 100.
1.3 SNS Topic Validator (Not implemented as of version 0.1)
Last Tested Date: <Date>
Last Tested Version: <Version Number>
Result: <Pass/Fail>
Test with SNS topic not set.
Test with SNS topic set correctly.
Test with SNS topic set incorrectly.
1.4 Preview Mode Validtor
Last Tested Date: 2011-11-14
Last Tested Version: 0.1
Result: Pass
Test with Previewmode not set. Result: alarms applied.
Test with Previewmode set incorrectly. Result: exit.
Test with Previewmode set to "True|true". Result: alarms applied.
1.5 ASG Availability (Not implemented as of version 0.1)
Last Tested Date: <Date>
Last Tested Version: <Version Number>
Result: <Pass/Fail>
Test -g with no asg resources available.
Test -g with asg resources available.
Test -a with no asg resources available.
Test -a with asg resources available.

View File

@@ -0,0 +1,85 @@
#!/bin/bash
#sets path = to /dev/null
AWS_MISSING_TOOLS_PATH="/Temp/aws-missing-tools/as-apply-alarms/"
echo
echo " -Test: Prerequisite Checking"
echo " -Test: Prerequisite Fail"
PATH_BAK=$PATH #backup of current path
export PATH=/dev/null
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Prerequisite Success"
PATH=$PATH_BAK
export PATH
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh
echo "Exit Code: $?"
##### Region Test
echo
echo " -Test: Region Testing"
echo " -Test: Calling without region."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -a
echo "Exit Code: $?"
echo " -Test: Calling without a region option."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -r -a
echo "Exit Code: $?"
echo " -Test: Calling with an invalid region option."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -r california
echo "Exit Code: $?"
echo " -Test: Calling with a valid region option."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -r us-west-2
echo "Exit Code: $?"
##### Evaluation Period Test
echo
echo " -Test: Evaluation Period Testing"
echo " -Test: Calling without an Evaluation Period."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Calling without an Evaluation Period option."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -e
echo "Exit Code: $?"
echo " -Test: Calling with an invalid (low) Evaluation Period option."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -e 0
echo "Exit Code: $?"
echo " -Test: Calling with an invalid (high) Evaluation Period option."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -e 100
echo "Exit Code: $?"
echo " -Test: Calling with a valid Evaluation Period option"
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -e 1
echo "Exit Code: $?"
##### ASG Tests
echo
echo " -Test: Auto Scaling Group Testing"
echo " -Test: Calling without Auto Scaling Group."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Calling with no Auto Scaling Group defined."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -g
echo "Exit Code: $?"
echo " -Test: Calling with an invalid Auto Scaling Group."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -g california
echo "Exit Code: $?"
echo " -Test: Calling with an invalid Auto Scaling Group and all Auto Scaling Groups."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -g california -a
echo "Exit Code: $?"
as-create-launch-config amt-test-01 --image-id ami-31814f58 --instance-type t1.micro --key amt-test-01 --group amt-test-01
as-create-auto-scaling-group amt-test-01 --min-size 0 --max-size 0 --desired-capacity 0 --launch-configuration amt-test-01 --availability-zones us-east-1a
as-create-launch-config amt-test-02 --image-id ami-31814f58 --instance-type t1.micro --key amt-test-01 --group amt-test-01
as-create-auto-scaling-group amt-test-02 --min-size 0 --max-size 0 --desired-capacity 0 --launch-configuration amt-test-02 --availability-zones us-east-1a
echo " -Test: Calling with a valid Auto Scaling Group and all Auto Scaling Groups."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -g amt-test-01 -a
echo "Exit Code: $?"
echo " -Test: Calling with a valid Auto Scaling Group."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -g amt-test-01
echo "Exit Code: $?"
echo " -Test: Calling with all Auto Scaling Groups."
${AWS_MISSING_TOOLS_PATH}as-apply-alarms.sh -a
echo "Exit Code: $?"
as-delete-auto-scaling-group amt-test-01 -f
as-delete-launch-config amt-test-01 -f
as-delete-auto-scaling-group amt-test-02 -f
as-delete-launch-config amt-test-02 -f

View File

@@ -0,0 +1,95 @@
#!/bin/bash
#sets path = to /dev/null
AWS_MISSING_TOOLS_PATH=/Temp/aws-missing-tools/as-update-launch-config/
echo
echo " -Test: Prerequisite Checking"
echo " -Test: Prerequisite Fail"
PATH_BAK=$PATH #backup of current path
export PATH=/dev/null
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh
echo "Exit Code: $?"
echo " -Test: Prerequisite Success"
PATH=$PATH_BAK
export PATH
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh
echo
##### Instance Type Test
echo " -Test: Instance Type Testing"
echo " -Test: Calling without an Instance Type"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh
echo "Exit Code: $?"
echo " -Test: Calling without an Instance Type"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i
echo "Exit Code: $?"
echo " -Test: Calling without an Invalid Instance Type"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.micro
echo "Exit Code: $?"
echo " -Test: Calling with a Valid Instance Type:"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small
echo "Exit Code: $?"
##### User-Data Test
echo
echo " -Test: User-Data Testing"
echo " -Test: Calling without user-data"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small
echo "Exit Code: $?"
echo " -Test: Calling without user-data option"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small -u
echo "Exit Code: $?"
echo " -Test: Calling with a valid user-data option"
touch /Temp/touch.txt
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small -u /Temp/touch.txt
echo "Exit Code: $?"
##### t1.micro test
echo
echo " -Test: t1.micro Bit Depth Testing"
echo " -Test: Calling with a t1.micro instance type and no bit depth"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i t1.micro
echo "Exit Code: $?"
echo
echo " -Test: t1.micro Bit Depth Testing"
echo " -Test: Calling with a t1.micro instance type and an empty bit depth"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i t1.micro -b
echo "Exit Code: $?"
echo
echo " -Test: t1.micro Bit Depth Testing"
echo " -Test: Calling with a t1.micro instance type and 32 bit depth"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i t1.micro -b 32
echo "Exit Code: $?"
echo
echo " -Test: t1.micro Bit Depth Testing"
echo " -Test: Calling with a t1.micro instance type and 64 bit depth"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i t1.micro -b 64
echo "Exit Code: $?"
echo
echo " -Test: t1.micro Bit Depth Testing"
echo " -Test: Calling with a t1.micro instance type and 33 bit depth"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i t1.micro -b 33
echo "Exit Code: $?"
##### Auto Scaling Group Test
echo
echo " -Test: Auto Scaling Group Testing"
echo " -Test: Calling without an Auto Scaling Group"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small -b 32 -u /Temp/touch.txt
echo "Exit Code: $?"
echo " -Test: Calling without an Auto Scaling Group option."
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small -b 32 -u /Temp/touch.txt -a
echo "Exit Code: $?"
echo " -Test: Calling with an invalid Auto Scaling Group"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small -b 32 -u /Temp/touch.txt -a doesntexist
echo "Exit Code: $?"
echo " -Test: Calling with a valid Auto Scaling Group"
as-create-launch-config amt-test-01 --image-id ami-31814f58 --instance-type t1.micro --key amt-test-01 --group amt-test-01
as-create-auto-scaling-group amt-test-01 --min-size 0 --max-size 0 --desired-capacity 0 --launch-configuration amt-test-01 --availability-zones us-east-1a
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small -b 32 -u /Temp/touch.txt -a amt-test-01
echo "Exit Code: $?"
echo " -Test: Calling with a valid Auto Scaling Group and a Launch-Config amt-test-1 Already Created"
${AWS_MISSING_TOOLS_PATH}as-update-launch-config.sh -i m1.small -b 32 -u /Temp/touch.txt -a amt-test-01
echo "Exit Code: $?"
as-delete-auto-scaling-group amt-test-01 -f
as-delete-launch-config amt-test-01 -f

View File

@@ -0,0 +1,85 @@
#!/bin/bash
#sets path = to /dev/null
AWS_MISSING_TOOLS_PATH="/Temp/aws-missing-tools/asg-apply-alarms/"
echo
echo " -Test: Prerequisite Checking"
echo " -Test: Prerequisite Fail"
PATH_BAK=$PATH #backup of current path
export PATH=/dev/null
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Prerequisite Success"
PATH=$PATH_BAK
export PATH
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh
echo "Exit Code: $?"
##### Region Test
echo
echo " -Test: Region Testing"
echo " -Test: Calling without region."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -a
echo "Exit Code: $?"
echo " -Test: Calling without a region option."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -r -a
echo "Exit Code: $?"
echo " -Test: Calling with an invalid region option."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -r california
echo "Exit Code: $?"
echo " -Test: Calling with a valid region option."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -r us-west-2
echo "Exit Code: $?"
##### Evaluation Period Test
echo
echo " -Test: Evaluation Period Testing"
echo " -Test: Calling without an Evaluation Period."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Calling without an Evaludation Period option."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -e
echo "Exit Code: $?"
echo " -Test: Calling with an invalid (low) Evaluation Period option."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -e 0
echo "Exit Code: $?"
echo " -Test: Calling with an invalid (high) Evaluation Period option."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -e 100
echo "Exit Code: $?"
echo " -Test: Calling with a valid Evaluation Period option"
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -e 1
echo "Exit Code: $?"
##### ASG Tests
echo
echo " -Test: Auto Scaling Group Testing"
echo " -Test: Calling without an Auto Scaling Group."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Calling with no Auto Scaling Group defined."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -g
echo "Exit Code: $?"
echo " -Test: Calling with an invalid Auto Scaling Group."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -g california
echo "Exit Code: $?"
echo " -Test: Calling with an invalid Auto Scaling Group and all Auto Scaling Groups."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -g california -a
echo "Exit Code: $?"
as-create-launch-config amt-test-01 --image-id ami-31814f58 --instance-type t1.micro --key amt-test-01 --group amt-test-01
as-create-auto-scaling-group amt-test-01 --min-size 0 --max-size 0 --desired-capacity 0 --launch-configuration amt-test-01 --availability-zones us-east-1a
as-create-launch-config amt-test-02 --image-id ami-31814f58 --instance-type t1.micro --key amt-test-01 --group amt-test-01
as-create-auto-scaling-group amt-test-02 --min-size 0 --max-size 0 --desired-capacity 0 --launch-configuration amt-test-02 --availability-zones us-east-1a
echo " -Test: Calling with a valid Auto Scaling Group and all Auto Scaling Groups."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -g amt-test-01 -a
echo "Exit Code: $?"
echo " -Test: Calling with a valid Auto Scaling Group."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -g amt-test-01
echo "Exit Code: $?"
echo " -Test: Calling with all Auto Scaling Groups."
${AWS_MISSING_TOOLS_PATH}asg-apply-alarms.sh -a
echo "Exit Code: $?"
as-delete-auto-scaling-group amt-test-01 -f
as-delete-launch-config amt-test-01 -f
as-delete-auto-scaling-group amt-test-02 -f
as-delete-launch-config amt-test-02 -f

View File

@@ -0,0 +1,70 @@
#!/bin/bash
#set EC2CC_RB_APPLICATION prior to running
EC2CC_RB_APPLICATION=/Temp/aws-missing-tools/ec2-cost-calculate-rb/ec2-cost-calculate.rb
echo
echo " -Test: Credentials File Checking"
echo " -Test: Condition - Prerequisite File Does Not Exist"
AWS_CREDENTIAL_FILE_BAK=$AWS_CREDENTIAL_FILE #backup of credential location
export AWS_CREDENTIAL_FILE=/var/tmp/nofile.txt
$EC2CC_RB_APPLICATION
echo "Exit Code: $?"
echo " -Test Condition: Prerequisite Success"
export AWS_CREDENTIAL_FILE=$AWS_CREDENTIAL_FILE_BAK
$EC2CC_RB_APPLICATION
echo
##### Simple Run Test
echo " -Test: Simple Execution"
$EC2CC_RB_APPLICATION
echo "Exit Code: $?"
##### Invalid Options Provided
$EC2CC_RB_APPLICATION --option
echo "Exit Code: $?"
##### Invalid Options Provided
$EC2CC_RB_APPLICATION --option invalid
echo "Exit Code: $?"
echo
echo " -Test: Status Checking - Status Running"
$EC2CC_RB_APPLICATION --status running
echo "Exit Code: $?"
echo " -Test: Status Checking - Status All"
$EC2CC_RB_APPLICATION --status all
echo "Exit Code: $?"
echo " -Test: Status Checking - Status Invalid"
$EC2CC_RB_APPLICATION --status invalid
echo "Exit Code: $?"
echo
echo " -Test: Region Checking - Region us-east-1"
$EC2CC_RB_APPLICATION --region us-east-1
echo "Exit Code: $?"
echo " -Test: Region Checking - Region all"
$EC2CC_RB_APPLICATION --region all
echo "Exit Code: $?"
echo " -Test: Region Checking - Region invalid"
$EC2CC_RB_APPLICATION --region invalid
echo "Exit Code: $?"
echo
echo " -Test: Output Checking - Output Screen"
$EC2CC_RB_APPLICATION --output screen
echo "Exit Code: $?"
echo " -Test: Output Checking - Output File"
echo " -Test: Output Checking - Output File Exists"
$EC2CC_RB_APPLICATION --output file
echo "Exit Code: $?"
echo " -Test: Output Checking - Output File Doesn't Exist, Custom Location"
$EC2CC_RB_APPLICATION --output file --file ~/ec2cc_ooutput.txt
echo "Exit Code: $?"
echo " -Test: Output Checking - Output File Exists, Custom Location"
$EC2CC_RB_APPLICATION --output file file ~/ec2cc_ooutput.txt
echo "Exit Code: $?"
echo
echo " -Test: Period Checking - Period Day"
$EC2CC_RB_APPLICATION --period day
echo "Exit Code: $?"
echo " -Test: Period Checking - Period Invalid"
$EC2CC_RB_APPLICATION --period invalid
echo "Exit Code: $?"
echo
echo " -Test: Seperator Checking - Seperator ;"
$EC2CC_RB_APPLICATION --seperator \;
echo "Exit Code: $?"

View File

@@ -0,0 +1,78 @@
#!/bin/bash
#sets path = to /dev/null
AWS_MISSING_TOOLS_PATH="/Temp/aws-missing-tools/rds-apply-alarms/"
echo
echo " -Test: Prerequisite Checking"
echo " -Test: Prerequisite Fail"
PATH_BAK=$PATH #backup of current path
export PATH=/dev/null
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Prerequisite Success"
PATH=$PATH_BAK
export PATH
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh
echo "Exit Code: $?"
##### Region Test
echo
echo " -Test: Region Testing"
echo " -Test: Calling without region."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -a
echo "Exit Code: $?"
echo " -Test: Calling without a region option."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -r -a
echo "Exit Code: $?"
echo " -Test: Calling with an invalid region option."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -r california
echo "Exit Code: $?"
echo " -Test: Calling with a valid region option."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -r us-west-2
echo "Exit Code: $?"
##### Evaluation Period Test
echo
echo " -Test: Evaluation Period Testing"
echo " -Test: Calling without an Evaluation Period."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Calling without an Evaludation Period option."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -e
echo "Exit Code: $?"
echo " -Test: Calling with an invalid (low) Evaluation Period option."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -e 0
echo "Exit Code: $?"
echo " -Test: Calling with an invalid (high) Evaluation Period option."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -e 100
echo "Exit Code: $?"
echo " -Test: Calling with a valid Evaluation Period option"
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -e 1
echo "Exit Code: $?"
##### RDS Instance Tests
echo
echo " -Test: RDS Instance Testing"
echo " -Test: Calling without an RDS Instance."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh
echo "Exit Code: $?"
echo " -Test: Calling with no RDS Instance option defined."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -d
echo "Exit Code: $?"
echo " -Test: Calling with an invalid RDS Instance Group."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -d california
echo "Exit Code: $?"
rds-create-db-instance amt-test-01 --allocated-storage 5 --db-instance-class db.m1.small --engine mysql --master-user-password mj21s77 --master-username amttest01
sleep 300
echo " -Test: Calling with an invalid RDS Instance and all RDS Instances."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -d california -a
echo "Exit Code: $?"
echo " -Test: Calling with a valid RDS Instance and all RDS Instances."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -d amt-test-1 -a
echo "Exit Code: $?"
echo " -Test: Calling with a valid RDS Instance."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -d amt-test-01
echo "Exit Code: $?"
echo " -Test: Calling with all RDS Instances."
${AWS_MISSING_TOOLS_PATH}rds-apply-alarms.sh -a
echo "Exit Code: $?"
rds-delete-db-instance amt-test-01 -f --skip-final-snapshot