No description
Find a file
2026-09-24 09:04:45 +03:00
.github workflows: drop useless mod download step 2026-09-09 23:33:31 +03:00
examples [#50] Use native.connect timeouts everywhere 2023-01-10 12:13:49 +03:00
internal Merge pull request #145 from nspcc-dev/copilot/fix-s3-region-error 2026-08-26 14:32:32 +03:00
scenarios s3: fix bucket selection 2026-09-10 13:15:38 +03:00
.gitignore preset: add help to install python dependencies 2026-08-27 08:46:23 -07:00
CHANGELOG.md CHANGELOG: release 0.3.0 2026-09-09 15:27:59 +03:00
CONTRIBUTING.md Add CONTRIBUTING guidelines 2022-06-01 17:54:48 +03:00
go.mod build(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc 2026-09-18 05:44:36 +00:00
go.sum build(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc 2026-09-18 05:44:36 +00:00
LICENSE [#8] Add LICENSE 2022-06-01 17:09:34 +03:00
Makefile preset: add help to install python dependencies 2026-08-27 08:46:23 -07:00
neofs.go Revert "tree: add simple tree service loader" 2024-06-11 20:47:06 +03:00
README.md preset: adjust the shebang line to use local venv 2026-09-01 11:57:13 -07:00

NeoFS

k6 extension to test and benchmark NeoFS related protocols.


License: GPL v3

xk6-neofs

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

  • Go
  • Git
  • Python 3 (for preset scripts)
  1. Clone this repository
git clone https://github.com/nspcc-dev/xk6-neofs
cd xk6-neofs
  1. Install xk6 framework for extending k6:
make install_xk6
  1. Build the binary:
make build
  1. Run k6:
./xk6-neofs run test-script.js

Preset

preset_grpc.py and preset_s3.py prepare containers/buckets and objects for the k6 scenarios. Install their Python dependencies into .venv:

make install_preset
source .venv/bin/activate

preset_grpc.py still needs neofs-cli on PATH to create containers.

python ./scenarios/preset/preset_grpc.py --wallet ./wallet.json --config ./config.yml \
  --endpoint 192.168.42.10:8080 --workers 1 --policy "REP 3" \
  --containers 1 --preload_obj 100 --size 4 --out ./grpc.json

See scenarios/run_scenarios.md for S3 presets and full scenario options.

API

Native

Create native client with connect method. Arguments:

  • neofs storage node endpoint
  • hex encoded private key (empty value produces random key)
  • dial timeout in seconds (0 for the default value)
  • stream timeout in seconds (0 for the default value)
import native from 'k6/x/neofs/native';
const neofs_cli = native.connect("s01.neofs.devenv:8080", "", 0, 0)

Methods

  • putContainer(params). The params is a dictionary (e.g. {acl:'public-read-write',placement_policy:'REP 3',name:'container-name',name_global_scope:'false'}). Returns dictionary with success boolean flag, container_id string, and error string.
  • setBufferSize(size). Sets internal buffer size for data upload and download. Default is 64 KiB.
  • put(container_id, headers, payload). Returns dictionary with success boolean flag, object_id string, and error string.
  • get(container_id, object_id). Returns dictionary with success boolean flag, and error string.
  • onsite(container_id, payload). Returns NeoFS object instance with prepared headers. Invoke put(headers) method on this object to upload it into NeoFS. It returns dictionary with success boolean flag, object_id string and error string.

S3

Create s3 client with connect method. Arguments:

  • s3 gateway endpoint

Credentials are taken from default AWS configuration files and ENVs.

import s3 from 'k6/x/neofs/s3';
const s3_cli = s3.connect("http://s3.neofs.devenv:8080")

You can also provide additional options:

import s3 from 'k6/x/neofs/s3';
const s3_cli = s3.connect("http://s3.neofs.devenv:8080", {'no_verify_ssl': 'true', 'timeout': '60s'})
  • no_verify_ss - Bool. If true - skip verifying the s3 certificate chain and host name (useful if s3 uses self-signed certificates)
  • timeout - Duration. Set timeout for requests (in http client). If omitted or zero - timeout is infinite.

Methods

  • createBucket(bucket, params). Returns dictionary with success boolean flag and error string. The params is a dictionary (e.g. {acl:'private',lock_enabled:'true',location_constraint:'ru'})
  • put(bucket, key, payload). Returns dictionary with success boolean flag and error string.
  • get(bucket, key). Returns dictionary with success boolean flag and error string.

Examples

See native protocol and s3 test suit examples in examples dir.

License