| 1 |
package accountsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/ |
| 2 |
|
| 3 |
import ( |
| 4 |
"contextscip-go gomod github.com/golang/go/src go1.13 context/" |
| 5 |
"fmtscip-go gomod github.com/golang/go/src go1.13 fmt/" |
| 6 |
"testingscip-go gomod github.com/golang/go/src go1.13 testing/" |
| 7 |
"timescip-go gomod github.com/golang/go/src go1.13 time/" |
| 8 |
|
| 9 |
"github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storagescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/" |
| 10 |
"github.com/tombuildsstuff/giovanni/testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/" |
| 11 |
) |
| 12 |
|
| 13 |
func TestContainerLifecyclescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/TestContainerLifecycle().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 14 |
client, err := testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.Buildscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Build().(t) |
| 15 |
if err != nil { |
| 16 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 17 |
} |
| 18 |
ctx := contextscip-go gomod github.com/golang/go/src go1.13 context/.TODOscip-go gomod github.com/golang/go/src go1.13 context/TODO().() |
| 19 |
|
| 20 |
resourceGroup := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("acctestrg-%d", testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.RandomIntscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomInt().()) |
| 21 |
accountName := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("acctestsa%s", testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.RandomStringscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomString().()) |
| 22 |
|
| •23 |
_, err = client.BuildTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#BuildTestResources().(ctx, resourceGroup, accountName, storagescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/.StorageV2scip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/StorageV2.) |
| 24 |
if err != nil { |
| 25 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 26 |
} |
| 27 |
defer client.DestroyTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#DestroyTestResources().(ctx, resourceGroup, accountName) |
| 28 |
|
| 29 |
accountsClient := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/NewWithEnvironment().(client.Environmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#Environment.) |
| 30 |
accountsClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Client#Client. = client.PrepareWithStorageResourceManagerAuthscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#PrepareWithStorageResourceManagerAuth().(accountsClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Client#Client.) |
| 31 |
|
| 32 |
input := StorageServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StorageServiceProperties#{} |
| 33 |
_, err = accountsClient.SetServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Client#SetServiceProperties().(ctx, accountName, input) |
| 34 |
if err != nil { |
| 35 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("error setting properties: %s", err)) |
| 36 |
} |
| 37 |
|
| 38 |
var index = "index.html" |
| 39 |
//var enabled = true |
| 40 |
var errorDocument = "404.html" |
| 41 |
|
| 42 |
input = StorageServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StorageServiceProperties#{ |
| 43 |
StaticWebsitescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StorageServiceProperties#StaticWebsite.: &StaticWebsitescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StaticWebsite#{ |
| 44 |
Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StaticWebsite#Enabled.: true, |
| 45 |
IndexDocumentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StaticWebsite#IndexDocument.: index, |
| 46 |
ErrorDocument404Pathscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StaticWebsite#ErrorDocument404Path.: errorDocument, |
| 47 |
}, |
| 48 |
Loggingscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StorageServiceProperties#Logging.: &Loggingscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#{ |
| 49 |
Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Version.: "2.0", |
| 50 |
Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Delete.: true, |
| 51 |
Readscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Read.: true, |
| 52 |
Writescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Write.: true, |
| 53 |
RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#RetentionPolicy.: DeleteRetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/DeleteRetentionPolicy#{ |
| 54 |
Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/DeleteRetentionPolicy#Enabled.: true, |
| 55 |
Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/DeleteRetentionPolicy#Days.: 7, |
| 56 |
}, |
| 57 |
}, |
| 58 |
} |
| 59 |
|
| 60 |
_, err = accountsClient.SetServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Client#SetServiceProperties().(ctx, accountName, input) |
| 61 |
if err != nil { |
| 62 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("error setting properties: %s", err)) |
| 63 |
} |
| 64 |
|
| 65 |
t.Logscip-go gomod github.com/golang/go/src go1.13 testing/common#Log().("[DEBUG] Waiting 2 seconds..") |
| 66 |
timescip-go gomod github.com/golang/go/src go1.13 time/.Sleepscip-go gomod github.com/golang/go/src go1.13 time/Sleep().(2 * timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second.) |
| 67 |
|
| 68 |
result, err := accountsClient.GetServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Client#GetServiceProperties().(ctx, accountName) |
| 69 |
if err != nil { |
| 70 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("error getting properties: %s", err)) |
| 71 |
} |
| 72 |
|
| 73 |
website := result.StorageServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/GetServicePropertiesResult#StorageServiceProperties..StaticWebsitescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StorageServiceProperties#StaticWebsite. |
| 74 |
if website.Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StaticWebsite#Enabled. != true { |
| 75 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the StaticWebsite %t but got %t", true, website.Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StaticWebsite#Enabled.) |
| 76 |
} |
| 77 |
|
| 78 |
logging := result.StorageServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/GetServicePropertiesResult#StorageServiceProperties..Loggingscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/StorageServiceProperties#Logging. |
| 79 |
if logging.Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Version. != "2.0" { |
| 80 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Logging Version %s but got %s", "2.0", logging.Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Version.) |
| 81 |
} |
| 82 |
if !logging.Readscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Read. { |
| 83 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Logging Read %t but got %t", true, logging.Readscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Read.) |
| 84 |
} |
| 85 |
if !logging.Writescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Write. { |
| 86 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Logging Write %t but got %t", true, logging.Writescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Write.) |
| 87 |
} |
| 88 |
if !logging.Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Delete. { |
| 89 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Logging Delete %t but got %t", true, logging.Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#Delete.) |
| 90 |
} |
| 91 |
if !logging.RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#RetentionPolicy..Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/DeleteRetentionPolicy#Enabled. { |
| 92 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Logging RetentionPolicy.Enabled %t but got %t", true, logging.RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#RetentionPolicy..Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/DeleteRetentionPolicy#Enabled.) |
| 93 |
} |
| 94 |
if logging.RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#RetentionPolicy..Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/DeleteRetentionPolicy#Days. != 7 { |
| 95 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Logging RetentionPolicy.Enabled %d but got %d", 7, logging.RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/Logging#RetentionPolicy..Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts`/DeleteRetentionPolicy#Days.) |
| 96 |
} |
| 97 |
} |