2022-06-17 10:37:43 +00:00
|
|
|
import {uuidv4} from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
|
|
|
|
import {fail} from 'k6'
|
2022-05-12 19:37:38 +00:00
|
|
|
import s3 from 'k6/x/neofs/s3';
|
|
|
|
|
2022-05-20 11:14:50 +00:00
|
|
|
const payload = open('../go.sum', 'b');
|
2022-05-12 19:37:38 +00:00
|
|
|
const bucket = "cats"
|
|
|
|
const s3_cli = s3.connect("http://s3.neofs.devenv:8080")
|
|
|
|
|
|
|
|
export const options = {
|
|
|
|
stages: [
|
2022-06-17 10:37:43 +00:00
|
|
|
{duration: '30s', target: 10},
|
2022-05-12 19:37:38 +00:00
|
|
|
],
|
|
|
|
};
|
|
|
|
|
2022-06-17 10:37:43 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-12 19:37:38 +00:00
|
|
|
export default function () {
|
|
|
|
const key = uuidv4();
|
2022-05-20 09:34:34 +00:00
|
|
|
if (s3_cli.put(bucket, key, payload).success) {
|
2022-06-17 10:37:43 +00:00
|
|
|
s3_cli.get(bucket, key)
|
2022-05-12 19:37:38 +00:00
|
|
|
}
|
|
|
|
}
|