xk6-frostfs/examples/s3local.js
Alejandro Lopez 7bb16cdd94 [#49] Import and use k6-utils library for uuidv4
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-04-13 16:31:54 +03:00

15 lines
475 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", {}, {
'testbucket': 'GBQDDUM1hdodXmiRHV57EUkFWJzuntsG8BG15wFSwam6',
});
export default function () {
const key = uuidv4();
if (s3local_cli.put(bucket, key, payload).success) {
s3local_cli.get(bucket, key)
}
}