update of ec2-automate-backup test script and ensure user_tag functionality uses correct variable for date created.
This commit is contained in:
		
							parent
							
								
									ff06380942
								
							
						
					
					
						commit
						c644a35d3c
					
				@ -19,6 +19,10 @@ $ec2ab_exec -v "$volume_1_id $volume_2_id"
 | 
				
			|||||||
$ec2ab_exec -v "$volume_1_id $volume_2_id" -n
 | 
					$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_$date_current
 | 
					#expected result - snapshot only taken of volume_1 and volume_2 each with tag "name" set to ec2ab_$volume_id_$date_current
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					#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 "PurgeAfter=14"
 | 
					#test backing up only EBS volume with IDs "x" and "y" and tagging them with a tag "PurgeAfter=14"
 | 
				
			||||||
$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 14
 | 
					$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 14
 | 
				
			||||||
#expected result - snapshot only taken of volume_1 and volume_2 each with tags "PurgeAfter=$date_current+14" and "PurgeAllow=true"
 | 
					#expected result - snapshot only taken of volume_1 and volume_2 each with tags "PurgeAfter=$date_current+14" and "PurgeAllow=true"
 | 
				
			||||||
 | 
				
			|||||||
@ -65,7 +65,7 @@ create_EBS_Snapshot_Tags()
 | 
				
			|||||||
	#if $user_tags is true, then append Volume=$ebs_selected and Created=$current_date to the variable $snapshot_tags
 | 
						#if $user_tags is true, then append Volume=$ebs_selected and Created=$current_date to the variable $snapshot_tags
 | 
				
			||||||
	if $user_tags
 | 
						if $user_tags
 | 
				
			||||||
		then
 | 
							then
 | 
				
			||||||
		snapshot_tags="$snapshot_tags --tag Volume=${ebs_selected} --tag Created=$current_date"
 | 
							snapshot_tags="$snapshot_tags --tag Volume=${ebs_selected} --tag Created=$date_current"
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	#if $snapshot_tags is not zero length then set the tag on the snapshot using ec2-create-tags
 | 
						#if $snapshot_tags is not zero length then set the tag on the snapshot using ec2-create-tags
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user