forked from TrueCloudLab/xk6-frostfs
23feb6c937
Signed-off-by: Denis Kirillov <denis@nspcc.ru> (cherry picked from commit cb21178ae7e1ba6e956b3b3ea0a845fe6b0ca48a)
33 lines
760 B
JavaScript
33 lines
760 B
JavaScript
import {uuidv4} from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
|
|
import {fail} from 'k6'
|
|
import s3 from 'k6/x/neofs/s3';
|
|
|
|
const payload = open('../go.sum', 'b');
|
|
const bucket = "cats"
|
|
const s3_cli = s3.connect("https://s3.neofs.devenv:8080", {'no_verify_ssl': 'true'})
|
|
|
|
export const options = {
|
|
stages: [
|
|
{duration: '30s', target: 10},
|
|
],
|
|
};
|
|
|
|
export function setup() {
|
|
const params = {
|
|
acl: 'private',
|
|
lock_enabled: 'true',
|
|
location_constraint: 'ru'
|
|
}
|
|
|
|
const res = s3_cli.createBucket(bucket, params)
|
|
if (!res.success) {
|
|
fail(res.error)
|
|
}
|
|
}
|
|
|
|
export default function () {
|
|
const key = uuidv4();
|
|
if (s3_cli.put(bucket, key, payload).success) {
|
|
s3_cli.get(bucket, key)
|
|
}
|
|
}
|