feat: edf_one_iter framework

main
Sean McBride 4 years ago
parent 308fb58106
commit 1daa5c42a0

@ -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

@ -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"
source csv_to_dat.sh || exit 1
source framework.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Copy data if not here # Copy data if not here
if [[ ! -f "./ekf_raw.dat" ]]; then if [[ ! -f "$__run_sh__base_path/initial_state.dat" ]]; then
cp ../../../tests/TinyEKF/extras/c/ekf_raw.dat ./ekf_raw.dat pushd "$__run_sh__base_path" || exit 1
pushd "../../../../tests/TinyEKF/extras/c/" || exit 1
cp ekf_raw.dat "$__run_sh__base_path/initial_state.dat" || exit 1
popd || exit 1
popd || exit 1
fi fi
if [ "$1" != "-d" ]; then run_functional_tests() {
PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" & local -r hostname="$1"
sleep 1 local -r results_directory="$2"
else local -i success_count=0
echo "Running under gdb" local -ir total_count=50
fi
local expected_result
expected_result="$(tr -d '\0' < ./expected_result.dat)" expected_result="$(tr -d '\0' < ./expected_result.dat)"
success_count=0
total_count=50
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
echo "[DONE]"
fi
if $did_pass; then
exit 0
else else
exit 1 echo "[Fail]"
return 1
fi fi
}
experiment_main() {
local -r hostname="$1"
local -r results_directory="$2"
run_functional_tests "$hostname" "$results_directory" || return 1
}
main "$@"

Loading…
Cancel
Save