| 1 |
package sharesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/ |
| 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 |
|
| 8 |
"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`/" |
| 9 |
"github.com/tombuildsstuff/giovanni/storage/internal/authscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/" |
| 10 |
"github.com/tombuildsstuff/giovanni/testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/" |
| 11 |
) |
| 12 |
|
| 13 |
var _ StorageSharescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/StorageShare# = Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#{} |
| 14 |
|
| 15 |
func TestSharesLifecyclescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/TestSharesLifecycle().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 16 |
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) |
| 17 |
if err != nil { |
| 18 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 19 |
} |
| 20 |
ctx := contextscip-go gomod github.com/golang/go/src go1.13 context/.TODOscip-go gomod github.com/golang/go/src go1.13 context/TODO().() |
| 21 |
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().()) |
| 22 |
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().()) |
| 23 |
shareName := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("share-%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().()) |
| 24 |
|
| •25 |
testData, 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.) |
| 26 |
if err != nil { |
| 27 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 28 |
} |
| 29 |
defer client.DestroyTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#DestroyTestResources().(ctx, resourceGroup, accountName) |
| 30 |
|
| 31 |
storageAuth := authscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/.NewSharedKeyLiteAuthorizerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/NewSharedKeyLiteAuthorizer().(accountName, testData.StorageAccountKeyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/TestResources#StorageAccountKey.) |
| 32 |
sharesClient := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/NewWithEnvironment().(client.Environmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#Environment.) |
| 33 |
sharesClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Client. = client.PrepareWithAuthorizerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#PrepareWithAuthorizer().(sharesClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Client., storageAuth) |
| 34 |
|
| 35 |
tier := CoolAccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CoolAccessTier. |
| 36 |
input := CreateInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateInput#{ |
| 37 |
QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateInput#QuotaInGB.: 1, |
| 38 |
AccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateInput#AccessTier.: &tier, |
| 39 |
} |
| 40 |
_, err = sharesClient.Createscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Create().(ctx, accountName, shareName, input) |
| 41 |
if err != nil { |
| 42 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error creating fileshare: %s", err) |
| 43 |
} |
| 44 |
|
| 45 |
snapshot, err := sharesClient.CreateSnapshotscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#CreateSnapshot().(ctx, accountName, shareName, CreateSnapshotInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateSnapshotInput#{}) |
| 46 |
if err != nil { |
| 47 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error taking snapshot: %s", err) |
| 48 |
} |
| 49 |
t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("Snapshot Date Time: %s", snapshot.SnapshotDateTimescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateSnapshotResult#SnapshotDateTime.) |
| 50 |
|
| 51 |
snapshotDetails, err := sharesClient.GetSnapshotscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetSnapshot().(ctx, accountName, shareName, snapshot.SnapshotDateTimescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateSnapshotResult#SnapshotDateTime.) |
| 52 |
if err != nil { |
| 53 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving snapshot: %s", err) |
| 54 |
} |
| 55 |
|
| 56 |
t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("MetaData: %s", snapshotDetails.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetSnapshotPropertiesResult#MetaData.) |
| 57 |
|
| 58 |
_, err = sharesClient.DeleteSnapshotscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#DeleteSnapshot().(ctx, accountName, shareName, snapshot.SnapshotDateTimescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateSnapshotResult#SnapshotDateTime.) |
| 59 |
if err != nil { |
| 60 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error deleting snapshot: %s", err) |
| 61 |
} |
| 62 |
|
| 63 |
stats, err := sharesClient.GetStatsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetStats().(ctx, accountName, shareName) |
| 64 |
if err != nil { |
| 65 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving stats: %s", err) |
| 66 |
} |
| 67 |
|
| 68 |
if stats.ShareUsageBytesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetStatsResult#ShareUsageBytes. != 0 { |
| 69 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected `stats.ShareUsageBytes` to be 0 but got: %d", stats.ShareUsageBytesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetStatsResult#ShareUsageBytes.) |
| 70 |
} |
| 71 |
|
| 72 |
share, err := sharesClient.GetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetProperties().(ctx, accountName, shareName) |
| 73 |
if err != nil { |
| 74 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving share: %s", err) |
| 75 |
} |
| 76 |
if share.QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#QuotaInGB. != 1 { |
| 77 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Quota to be 1 but got: %d", share.QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#QuotaInGB.) |
| 78 |
} |
| 79 |
if share.EnabledProtocolscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#EnabledProtocol. != SMBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SMB. { |
| 80 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected EnabledProtocol to SMB but got: %s", share.EnabledProtocolscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#EnabledProtocol.) |
| 81 |
} |
| 82 |
if share.AccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#AccessTier. == nil || *share.AccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#AccessTier. != CoolAccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CoolAccessTier. { |
| 83 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected AccessTier to be Cool but got: %v", share.AccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#AccessTier.) |
| 84 |
} |
| 85 |
|
| 86 |
newTier := HotAccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/HotAccessTier. |
| 87 |
quota := 5 |
| 88 |
props := SharePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/ShareProperties#{ |
| 89 |
AccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/ShareProperties#AccessTier.: &newTier, |
| 90 |
QuotaInGbscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/ShareProperties#QuotaInGb.: "a, |
| 91 |
} |
| 92 |
_, err = sharesClient.SetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#SetProperties().(ctx, accountName, shareName, props) |
| 93 |
if err != nil { |
| 94 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error updating quota: %s", err) |
| 95 |
} |
| 96 |
|
| 97 |
share, err = sharesClient.GetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetProperties().(ctx, accountName, shareName) |
| 98 |
if err != nil { |
| 99 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving share: %s", err) |
| 100 |
} |
| 101 |
if share.QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#QuotaInGB. != 5 { |
| 102 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Quota to be 5 but got: %d", share.QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#QuotaInGB.) |
| 103 |
} |
| 104 |
|
| 105 |
if share.AccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#AccessTier. == nil || *share.AccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#AccessTier. != HotAccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/HotAccessTier. { |
| 106 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected AccessTier to be Hot but got: %v", share.AccessTierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#AccessTier.) |
| 107 |
} |
| 108 |
|
| 109 |
updatedMetaData := map[string]string{ |
| 110 |
"hello": "world", |
| 111 |
} |
| 112 |
_, err = sharesClient.SetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#SetMetaData().(ctx, accountName, shareName, updatedMetaData) |
| 113 |
if err != nil { |
| 114 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Erorr setting metadata: %s", err) |
| 115 |
} |
| 116 |
|
| 117 |
result, err := sharesClient.GetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetMetaData().(ctx, accountName, shareName) |
| 118 |
if err != nil { |
| 119 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving metadata: %s", err) |
| 120 |
} |
| 121 |
|
| 122 |
if result.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetMetaDataResult#MetaData.["hello"] != "world" { |
| 123 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected metadata `hello` to be `world` but got: %q", result.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetMetaDataResult#MetaData.["hello"]) |
| 124 |
} |
| 125 |
if len(result.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetMetaDataResult#MetaData.) != 1 { |
| 126 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected metadata to be 1 item but got: %s", result.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetMetaDataResult#MetaData.) |
| 127 |
} |
| 128 |
|
| 129 |
acls, err := sharesClient.GetACLscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetACL().(ctx, accountName, shareName) |
| 130 |
if err != nil { |
| 131 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving ACL's: %s", err) |
| 132 |
} |
| 133 |
if len(acls.SignedIdentifiersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetACLResult#SignedIdentifiers.) != 0 { |
| 134 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected 0 identifiers but got %d", len(acls.SignedIdentifiersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetACLResult#SignedIdentifiers.)) |
| 135 |
} |
| 136 |
|
| 137 |
updatedAcls := []SignedIdentifierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#{ |
| 138 |
{ |
| 139 |
Idscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#Id.: "abc123", |
| 140 |
AccessPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#AccessPolicy.: AccessPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#{ |
| 141 |
Startscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Start.: "2020-07-01T08:49:37.0000000Z", |
| 142 |
Expiryscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Expiry.: "2020-07-01T09:49:37.0000000Z", |
| 143 |
Permissionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Permission.: "rwd", |
| 144 |
}, |
| 145 |
}, |
| 146 |
{ |
| 147 |
Idscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#Id.: "bcd234", |
| 148 |
AccessPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#AccessPolicy.: AccessPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#{ |
| 149 |
Startscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Start.: "2020-07-01T08:49:37.0000000Z", |
| 150 |
Expiryscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Expiry.: "2020-07-01T09:49:37.0000000Z", |
| 151 |
Permissionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Permission.: "rwd", |
| 152 |
}, |
| 153 |
}, |
| 154 |
} |
| 155 |
_, err = sharesClient.SetACLscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#SetACL().(ctx, accountName, shareName, updatedAcls) |
| 156 |
if err != nil { |
| 157 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error setting ACL's: %s", err) |
| 158 |
} |
| 159 |
|
| 160 |
acls, err = sharesClient.GetACLscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetACL().(ctx, accountName, shareName) |
| 161 |
if err != nil { |
| 162 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving ACL's: %s", err) |
| 163 |
} |
| 164 |
if len(acls.SignedIdentifiersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetACLResult#SignedIdentifiers.) != 2 { |
| 165 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected 2 identifiers but got %d", len(acls.SignedIdentifiersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetACLResult#SignedIdentifiers.)) |
| 166 |
} |
| 167 |
|
| 168 |
_, err = sharesClient.Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Delete().(ctx, accountName, shareName, false) |
| 169 |
if err != nil { |
| 170 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error deleting Share: %s", err) |
| 171 |
} |
| 172 |
} |
| 173 |
|
| 174 |
func TestSharesLifecycleLargeQuotascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/TestSharesLifecycleLargeQuota().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 175 |
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) |
| 176 |
if err != nil { |
| 177 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 178 |
} |
| 179 |
ctx := contextscip-go gomod github.com/golang/go/src go1.13 context/.TODOscip-go gomod github.com/golang/go/src go1.13 context/TODO().() |
| 180 |
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().()) |
| 181 |
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().()) |
| 182 |
shareName := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("share-%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().()) |
| 183 |
|
| •184 |
testData, err := client.BuildTestResourcesWithSkuscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#BuildTestResourcesWithSku().(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`/.FileStoragescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/FileStorage., 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`/.PremiumLRSscip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/PremiumLRS.) |
| 185 |
if err != nil { |
| 186 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 187 |
} |
| 188 |
defer client.DestroyTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#DestroyTestResources().(ctx, resourceGroup, accountName) |
| 189 |
|
| 190 |
storageAuth := authscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/.NewSharedKeyLiteAuthorizerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/NewSharedKeyLiteAuthorizer().(accountName, testData.StorageAccountKeyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/TestResources#StorageAccountKey.) |
| 191 |
sharesClient := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/NewWithEnvironment().(client.Environmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#Environment.) |
| 192 |
sharesClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Client. = client.PrepareWithAuthorizerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#PrepareWithAuthorizer().(sharesClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Client., storageAuth) |
| 193 |
|
| 194 |
input := CreateInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateInput#{ |
| 195 |
QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateInput#QuotaInGB.: 1001, |
| 196 |
} |
| 197 |
_, err = sharesClient.Createscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Create().(ctx, accountName, shareName, input) |
| 198 |
if err != nil { |
| 199 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error creating fileshare: %s", err) |
| 200 |
} |
| 201 |
|
| 202 |
snapshot, err := sharesClient.CreateSnapshotscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#CreateSnapshot().(ctx, accountName, shareName, CreateSnapshotInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateSnapshotInput#{}) |
| 203 |
if err != nil { |
| 204 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error taking snapshot: %s", err) |
| 205 |
} |
| 206 |
t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("Snapshot Date Time: %s", snapshot.SnapshotDateTimescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateSnapshotResult#SnapshotDateTime.) |
| 207 |
|
| 208 |
snapshotDetails, err := sharesClient.GetSnapshotscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetSnapshot().(ctx, accountName, shareName, snapshot.SnapshotDateTimescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateSnapshotResult#SnapshotDateTime.) |
| 209 |
if err != nil { |
| 210 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving snapshot: %s", err) |
| 211 |
} |
| 212 |
|
| 213 |
t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("MetaData: %s", snapshotDetails.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetSnapshotPropertiesResult#MetaData.) |
| 214 |
|
| 215 |
_, err = sharesClient.DeleteSnapshotscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#DeleteSnapshot().(ctx, accountName, shareName, snapshot.SnapshotDateTimescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateSnapshotResult#SnapshotDateTime.) |
| 216 |
if err != nil { |
| 217 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error deleting snapshot: %s", err) |
| 218 |
} |
| 219 |
|
| 220 |
stats, err := sharesClient.GetStatsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetStats().(ctx, accountName, shareName) |
| 221 |
if err != nil { |
| 222 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving stats: %s", err) |
| 223 |
} |
| 224 |
|
| 225 |
if stats.ShareUsageBytesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetStatsResult#ShareUsageBytes. != 0 { |
| 226 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected `stats.ShareUsageBytes` to be 0 but got: %d", stats.ShareUsageBytesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetStatsResult#ShareUsageBytes.) |
| 227 |
} |
| 228 |
|
| 229 |
share, err := sharesClient.GetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetProperties().(ctx, accountName, shareName) |
| 230 |
if err != nil { |
| 231 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving share: %s", err) |
| 232 |
} |
| 233 |
if share.QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#QuotaInGB. != 1001 { |
| 234 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Quota to be 1001 but got: %d", share.QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#QuotaInGB.) |
| 235 |
} |
| 236 |
|
| 237 |
newQuota := 6000 |
| 238 |
props := SharePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/ShareProperties#{ |
| 239 |
QuotaInGbscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/ShareProperties#QuotaInGb.: &newQuota, |
| 240 |
} |
| 241 |
_, err = sharesClient.SetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#SetProperties().(ctx, accountName, shareName, props) |
| 242 |
if err != nil { |
| 243 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error updating quota: %s", err) |
| 244 |
} |
| 245 |
|
| 246 |
share, err = sharesClient.GetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetProperties().(ctx, accountName, shareName) |
| 247 |
if err != nil { |
| 248 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving share: %s", err) |
| 249 |
} |
| 250 |
if share.QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#QuotaInGB. != 6000 { |
| 251 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Quota to be 6000 but got: %d", share.QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#QuotaInGB.) |
| 252 |
} |
| 253 |
|
| 254 |
updatedMetaData := map[string]string{ |
| 255 |
"hello": "world", |
| 256 |
} |
| 257 |
_, err = sharesClient.SetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#SetMetaData().(ctx, accountName, shareName, updatedMetaData) |
| 258 |
if err != nil { |
| 259 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Erorr setting metadata: %s", err) |
| 260 |
} |
| 261 |
|
| 262 |
result, err := sharesClient.GetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetMetaData().(ctx, accountName, shareName) |
| 263 |
if err != nil { |
| 264 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving metadata: %s", err) |
| 265 |
} |
| 266 |
|
| 267 |
if result.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetMetaDataResult#MetaData.["hello"] != "world" { |
| 268 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected metadata `hello` to be `world` but got: %q", result.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetMetaDataResult#MetaData.["hello"]) |
| 269 |
} |
| 270 |
if len(result.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetMetaDataResult#MetaData.) != 1 { |
| 271 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected metadata to be 1 item but got: %s", result.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetMetaDataResult#MetaData.) |
| 272 |
} |
| 273 |
|
| 274 |
acls, err := sharesClient.GetACLscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetACL().(ctx, accountName, shareName) |
| 275 |
if err != nil { |
| 276 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving ACL's: %s", err) |
| 277 |
} |
| 278 |
if len(acls.SignedIdentifiersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetACLResult#SignedIdentifiers.) != 0 { |
| 279 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected 0 identifiers but got %d", len(acls.SignedIdentifiersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetACLResult#SignedIdentifiers.)) |
| 280 |
} |
| 281 |
|
| 282 |
updatedAcls := []SignedIdentifierscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#{ |
| 283 |
{ |
| 284 |
Idscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#Id.: "abc123", |
| 285 |
AccessPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#AccessPolicy.: AccessPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#{ |
| 286 |
Startscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Start.: "2020-07-01T08:49:37.0000000Z", |
| 287 |
Expiryscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Expiry.: "2020-07-01T09:49:37.0000000Z", |
| 288 |
Permissionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Permission.: "rwd", |
| 289 |
}, |
| 290 |
}, |
| 291 |
{ |
| 292 |
Idscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#Id.: "bcd234", |
| 293 |
AccessPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/SignedIdentifier#AccessPolicy.: AccessPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#{ |
| 294 |
Startscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Start.: "2020-07-01T08:49:37.0000000Z", |
| 295 |
Expiryscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Expiry.: "2020-07-01T09:49:37.0000000Z", |
| 296 |
Permissionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/AccessPolicy#Permission.: "rwd", |
| 297 |
}, |
| 298 |
}, |
| 299 |
} |
| 300 |
_, err = sharesClient.SetACLscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#SetACL().(ctx, accountName, shareName, updatedAcls) |
| 301 |
if err != nil { |
| 302 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error setting ACL's: %s", err) |
| 303 |
} |
| 304 |
|
| 305 |
acls, err = sharesClient.GetACLscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetACL().(ctx, accountName, shareName) |
| 306 |
if err != nil { |
| 307 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving ACL's: %s", err) |
| 308 |
} |
| 309 |
if len(acls.SignedIdentifiersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetACLResult#SignedIdentifiers.) != 2 { |
| 310 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected 2 identifiers but got %d", len(acls.SignedIdentifiersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetACLResult#SignedIdentifiers.)) |
| 311 |
} |
| 312 |
|
| 313 |
_, err = sharesClient.Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Delete().(ctx, accountName, shareName, false) |
| 314 |
if err != nil { |
| 315 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error deleting Share: %s", err) |
| 316 |
} |
| 317 |
} |
| 318 |
|
| 319 |
func TestSharesLifecycleNFSProtocolscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/TestSharesLifecycleNFSProtocol().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 320 |
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) |
| 321 |
if err != nil { |
| 322 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 323 |
} |
| 324 |
ctx := contextscip-go gomod github.com/golang/go/src go1.13 context/.TODOscip-go gomod github.com/golang/go/src go1.13 context/TODO().() |
| 325 |
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().()) |
| 326 |
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().()) |
| 327 |
shareName := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("share-%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().()) |
| 328 |
|
| •329 |
testData, err := client.BuildTestResourcesWithSkuscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#BuildTestResourcesWithSku().(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`/.FileStoragescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/FileStorage., 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`/.PremiumLRSscip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/PremiumLRS.) |
| 330 |
if err != nil { |
| 331 |
t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 332 |
} |
| 333 |
defer client.DestroyTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#DestroyTestResources().(ctx, resourceGroup, accountName) |
| 334 |
|
| 335 |
storageAuth := authscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/.NewSharedKeyLiteAuthorizerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/NewSharedKeyLiteAuthorizer().(accountName, testData.StorageAccountKeyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/TestResources#StorageAccountKey.) |
| 336 |
sharesClient := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/NewWithEnvironment().(client.Environmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#Environment.) |
| 337 |
sharesClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Client. = client.PrepareWithAuthorizerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#PrepareWithAuthorizer().(sharesClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Client., storageAuth) |
| 338 |
|
| 339 |
input := CreateInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateInput#{ |
| 340 |
QuotaInGBscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateInput#QuotaInGB.: 1000, |
| 341 |
EnabledProtocolscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/CreateInput#EnabledProtocol.: NFSscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/NFS., |
| 342 |
} |
| 343 |
_, err = sharesClient.Createscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Create().(ctx, accountName, shareName, input) |
| 344 |
if err != nil { |
| 345 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error creating fileshare: %s", err) |
| 346 |
} |
| 347 |
|
| 348 |
share, err := sharesClient.GetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#GetProperties().(ctx, accountName, shareName) |
| 349 |
if err != nil { |
| 350 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving share: %s", err) |
| 351 |
} |
| 352 |
if share.EnabledProtocolscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#EnabledProtocol. != NFSscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/NFS. { |
| 353 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().(`Expected enabled protocol to be "NFS" but got: %q`, share.EnabledProtocolscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/GetPropertiesResult#EnabledProtocol.) |
| 354 |
} |
| 355 |
|
| 356 |
_, err = sharesClient.Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares`/Client#Delete().(ctx, accountName, shareName, false) |
| 357 |
if err != nil { |
| 358 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error deleting Share: %s", err) |
| 359 |
} |
| 360 |
} |