1 |
|
2 |
|
3 |
|
4 | AGENT=./codegradxvmauthor.js
|
5 | HOSTNAME=vmauthor.codegradx.org
|
6 | HOSTIP=192.168.122.205
|
7 |
|
8 | [ -d tmp ] && rm -rf tmp
|
9 | mkdir -p tmp
|
10 |
|
11 |
|
12 | CREDENTIALS=tmp/fw4ex-student1.json
|
13 | wget -O $CREDENTIALS http://$HOSTIP/fw4exjson/1
|
14 |
|
15 |
|
16 |
|
17 | $AGENT --ip=$HOSTIP --credentials=$CREDENTIALS --update-credentials || true
|
18 |
|
19 |
|
20 | EXERCISES=tmp/fw4ex-example.json
|
21 | wget -O $EXERCISES http://$HOSTIP/e/path/example
|
22 |
|
23 |
|
24 | EXOURL=$(sed -rne 's/^ *"safecookie": "(.*)", *$/\1/p' < $EXERCISES | head -n1)
|
25 |
|
26 |
|
27 | $AGENT --ip=$HOSTIP \
|
28 | --credentials=$CREDENTIALS \
|
29 | --type=job \
|
30 | --xmldir=tmp \
|
31 | --stuff=spec/min.c --follow \
|
32 | --exercise="$EXOURL"
|
33 |
|
34 |
|
35 | [ -f tmp/2-jobStudentReport.xml ] && \
|
36 | grep -q ' mark="1" totalMark="1"' < tmp/2-jobStudentReport.xml && \
|
37 | echo OK
|
38 |
|
39 |
|