From a47941d720a458fb8281ae5edf8d5bec2ee18792 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Mon, 2 Apr 2018 16:02:12 +0100 Subject: [PATCH] perf-test: add -W/--witness-check to validate SV-COMP witness checking --- scripts/perf-test/ebs.yaml | 2 ++ scripts/perf-test/ec2.yaml | 66 +++++++++++++++++++++++++++++++--- scripts/perf-test/perf_test.py | 10 ++++-- 3 files changed, 72 insertions(+), 6 deletions(-) diff --git a/scripts/perf-test/ebs.yaml b/scripts/perf-test/ebs.yaml index e76a7497880..ce3a96f4792 100644 --- a/scripts/perf-test/ebs.yaml +++ b/scripts/perf-test/ebs.yaml @@ -36,6 +36,8 @@ Resources: https://github.com/sosy-lab/cpachecker.git git clone --depth 1 \ https://github.com/diffblue/cprover-sv-comp.git + git clone --depth 1 \ + https://github.com/tautschnig/fshell-w2t.git halt BaseVolume: diff --git a/scripts/perf-test/ec2.yaml b/scripts/perf-test/ec2.yaml index 9a052009bf5..0f113d4ce3d 100644 --- a/scripts/perf-test/ec2.yaml +++ b/scripts/perf-test/ec2.yaml @@ -38,6 +38,9 @@ Parameters: SSHKeyName: Type: String + WitnessCheck: + Type: String + Conditions: UseSpot: !Not [!Equals [!Ref MaxPrice, ""]] @@ -153,6 +156,7 @@ Resources: apt-get install -y git time wget binutils awscli make jq apt-get install -y zip unzip apt-get install -y gcc libc6-dev-i386 + apt-get install -y ant python3-tempita python # cgroup set up for benchexec chmod o+wt '/sys/fs/cgroup/cpuset/' @@ -223,6 +227,27 @@ Resources: mkdir -p tmp export TMPDIR=/mnt/tmp + if [ x${WitnessCheck} = xTrue ] + then + cd cpachecker + ant + + cd ../run + for def in \ + cpa-seq-validate-correctness-witnesses \ + cpa-seq-validate-violation-witnesses \ + fshell-witness2test-validate-violation-witnesses + do + wget -O $def.xml https://raw.githubusercontent.com/sosy-lab/sv-comp/master/benchmark-defs/$def.xml + sed -i 's#[\./]*/results-verified/LOGDIR/sv-comp18.\${!inputfile_name}.files/witness.graphml#witnesses/sv-comp18.${!inputfile_name}-witness.graphml#' $def.xml + done + + ln -s ../cpachecker/scripts/cpa.sh cpa.sh + ln -s ../cpachecker/config/ config + + cp ../fshell-w2t/* . + fi + # reduce the likelihood of multiple hosts processing the # same message (in addition to SQS's message hiding) sleep $(expr $RANDOM % 30) @@ -334,11 +359,26 @@ Resources: tar czf witnesses.tar.gz cbmc.*.logfiles rm -rf cbmc.*.logfiles cd .. + + if [ x${WitnessCheck} = xTrue ] + then + for wc in *-witnesses.xml + do + wcp=$(echo $wc | sed 's/-witnesses.xml$//') + mkdir witnesses + tar -C witnesses --strip-components=1 -xzf \ + logs-$t/witnesses.tar.gz + ../benchexec/bin/benchexec --no-container \ + $wc --task $t -T 90s -M 15GB \ + -o $wcp-logs-$t/ -N $max_par -c 1 + rm -rf witnesses + done + fi fi - if [ -f logs-$t/*.xml.bz2 ] - then - start_date="$(echo ${PerfTestId} | cut -f1-3 -d-) $(echo ${PerfTestId} | cut -f4-6 -d- | sed 's/-/:/g')" - cd logs-$t + start_date="$(echo ${PerfTestId} | cut -f1-3 -d-) $(echo ${PerfTestId} | cut -f4-6 -d- | sed 's/-/:/g')" + for l in *logs-$t/*.xml.bz2 + do + cd $(dirname $l) bunzip2 *.xml.bz2 perl -p -i -e \ "s/^(