Skip to content
Draft
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
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ is expected to be used by Storage library maintainers.
- [When to use this testbench](#when-to-use-this-testbench)
- [How to use this testbench](#how-to-use-this-testbench)
- [Initial set up](#initial-set-up)
- [Run the testbench](#run-the-testbench)
- [Start the gRPC server](#start-the-gRPC-server)
- [Start the gRPC server](#start-the-grpc-server)
- [Check that the testbench is running](#check-that-the-testbench-is-running)
- [Updating Proto Files](#updating-proto-files)
- [Force Failures](#force-failures)
Expand All @@ -35,6 +34,7 @@ is expected to be used by Storage library maintainers.
- [Delete a Retry Test resource](#delete-a-retry-test-resource)
- [Causing a failure using x-retry-test-id header](#causing-a-failure-using-x-retry-test-id-header)
- [Forced Failures Supported](#forced-failures-supported)
- [Storage Control API Stall Support](#storage-control-api-stall-support)
- [Developing for the testbench](#developing-for-the-testbench)
- [Writing and running tests](#writing-and-running-tests)
- [Releasing the testbench](#releasing-the-testbench)
Expand Down Expand Up @@ -277,6 +277,37 @@ curl -H "x-retry-test-id: 1d05c20627844214a9ff7cbcf696317d" "http://localhost:91
| redirect-send-token-T | [HTTP] Unsupported [GRPC] Testbench will fail the RPC with `ABORTED` and include appropriate redirection error details.
| redirect-send-handle-and-token-T | [HTTP] Unsupported [GRPC] Testbench will fail the RPC with `ABORTED` and include appropriate redirection error details.

## Storage Control API Stall Support

The testbench supports stall functionality for the Storage Control API (gRPC only) to test client retry behavior. All folder operations and storage layout operations can be delayed using the `x-goog-emulator-instructions` metadata header.

**Supported operations:**
- **Folder operations:** `CreateFolder`, `DeleteFolder`, `GetFolder`, `ListFolders`, `RenameFolder`
- **Storage layout operations:** `GetStorageLayout`

> **Note:** The Storage Control API uses the **same gRPC server** as the Storage API. Both services are available on the same port (e.g., port 8888 if started with `curl "http://localhost:9000/start_grpc?port=8888"`).

**Supported stall instruction:**
- `stall-for-Ns`: Stalls for N seconds (e.g., `stall-for-3s` stalls for 3 seconds)

**Example usage in Python:**
```python
import grpc
from google.storage.control.v2 import storage_control_pb2, storage_control_pb2_grpc

# Connect to the same gRPC server port (8888) started earlier
channel = grpc.insecure_channel('localhost:8888')
stub = storage_control_pb2_grpc.StorageControlStub(channel)

# Create folder with 2-second stall
metadata = [('x-goog-emulator-instructions', 'stall-for-2s')]
request = storage_control_pb2.CreateFolderRequest(
parent="projects/_/buckets/test-bucket",
folder_id="test-folder"
)
response = stub.CreateFolder(request, metadata=metadata)
```

## Developing for the testbench

### Writing and running tests
Expand Down
14 changes: 0 additions & 14 deletions google/iam/v1/iam_policy_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions google/iam/v1/iam_policy_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
Expand Down
14 changes: 0 additions & 14 deletions google/iam/v1/options_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions google/iam/v1/options_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
Expand Down
14 changes: 0 additions & 14 deletions google/iam/v1/policy_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions google/iam/v1/policy_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
Expand Down
13 changes: 13 additions & 0 deletions google/storage/control/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
418 changes: 418 additions & 0 deletions google/storage/control/v2/storage_control_pb2.py

Large diffs are not rendered by default.

Loading
Loading