2022-06-17 12:50:24 +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 native from 'k6/x/neofs/native';
|
|
|
|
|
2022-05-20 11:14:50 +00:00
|
|
|
const payload = open('../go.sum', 'b');
|
2022-06-17 12:50:24 +00:00
|
|
|
const neofs_cli = native.connect("s01.neofs.devenv:8080", "1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb")
|
2022-05-12 19:37:38 +00:00
|
|
|
|
|
|
|
export const options = {
|
|
|
|
stages: [
|
2022-06-17 12:50:24 +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'
|
|
|
|
}
|
|
|
|
|
|
|
|
const res = neofs_cli.putContainer(params)
|
|
|
|
if (!res.success) {
|
|
|
|
fail(res.error)
|
|
|
|
}
|
|
|
|
console.info("created container", res.container_id)
|
|
|
|
return {container_id: res.container_id}
|
|
|
|
}
|
|
|
|
|
|
|
|
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-06-17 12:50:24 +00:00
|
|
|
let resp = neofs_cli.put(data.container_id, headers, payload)
|
2022-05-12 19:37:38 +00:00
|
|
|
if (resp.success) {
|
2022-06-17 12:50:24 +00:00
|
|
|
neofs_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
|
|
|
}
|