copy code from my personal git repo
This commit is contained in:
parent
24d6c84170
commit
f9f509c619
28 changed files with 787 additions and 1 deletions
1
tests/button_empty.json
Normal file
1
tests/button_empty.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
1
tests/button_force_off.json
Normal file
1
tests/button_force_off.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{forceState:0}
|
||||
1
tests/button_force_on.json
Normal file
1
tests/button_force_on.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{forceState:1}
|
||||
1
tests/leds_3_values.json
Normal file
1
tests/leds_3_values.json
Normal 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
70
tests/leds_64_values.json
Normal 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
70
tests/leds_all-off.json
Normal 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]
|
||||
]
|
||||
}
|
||||
1
tests/leds_invalid_index_1.json
Normal file
1
tests/leds_invalid_index_1.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{index:-12,count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}
|
||||
1
tests/leds_invalid_index_2.json
Normal file
1
tests/leds_invalid_index_2.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{index:1234567,count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}
|
||||
1
tests/leds_invalid_index_3.json
Normal file
1
tests/leds_invalid_index_3.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{index:12345678901234567890,count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}
|
||||
1
tests/leds_invalid_index_4.json
Normal file
1
tests/leds_invalid_index_4.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{index:"All Computers Are Broken",count:3,values:[[255,0,0],[0,255,0],[0,0,255]]}
|
||||
1
tests/leds_missing_values.json
Normal file
1
tests/leds_missing_values.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{index:12,count:32,values:[[255,0,0],[0,255,0],[0,0,255]]}
|
||||
1
tests/leds_out_of_range_values.json
Normal file
1
tests/leds_out_of_range_values.json
Normal 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
10
tests/send_one_request.sh
Executable 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
12
tests/send_test_requests.sh
Executable 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
|
||||
5
tests/test-env.sh.example
Normal file
5
tests/test-env.sh.example
Normal 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue