| Index: third_party/gsutil/boto/tests/integration/cloudformation/test_connection.py
|
| diff --git a/third_party/gsutil/boto/tests/integration/cloudformation/test_connection.py b/third_party/gsutil/boto/tests/integration/cloudformation/test_connection.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9152aa1296200d3213ad597ceca10904a367689b
|
| --- /dev/null
|
| +++ b/third_party/gsutil/boto/tests/integration/cloudformation/test_connection.py
|
| @@ -0,0 +1,110 @@
|
| +#!/usr/bin/env python
|
| +import time
|
| +import json
|
| +
|
| +from tests.unit import unittest
|
| +from boto.cloudformation.connection import CloudFormationConnection
|
| +
|
| +
|
| +BASIC_EC2_TEMPLATE = {
|
| + "AWSTemplateFormatVersion": "2010-09-09",
|
| + "Description": "AWS CloudFormation Sample Template EC2InstanceSample",
|
| + "Parameters": {
|
| + },
|
| + "Mappings": {
|
| + "RegionMap": {
|
| + "us-east-1": {
|
| + "AMI": "ami-7f418316"
|
| + }
|
| + }
|
| + },
|
| + "Resources": {
|
| + "Ec2Instance": {
|
| + "Type": "AWS::EC2::Instance",
|
| + "Properties": {
|
| + "ImageId": {
|
| + "Fn::FindInMap": [
|
| + "RegionMap",
|
| + {
|
| + "Ref": "AWS::Region"
|
| + },
|
| + "AMI"
|
| + ]
|
| + },
|
| + "UserData": {
|
| + "Fn::Base64": "a" * 15000
|
| + }
|
| + }
|
| + }
|
| + },
|
| + "Outputs": {
|
| + "InstanceId": {
|
| + "Description": "InstanceId of the newly created EC2 instance",
|
| + "Value": {
|
| + "Ref": "Ec2Instance"
|
| + }
|
| + },
|
| + "AZ": {
|
| + "Description": "Availability Zone of the newly created EC2 instance",
|
| + "Value": {
|
| + "Fn::GetAtt": [
|
| + "Ec2Instance",
|
| + "AvailabilityZone"
|
| + ]
|
| + }
|
| + },
|
| + "PublicIP": {
|
| + "Description": "Public IP address of the newly created EC2 instance",
|
| + "Value": {
|
| + "Fn::GetAtt": [
|
| + "Ec2Instance",
|
| + "PublicIp"
|
| + ]
|
| + }
|
| + },
|
| + "PrivateIP": {
|
| + "Description": "Private IP address of the newly created EC2 instance",
|
| + "Value": {
|
| + "Fn::GetAtt": [
|
| + "Ec2Instance",
|
| + "PrivateIp"
|
| + ]
|
| + }
|
| + },
|
| + "PublicDNS": {
|
| + "Description": "Public DNSName of the newly created EC2 instance",
|
| + "Value": {
|
| + "Fn::GetAtt": [
|
| + "Ec2Instance",
|
| + "PublicDnsName"
|
| + ]
|
| + }
|
| + },
|
| + "PrivateDNS": {
|
| + "Description": "Private DNSName of the newly created EC2 instance",
|
| + "Value": {
|
| + "Fn::GetAtt": [
|
| + "Ec2Instance",
|
| + "PrivateDnsName"
|
| + ]
|
| + }
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| +class TestCloudformationConnection(unittest.TestCase):
|
| + def setUp(self):
|
| + self.connection = CloudFormationConnection()
|
| + self.stack_name = 'testcfnstack' + str(int(time.time()))
|
| +
|
| + def test_large_template_stack_size(self):
|
| + # See https://github.com/boto/boto/issues/1037
|
| + body = self.connection.create_stack(
|
| + self.stack_name,
|
| + template_body=json.dumps(BASIC_EC2_TEMPLATE))
|
| + self.addCleanup(self.connection.delete_stack, self.stack_name)
|
| +
|
| +
|
| +if __name__ == '__main__':
|
| + unittest.main()
|
|
|