Skip to content

Commit

Permalink
[US] Added VUIds to match the number of charge stations available
Browse files Browse the repository at this point in the history
  • Loading branch information
usuletw022 committed Sep 27, 2023
1 parent 034f8be commit 11c289f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions loadtests/ws_load_test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ws from 'k6/ws';
import { check } from 'k6';
import encoding from 'k6/encoding';
import exec from 'k6/execution';

export const options = {
discardResponseBodies: true,
Expand All @@ -17,16 +18,14 @@ export const options = {
},
};

const csIds = [1, 2, 3, 4, 5];
let csId = csIds[Math.floor(Math.random()*csIds.length)];
let data = `cs00${csId}:fiddlesticks_fishsticks`;
let base64data = encoding.b64encode(data)

export default function () {
let vuIdInTest = exec.vu.idInTest
let data = `cs00${vuIdInTest}:fiddlesticks_fishsticks`;
let base64data = encoding.b64encode(data)
const params = {
headers: {'Sec-WebSocket-Protocol': 'ocpp1.6', 'Authorization': `Basic ${base64data}`}
};
const url = `ws://localhost/ws/cs00${csId}`;
const url = `ws://localhost/ws/cs00${vuIdInTest}`;
const res = ws.connect(url, params, function (socket) {
socket.send('[2,"1","BootNotification",{"chargePointModel":"me100","chargePointVendor":"me"}]');
socket.send('[2,"2","BootNotification",{"chargePointModel":"me100","chargePointVendor":"me"}]');
Expand Down

0 comments on commit 11c289f

Please sign in to comment.