Skip to content

Commit 953adff

Browse files
author
Gregory House
committed
Stress transactions scheduling added
1 parent f0e812c commit 953adff

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

development/stress.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Step 1: Login to get the token
4+
login_response=$(curl -s -X POST http://localhost:8080/login \
5+
-H "Content-Type: application/json" \
6+
-d '{"username": "ghouse", "password": "idontlikepeople"}')
7+
8+
echo "$login_response"
9+
10+
sleep 1
11+
12+
# Step 2: Extract token using jq (requires jq to be installed)
13+
token=$(echo "$login_response" | jq -r '.token')
14+
15+
# Optional: check if token is empty
16+
if [ -z "$token" ] || [ "$token" == "null" ]; then
17+
echo "Failed to get JWT token"
18+
echo "Response: $login_response"
19+
exit 1
20+
fi
21+
22+
echo $token
23+
24+
while true; do
25+
curl -X POST http://localhost:8080/transactions/schedule \
26+
-H "Authorization: Bearer $token" \
27+
-H "Content-Type: application/json" \
28+
-d '{
29+
"operation": "setfacl",
30+
"targetPath": "/mnt/nfs-system/home/maverick/linux-acl-management-aclapi/README.md",
31+
"entries": {
32+
"entityType": "user",
33+
"entity": "tommy",
34+
"permissions": "rw-",
35+
"action": "modify"
36+
}
37+
}'
38+
done

0 commit comments

Comments
 (0)