xk6-frostfs/examples/s3local.js
Alejandro Lopez de6747fc0f [#14] Add s3 local loader
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-04-13 13:00:38 +00:00

15 lines
481 B
JavaScript

import {uuidv4} from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
import s3local from 'k6/x/frostfs/s3local';
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)
}
}