forked from TrueCloudLab/xk6-frostfs
Alex Vanin
3c6023ca29
With #114, upload data functions now works with datagen payload only, thus examples has to be updated. Signed-off-by: Alex Vanin <a.vanin@yadro.com>
17 lines
612 B
JavaScript
17 lines
612 B
JavaScript
import s3local from 'k6/x/frostfs/s3local';
|
|
import datagen from 'k6/x/frostfs/datagen';
|
|
import { uuidv4 } from '../scenarios/libs/k6-utils-1.4.0.js';
|
|
|
|
const bucket = "testbucket"
|
|
const generator = datagen.generator(1024, "random", false);
|
|
const s3local_cli = s3local.connect("path/to/storage/config.yml", "path/to/storage/config/dir", {}, {
|
|
'testbucket': 'GBQDDUM1hdodXmiRHV57EUkFWJzuntsG8BG15wFSwam6',
|
|
});
|
|
|
|
export default function () {
|
|
const key = uuidv4();
|
|
const payload = generator.genPayload()
|
|
if (s3local_cli.put(bucket, key, payload).success) {
|
|
s3local_cli.get(bucket, key)
|
|
}
|
|
}
|