xk6-frostfs/examples/s3local.js
Anton Nikiforov 26f5262b3d
All checks were successful
Tests and linters / Tests (1.20) (pull_request) Successful in 1m46s
Tests and linters / Tests with -race (pull_request) Successful in 2m9s
DCO action / DCO (pull_request) Successful in 3m26s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m10s
[#90] Support config folder together with config file
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2023-10-25 16:48:29 +03:00

15 lines
505 B
JavaScript

import s3local from 'k6/x/frostfs/s3local';
import { uuidv4 } from '../scenarios/libs/k6-utils-1.4.0.js';
const bucket = "testbucket"
const payload = open('../go.sum', 'b');
const s3local_cli = s3local.connect("path/to/storage/config.yml", "path/to/storage/config/dir", {}, {
'testbucket': 'GBQDDUM1hdodXmiRHV57EUkFWJzuntsG8BG15wFSwam6',
});
export default function () {
const key = uuidv4();
if (s3local_cli.put(bucket, key, payload).success) {
s3local_cli.get(bucket, key)
}
}