Skip to content

Commit

Permalink
Update minio client for testing
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Chang <[email protected]>
  • Loading branch information
mocsharp committed Jun 11, 2024
1 parent 46bae3c commit ba840bb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Plugins/MinIO/StorageAdminService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ public StorageAdminService(IOptions<StorageServiceConfiguration> options, ILogge
_accessKey = options.Value.Settings[ConfigurationKeys.AccessKey];
_secretKey = options.Value.Settings[ConfigurationKeys.AccessToken];

SetCommandTemplates(options);
}

private void SetCommandTemplates(IOptions<StorageServiceConfiguration> options)
{
_set_connection_cmd = $"alias set {_serviceName} http://{_endpoint} {_accessKey} {_secretKey}";
_get_connections_cmd = "alias list";
_get_users_cmd = $"admin user list {_serviceName}";
Expand Down Expand Up @@ -105,7 +100,7 @@ public async Task<bool> SetPolicyAsync(IdentityType policyType, List<string> pol
var setPolicyCmd = string.Format(CultureInfo.InvariantCulture, _set_policy_cmd, _serviceName, policiesStr, policyType.ToString().ToLowerInvariant(), itemName);
var result = await ExecuteAsync(setPolicyCmd).ConfigureAwait(false);

var expectedResult = $"Policy `{policiesStr}` is set on {policyType.ToString().ToLower()} `{itemName}`";
var expectedResult = $"Attached Policies: [{policiesStr}]";
if (!result.Any(r => r.Contains(expectedResult)))
{
return false;
Expand Down Expand Up @@ -274,7 +269,7 @@ private async Task<string> CreatePolicyAsync(PolicyRequest[] policyRequests, str

var policyFileName = await CreatePolicyFile(policyRequests, username).ConfigureAwait(false);
var result = await ExecuteAsync(string.Format(CultureInfo.InvariantCulture, _create_policy_cmd, _serviceName, username, policyFileName)).ConfigureAwait(false);
if (result.Any(r => r.Contains($"Added policy `pol_{username}` successfully.")) is false)
if (result.Any(r => r.Contains($"Created policy `pol_{username}` successfully.")) is false)
{
await RemoveUserAsync(username).ConfigureAwait(false);
File.Delete($"{username}.json");
Expand Down
Binary file modified src/Plugins/MinIO/Tests/Integration/mc
Binary file not shown.
Binary file modified src/Plugins/MinIO/Tests/Integration/mc.exe
Binary file not shown.

0 comments on commit ba840bb

Please sign in to comment.