No description
Find a file
Roman Khimov 236afe0445
Merge pull request #125 from nspcc-dev/modernize
Makefile: add `modernize` target
2026-02-27 19:05:16 +03:00
.github *: Set go 1.25 as minimum required 2026-02-24 15:20:49 +04:00
examples [#50] Use native.connect timeouts everywhere 2023-01-10 12:13:49 +03:00
internal go.mod: Upgrade github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.15 => v1.0.0-rc.16.0.20260130135659-48d746d584cf 2026-02-02 14:51:17 +04:00
scenarios presets/s3: put only object IDs to preset file, never false 2025-11-17 18:56:07 +03:00
.gitignore workflows: reuse org-wide linter job 2024-09-10 21:07:18 +03:00
CHANGELOG.md *: Set go 1.25 as minimum required 2026-02-24 15:20:49 +04:00
CONTRIBUTING.md Add CONTRIBUTING guidelines 2022-06-01 17:54:48 +03:00
go.mod go.mod: Upgraded github.com/aws/aws-sdk-go-v2/service/s3 v1.88.0 => v1.96.1 2026-02-24 15:28:22 +04:00
go.sum go.mod: Upgraded github.com/aws/aws-sdk-go-v2/service/s3 v1.88.0 => v1.96.1 2026-02-24 15:28:22 +04:00
LICENSE [#8] Add LICENSE 2022-06-01 17:09:34 +03:00
Makefile Makefile: specify .PHONY targets 2026-02-27 18:59:09 +03:00
neofs.go Revert "tree: add simple tree service loader" 2024-06-11 20:47:06 +03:00
README.md makefile: Fixation the binary versions, update Readme 2023-09-20 09:11:43 +04: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
  1. Clone this repository
git clone 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

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