summaryrefslogtreecommitdiff
path: root/benchmark.sh
blob: 9fe992e57e429f7064b96f39c1e6c8b9a32bc0c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -u
set -o pipefail

if ! ssh-add -l; then
  echo "No agent key - reconnect with agent forwarding" >&2
  exit 1
fi

rm -f /usr/local/bin/git-new-workdir
ln /usr/share/doc/git/contrib/workdir/git-new-workdir /usr/local/bin
chmod 755 /usr/local/bin/git-new-workdir

if ! test -e ~/data; then
  mkdir ~/data || exit 1
  if ! ssh-keygen -P '' -f ~/data/onetime < /dev/null; then
    rm -rf ~/data
    exit 1
  fi
fi

if ! test -e ~/src; then
  mkdir ~/src || exit 1
  if ! git clone -b bernie/benchmarking http://git.linaro.org/toolchain/abe ~/src/abe; then
    rm -rf ~/src
    exit 1
  fi
fi

if ! test -e ~/work; then
  mkdir ~/work
  if ! (cd work; ~/src/abe/configure --with-fileserver=148.251.136.42 --with-remote-snapshots=/snapshots-ref); then
    rm -rf ~/work
    exit 1
  fi
fi

export LAVA_SSH_KEYFILE=${HOME}/data/onetime
export LAVA_IN_LAB=1

cd ~/work
~/src/abe/scripts/benchmark.sh -b $1 -i $2 $3