2022-12-29 14:52:55 +00:00
|
|
|
import native from 'k6/x/frostfs/native';
|
2023-04-13 13:31:54 +00:00
|
|
|
import { fail } from "k6";
|
|
|
|
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');
|
2024-06-14 07:41:15 +00:00
|
|
|
const frostfs_cli = native.connect("s01.frostfs.devenv:8080", "1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb", 0, 0, false, 0)
|
2022-05-12 19:37:38 +00:00
|
|
|
|
|
|
|
export const options = {
|
|
|
|
stages: [
|
2024-06-14 08:26:01 +00:00
|
|
|
{ duration: '30s', target: 10 },
|
2022-05-12 19:37:38 +00:00
|
|
|
],
|
|
|
|
};
|
|
|
|
|
2022-06-17 12:50:24 +00:00
|
|
|
export function setup() {
|
|
|
|
const params = {
|
|
|
|
acl: 'public-read-write',
|
|
|
|
placement_policy: 'REP 3',
|
|
|
|
name: 'container-name',
|
|
|
|
name_global_scope: 'false'
|
|
|
|
}
|
|
|
|
|
2022-12-29 14:52:55 +00:00
|
|
|
const res = frostfs_cli.putContainer(params)
|
2022-06-17 12:50:24 +00:00
|
|
|
if (!res.success) {
|
|
|
|
fail(res.error)
|
|
|
|
}
|
|
|
|
console.info("created container", res.container_id)
|
2024-06-14 08:26:01 +00:00
|
|
|
return { container_id: res.container_id }
|
2022-06-17 12:50:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default function (data) {
|
2022-05-12 19:37:38 +00:00
|
|
|
let headers = {
|
2022-06-17 12:50:24 +00:00
|
|
|
'unique_header': uuidv4()
|
2022-05-12 19:37:38 +00:00
|
|
|
}
|
2022-12-29 14:52:55 +00:00
|
|
|
let resp = frostfs_cli.put(data.container_id, headers, payload)
|
2022-05-12 19:37:38 +00:00
|
|
|
if (resp.success) {
|
2022-12-29 14:52:55 +00:00
|
|
|
frostfs_cli.get(data.container_id, resp.object_id)
|
2022-05-20 09:22:11 +00:00
|
|
|
} else {
|
|
|
|
console.log(resp.error)
|
2022-05-12 19:37:38 +00:00
|
|
|
}
|
2022-05-20 11:10:11 +00:00
|
|
|
}
|