|
61 | 61 | zip -r "../${i}.zip" -- *
|
62 | 62 | )
|
63 | 63 | curl --fail -X POST -n -N -F zip=@${i}.zip http://localhost/domjudge/api/contests/demo/problems
|
64 |
| -done |
| 64 | + done |
| 65 | + - name: Preparing curl cookiejar |
| 66 | + run: | |
| 67 | + export CURLOPTS="--fail -sq -m 30 -b /tmp/cookiejar" |
| 68 | + # Make an initial request which will get us a session id, and grab the csrf token from it |
| 69 | + CSRFTOKEN=$(curl $CURLOPTS -c $COOKIEJAR "http://localhost/domjudge/login" 2>/dev/null | sed -n 's/.*_csrf_token.*value="\(.*\)".*/\1/p') |
| 70 | + # Make a second request with our session + csrf token to actually log in |
| 71 | + curl $CURLOPTS -c $COOKIEJAR -F "_csrf_token=$CSRFTOKEN" -F "_username=admin" -F "_password=password" "http://localhost/domjudge/login" |
| 72 | + # Send a general clarification to later test if we see the event. |
| 73 | + curl $CURLOPTS -F "sendto=" -F "problem=1-" -F "bodytext=Testing" -F "submit=Send" \ |
| 74 | + "http://localhost/domjudge/jury/clarifications/send" -o /dev/null |
| 75 | + NUMNOTVERIFIED=$(curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "submissions checked" | sed -r 's/^.* ([0-9]+) submissions checked.*$/\1/') |
| 76 | + NUMVERIFIED=$( curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "submissions not checked" | sed -r 's/^.* ([0-9]+) submissions not checked.*$/\1/') |
| 77 | + NUMNOMAGIC=$( curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier" | grep "without magic string" | sed -r 's/^.* ([0-9]+) without magic string.*$/\1/') |
| 78 | + # We expect |
| 79 | + # - two submissions with ambiguous outcome, |
| 80 | + # - one submissions submitted through the submit client, and thus the magic string ignored, |
| 81 | + # - and all submissions to be judged. |
| 82 | + if [ $NUMNOTVERIFIED -ne 2 ] || [ $NUMNOMAGIC -ne 1 ] || [ $NUMSUBS -gt $((NUMVERIFIED+NUMNOTVERIFIED)) ]; then |
| 83 | + echo "verified subs: $NUMVERIFIED, unverified subs: $NUMNOTVERIFIED, total subs: $NUMSUBS" |
| 84 | + echo "(expected 2 submissions to be unverified, but all to be processed)" |
| 85 | + echo "Of these $NUMNOMAGIC do not have the EXPECTED_RESULTS string (should be 1)." |
| 86 | + curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier?verify_multiple=1" | w3m -dump -T text/html |
| 87 | + exit 1 |
| 88 | + fi |
65 | 89 | - name: Monitor judgehost log and stop once all submissions are judged
|
66 | 90 | run: |
|
67 | 91 | tail -f /opt/domjudge/judgehost/log/judge*-0.log | while read line; do
|
|
0 commit comments