forked from haiwan/sledge
parent
308fb58106
commit
1daa5c42a0
@ -1 +1,2 @@
|
|||||||
result.dat
|
result.dat
|
||||||
|
res/*
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
SLEDGE_SCHEDULER=EDF
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true
|
@ -0,0 +1,3 @@
|
|||||||
|
SLEDGE_SCHEDULER=EDF
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=false
|
||||||
|
SLEDGE_SIGALRM_HANDLER=TRIAGED
|
@ -0,0 +1,2 @@
|
|||||||
|
SLEDGE_SCHEDULER=FIFO
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true
|
@ -0,0 +1,2 @@
|
|||||||
|
SLEDGE_SCHEDULER=FIFO
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=false
|
Binary file not shown.
@ -1,54 +1,62 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Executes the runtime in GDB
|
|
||||||
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
|
|
||||||
# This allows debugging outside of the Docker container
|
|
||||||
# Also disables pagination and stopping on SIGUSR1
|
|
||||||
|
|
||||||
experiment_directory=$(pwd)
|
# Add bash_libraries directory to path
|
||||||
echo "$experiment_directory"
|
__run_sh__base_path="$(dirname "$(realpath --logical "${BASH_SOURCE[0]}")")"
|
||||||
project_directory=$(cd ../../../.. && pwd)
|
__run_sh__bash_libraries_relative_path="../../../bash_libraries"
|
||||||
binary_directory=$(cd "$project_directory"/bin && pwd)
|
__run_sh__bash_libraries_absolute_path=$(cd "$__run_sh__base_path" && cd "$__run_sh__bash_libraries_relative_path" && pwd)
|
||||||
did_pass=true
|
export PATH="$__run_sh__bash_libraries_absolute_path:$PATH"
|
||||||
|
|
||||||
# Copy data if not here
|
source csv_to_dat.sh || exit 1
|
||||||
if [[ ! -f "./ekf_raw.dat" ]]; then
|
source framework.sh || exit 1
|
||||||
cp ../../../tests/TinyEKF/extras/c/ekf_raw.dat ./ekf_raw.dat
|
source get_result_count.sh || exit 1
|
||||||
fi
|
source panic.sh || exit 1
|
||||||
|
source path_join.sh || exit 1
|
||||||
|
|
||||||
if [ "$1" != "-d" ]; then
|
# Copy data if not here
|
||||||
PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" &
|
if [[ ! -f "$__run_sh__base_path/initial_state.dat" ]]; then
|
||||||
sleep 1
|
pushd "$__run_sh__base_path" || exit 1
|
||||||
else
|
pushd "../../../../tests/TinyEKF/extras/c/" || exit 1
|
||||||
echo "Running under gdb"
|
cp ekf_raw.dat "$__run_sh__base_path/initial_state.dat" || exit 1
|
||||||
|
popd || exit 1
|
||||||
|
popd || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
expected_result="$(tr -d '\0' < ./expected_result.dat)"
|
run_functional_tests() {
|
||||||
|
local -r hostname="$1"
|
||||||
|
local -r results_directory="$2"
|
||||||
|
local -i success_count=0
|
||||||
|
local -ir total_count=50
|
||||||
|
|
||||||
success_count=0
|
local expected_result
|
||||||
total_count=50
|
expected_result="$(tr -d '\0' < ./expected_result.dat)"
|
||||||
|
|
||||||
for ((i = 0; i < total_count; i++)); do
|
for ((i = 0; i < total_count; i++)); do
|
||||||
result="$(curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@ekf_raw.dat" localhost:10000 2> /dev/null | tr -d '\0')"
|
result="$(curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@ekf_raw.dat" localhost:10000 2> /dev/null | tr -d '\0')"
|
||||||
if [[ "$expected_result" == "$result" ]]; then
|
if [[ "$expected_result" == "$result" ]]; then
|
||||||
success_count=$((success_count + 1))
|
((success_count++))
|
||||||
else
|
else
|
||||||
echo "FAIL"
|
echo "Failed on $i:"
|
||||||
did_pass=false
|
echo "$result"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "$success_count / $total_count"
|
echo "$success_count / $total_count"
|
||||||
|
|
||||||
if [ "$1" != "-d" ]; then
|
if ((success_count == total_count)); then
|
||||||
sleep 5
|
echo "[OK]"
|
||||||
echo -n "Running Cleanup: "
|
return 0
|
||||||
pkill sledgert > /dev/null 2> /dev/null
|
else
|
||||||
echo "[DONE]"
|
echo "[Fail]"
|
||||||
fi
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if $did_pass; then
|
experiment_main() {
|
||||||
exit 0
|
local -r hostname="$1"
|
||||||
else
|
local -r results_directory="$2"
|
||||||
exit 1
|
|
||||||
fi
|
run_functional_tests "$hostname" "$results_directory" || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
Loading…
Reference in new issue