From 49697eb5dea1a0c636f816fcdb330586279f6817 Mon Sep 17 00:00:00 2001 From: Jake Champlin Date: Wed, 8 Feb 2017 09:20:19 -0500 Subject: [PATCH] provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ``` --- .../resource_aws_spot_fleet_request_test.go | 270 ++++++++++++++++-- 1 file changed, 250 insertions(+), 20 deletions(-) diff --git a/builtin/providers/aws/resource_aws_spot_fleet_request_test.go b/builtin/providers/aws/resource_aws_spot_fleet_request_test.go index 09687bfca..5cb8c9915 100644 --- a/builtin/providers/aws/resource_aws_spot_fleet_request_test.go +++ b/builtin/providers/aws/resource_aws_spot_fleet_request_test.go @@ -428,10 +428,33 @@ resource "aws_key_pair" "debugging" { public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" } +resource "aws_iam_policy" "test-policy" { + name = "test-policy-%d" + path = "/" + description = "Spot Fleet Request ACCTest Policy" + policy = <