Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ public void DownloadGzippedFile()
// The file has a Content-Encoding of gzip, and it's stored compressed.
// We should still be able to download it, and the result should be the original plain text.
var stream = new MemoryStream();
_fixture.Client.DownloadObject(StorageFixture.TestBucket, "gzipped-text.txt", stream);
var expected = Encoding.UTF8.GetBytes("hello world");
_fixture.Client.DownloadObject(StorageFixture.TestBucket, StorageFixture.GzippedObjectName, stream);
var expected = Encoding.UTF8.GetBytes(StorageFixture.GzippedObjectContent);
var actual = stream.ToArray();
Assert.Equal(expected, actual);
}
Expand All @@ -322,8 +322,8 @@ public void DownloadGzippedFile_NoClientDecompression()
});
var client = new StorageClientImpl(service);
var stream = new MemoryStream();
client.DownloadObject(StorageFixture.TestBucket, "gzipped-text.txt", stream);
var expected = Encoding.UTF8.GetBytes("hello world");
client.DownloadObject(StorageFixture.TestBucket, StorageFixture.GzippedObjectName, stream);
var expected = Encoding.UTF8.GetBytes(StorageFixture.GzippedObjectContent);
var actual = stream.ToArray();
Assert.Equal(expected, actual);
}
Expand All @@ -340,9 +340,9 @@ public void DownloadGzippedFile_NoClientDecompression_IgnoreHash()
});
var client = new StorageClientImpl(service);
var stream = new MemoryStream();
client.DownloadObject(StorageFixture.TestBucket, "gzipped-text.txt", stream,
client.DownloadObject(StorageFixture.TestBucket, StorageFixture.GzippedObjectName, stream,
new DownloadObjectOptions { DownloadValidationMode = DownloadValidationMode.Never });
var expected = Encoding.UTF8.GetBytes("hello world");
var expected = Encoding.UTF8.GetBytes(StorageFixture.GzippedObjectContent);
var actual = stream.ToArray();
Assert.Equal(expected, actual);
}
Expand All @@ -359,9 +359,9 @@ public void DownloadGzippedFile_NoClientDecompression_AutomaticValidationMode()
});
var client = new StorageClientImpl(service);
var stream = new MemoryStream();
var obj = client.DownloadObject(StorageFixture.TestBucket, "gzipped-text.txt", stream,
var obj = client.DownloadObject(StorageFixture.TestBucket, StorageFixture.GzippedObjectName, stream,
new DownloadObjectOptions { DownloadValidationMode = DownloadValidationMode.Automatic });
var expected = Encoding.UTF8.GetBytes("hello world");
var expected = Encoding.UTF8.GetBytes(StorageFixture.GzippedObjectContent);
var actual = stream.ToArray();
Assert.Equal(expected, actual);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class HmacKeysTest

public HmacKeysTest(StorageFixture fixture) => _fixture = fixture;

[Fact]
[Fact(Skip = "b/477663109")]
// This test is async because of the helpers for testing eventually consistent changes.
// We are testing sync production code though.
public async Task Lifecycle()
Expand Down Expand Up @@ -102,7 +102,7 @@ await _fixture.EventuallyAsync(s_hmacKeyStateChangeConsistencyDelay, () =>
});
}

[Fact]
[Fact(Skip = "b/477663109")]
public async Task LifecycleAsync()
{
var client = _fixture.Client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class NormalizationTest
// URL should end with Caf%C3%A9
[InlineData("Caf\u00e9", "Normalization Form C")]
// Normalization Form D: an ASCII e followed by U+0301 combining character
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment also needs to be updated to match the new data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

// URL should end with Cafe%CC%81
[InlineData("Cafe\u0301", "Normalization Form D")]
// URL should end with Bebe%CC%81
[InlineData("Bebe\u0301", "Normalization Form D", Skip = "b/477619774")]
public void FetchObjectAndCheckContent(string name, string expectedContent)
{
TestEnvironment.SkipIfVpcSc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ public class PublicAccessPreventionTest
private const string InheritedValue = "inherited";
private static readonly Policy.BindingsData AllUsersViewer = new Policy.BindingsData
{
Members = new[] { "domain:google.com" },
Members = new[] { "allUsers" },
Role = "roles/storage.objectViewer"
};

private readonly StorageFixture _fixture;

public PublicAccessPreventionTest(StorageFixture fixture) => _fixture = fixture;

[Fact]
[Fact(Skip = "b/477676781")]
public void PreventAccessOnExistingBucket()
{
var client = _fixture.Client;
Expand All @@ -51,7 +51,7 @@ public void PreventAccessOnExistingBucket()
Assert.Throws<GoogleApiException>(() => client.SetBucketIamPolicy(bucketName, policy));
}

[Fact]
[Fact(Skip = "b/477676781")]
public void PreventAccessOnNewBucket()
{
var client = _fixture.Client;
Expand All @@ -70,7 +70,7 @@ public void PreventAccessOnNewBucket()
Assert.Throws<GoogleApiException>(() => client.SetBucketIamPolicy(bucketName, policy));
}

[Fact]
[Fact(Skip = "b/477676781")]
public void RestoreAccess()
{
var client = _fixture.Client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace Google.Cloud.Storage.V1.IntegrationTests
public sealed class StorageFixture : CloudProjectFixtureBase, ICollectionFixture<StorageFixture>
{
internal const string TestBucket = "dotnet-storage-library-test-bucket";
internal const string GzippedObjectName = "gzipped-text.txt";
internal const string GzippedObjectContent = "Hello World";

private const string RequesterPaysProjectEnvironmentVariable = "REQUESTER_PAYS_TEST_PROJECT";
private const string RequesterPaysCredentialsEnvironmentVariable = "REQUESTER_PAYS_CREDENTIALS";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public void GetBucketIamPolicy()
// See [GetBucketIamPolicy](ref) for a synchronous example.
// End see-also

[Fact]
[Fact(Skip = "b/477676781")]
public async Task SetBucketIamPolicy()
{
var projectId = _fixture.ProjectId;
Expand All @@ -651,7 +651,7 @@ public async Task SetBucketIamPolicy()
Console.WriteLine($"Response code before setting policy: {response1.StatusCode}");

// Fetch the current IAM policy, and modify it in memory to allow all users
// of a certain domain to view objects.
// to view objects.
Policy policy = client.GetBucketIamPolicy(bucketName);
string role = "roles/storage.objectViewer";
Policy.BindingsData binding = policy.Bindings
Expand All @@ -662,7 +662,7 @@ public async Task SetBucketIamPolicy()
binding = new Policy.BindingsData { Role = role, Members = new List<string>() };
policy.Bindings.Add(binding);
}
binding.Members.Add("domain:google.com");
binding.Members.Add("allUsers");

// Update the IAM policy on the bucket.
client.SetBucketIamPolicy(bucketName, policy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public async Task ComputeSignedURLGet()
Assert.Equal(_fixture.HelloWorldContent, content);
}

[Fact]
[Fact(Skip = "b/477663109")]
public async Task HmacSignedURLGet()
{
var bucketName = _fixture.BucketName;
Expand Down
6 changes: 6 additions & 0 deletions apis/Google.Cloud.Storage.V1/Google.Cloud.Storage.V1.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.Storage.V1.Thr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.ClientTesting", "..\..\tools\Google.Cloud.ClientTesting\Google.Cloud.ClientTesting.csproj", "{29974B0C-A7B0-8CA8-AE32-99F622C89044}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.PubSub.V1", "..\Google.Cloud.PubSub.V1\Google.Cloud.PubSub.V1\Google.Cloud.PubSub.V1.csproj", "{2F9E1835-414A-0CC2-963F-F41BDF7AFE4D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -63,6 +65,10 @@ Global
{29974B0C-A7B0-8CA8-AE32-99F622C89044}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29974B0C-A7B0-8CA8-AE32-99F622C89044}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29974B0C-A7B0-8CA8-AE32-99F622C89044}.Release|Any CPU.Build.0 = Release|Any CPU
{2F9E1835-414A-0CC2-963F-F41BDF7AFE4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F9E1835-414A-0CC2-963F-F41BDF7AFE4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F9E1835-414A-0CC2-963F-F41BDF7AFE4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F9E1835-414A-0CC2-963F-F41BDF7AFE4D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion tools/Google.Cloud.ClientTesting/TestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static void SkipOnRestrictedEnvironment()
{
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable(GoogleApplicationCredentialsEnvironmentVariable)))
{
throw new SkipException("Test skipped in VPCSC environment");
throw new SkipException("Test skipped in restricted environment");
}
}

Expand Down
Loading