2024-11-15 16:07:24 +00:00
|
|
|
import {fail} from 'k6'
|
2022-12-29 14:52:55 +00:00
|
|
|
import s3 from 'k6/x/frostfs/s3';
|
2024-11-15 16:07:24 +00:00
|
|
|
|
|
|
|
import {uuidv4} from '../scenarios/libs/k6-utils-1.4.0.js';
|
2022-05-12 19:37:38 +00:00
|
|
|
|
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"
|
2024-11-15 16:07:24 +00:00
|
|
|
const s3_cli =
|
|
|
|
s3.connect("https://s3.frostfs.devenv:8080", {'no_verify_ssl' : 'true'})
|
2022-05-12 19:37:38 +00:00
|
|
|
|
|
|
|
export const options = {
|
2024-11-15 16:07:24 +00:00
|
|
|
stages : [
|
|
|
|
{duration : '30s', target : 10},
|
|
|
|
],
|
2022-05-12 19:37:38 +00:00
|
|
|
};
|
|
|
|
|
2022-06-17 10:37:43 +00:00
|
|
|
export function setup() {
|
2024-11-15 16:07:24 +00:00
|
|
|
const params = {
|
|
|
|
acl : 'private',
|
|
|
|
lock_enabled : 'true',
|
|
|
|
location_constraint : 'ru'
|
|
|
|
}
|
2022-06-17 10:37:43 +00:00
|
|
|
|
2024-11-15 16:07:24 +00:00
|
|
|
const res = s3_cli.createBucket(bucket, params)
|
|
|
|
if (!res.success) {
|
|
|
|
fail(res.error)
|
|
|
|
}
|
2022-06-17 10:37:43 +00:00
|
|
|
}
|
|
|
|
|
2024-11-15 16:07:24 +00:00
|
|
|
export default function() {
|
|
|
|
const key = uuidv4();
|
|
|
|
if (s3_cli.put(bucket, key, payload).success) {
|
|
|
|
s3_cli.get(bucket, key)
|
|
|
|
}
|
2022-05-12 19:37:38 +00:00
|
|
|
}
|