copy code from my personal git repo

This commit is contained in:
Fabrice Bellamy 2026-01-28 17:57:15 +01:00
parent 24d6c84170
commit f9f509c619
28 changed files with 787 additions and 1 deletions

1
tests/button_empty.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
{forceState:0}

View file

@ -0,0 +1 @@
{forceState:1}

1
tests/leds_3_values.json Normal file
View file

@ -0,0 +1 @@
{index:12,count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}

70
tests/leds_64_values.json Normal file
View file

@ -0,0 +1,70 @@
{
index:0,
count:64,
values:[
[255,0,0],
[0,255,0],
[0,0,255],
[128,128,0],
[128,0,128],
[0,128,128],
[84,84,84],
[0,0,0],
[255,0,0],
[0,255,0],
[0,0,255],
[128,128,0],
[128,0,128],
[0,128,128],
[84,84,84],
[0,0,0],
[255,0,0],
[0,255,0],
[0,0,255],
[128,128,0],
[128,0,128],
[0,128,128],
[84,84,84],
[0,0,0],
[255,0,0],
[0,255,0],
[0,0,255],
[128,128,0],
[128,0,128],
[0,128,128],
[84,84,84],
[0,0,0],
[255,0,0],
[0,255,0],
[0,0,255],
[128,128,0],
[128,0,128],
[0,128,128],
[84,84,84],
[0,0,0],
[255,0,0],
[0,255,0],
[0,0,255],
[128,128,0],
[128,0,128],
[0,128,128],
[84,84,84],
[0,0,0],
[255,0,0],
[0,255,0],
[0,0,255],
[128,128,0],
[128,0,128],
[0,128,128],
[84,84,84],
[0,0,0],
[255,0,0],
[0,255,0],
[0,0,255],
[128,128,0],
[128,0,128],
[0,128,128],
[84,84,84],
[0,0,0]
]
}

70
tests/leds_all-off.json Normal file
View file

@ -0,0 +1,70 @@
{
index:0,
count:64,
values:[
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0]
]
}

View file

@ -0,0 +1 @@
{index:-12,count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}

View file

@ -0,0 +1 @@
{index:1234567,count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}

View file

@ -0,0 +1 @@
{index:12345678901234567890,count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}

View file

@ -0,0 +1 @@
{index:"All Computers Are Broken",count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}

View file

@ -0,0 +1 @@
{index:12,count:32,values:[[255,0,0],[0,255,0],[0,0,255]]}

View file

@ -0,0 +1 @@
{index:12,count:3,values:[[-1,0,0],[0,600,0],[0,0,70000]]}

10
tests/send_one_request.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
source "test-env.sh"
REQUEST=${1:-"./leds_64_values.json"}
TARGET=${test_base_url}${2:-/bibleds}
echo "##########################################"
echo "# sending post request to ${TARGET} with :"
echo "# ${REQUEST}"
echo "##########################################"
curl -i -u "${leds_user}:${leds_password}" --request POST --data "@${REQUEST}" --header "Content-Type: application/json" ${TARGET}
echo

12
tests/send_test_requests.sh Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
source "test-env.sh"
TARGET=${test_base_url}/bibleds
for f in leds*.json; do
echo "##########################################"
echo "# sending post request to ${TARGET} with :"
echo "# ${f}"
echo "##########################################"
time curl -u "${leds_user}:${leds_password}" --request POST --data "@${f}" --header "Content-Type: application/json" ${TARGET}
echo
echo
done

View file

@ -0,0 +1,5 @@
export test_button_user="poweruser"
export test_button_password="AllComputersAreBroken"
export test_leds_user="user"
export test_leds_password="yolo"
export test_base_url="http://10.13.12.40:8000"