summaryrefslogtreecommitdiff
path: root/run-host.sh
blob: e986502ff01db11ab106f06b0ec7e96ef7c9cfe0 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash

set -e
set -x

echo "Perfoming Toolchain Benchmark Setup!"
cd ~
mkdir -p toolchain
cd toolchain
echo "Fetching and Unpacking Toolchain!"
curl $2 | tar --strip-components=1 -xvJ | wc
cd bin
ls -al
export CROSS_COMPILE=$(pwd)/$4
echo "Cross Compiler Configuration!"
echo $CROSS_COMPILE
echo "GCC Version!"
/root/toolchain/bin/arm-linux-gnueabihf-gcc -v
cd ~
echo "Fetching Benchmark Binaries!"
wget -q $5
echo "Fetching Benchmark Scripts!"
git clone -b test $3 scripts
mkdir -p /tmp/spec
echo "Generating RSA Keys!"
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
echo StrictHostKeyChecking=no > ~/.ssh/config
echo "Toolchain Benchmark Setup Complete!"
echo "Configuring Toolchain Benchmark!"
echo "Forcing NTP Update!"
service ntp stop
ntpd -gq
service ntp start
echo "Dumping Network Info!"
ifconfig -a
route
echo "LAVA Network Broadcast!"
lava-network broadcast $1
echo "LAVA Network Collect!"
lava-network collect $1
echo "LAVA Group Gather Host Hostname!"
export HOST_HOSTNAME=$(lava-group | grep host | awk '{print $1}')
echo $HOST_HOSTNAME
echo "LAVA Group Gather Target Hostname!"
export TARGET_HOSTNAME=$(lava-group | grep target | awk '{print $1}')
echo $TARGET_HOSTNAME
echo "LAVA Network Query For Target IP!"
export TARGET=$(lava-network query $TARGET_HOSTNAME ipv4 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
echo $TARGET
echo "LAVA Network Query for Host IP!"
export HOST=$(lava-network query $HOST_HOSTNAME ipv4 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
echo $HOST
echo "Setting SPEC PATH!"
export SPEC=/tmp/spec
echo $SPEC
echo "Dumping LAVA Network Cache!"
cat /tmp/lava_multi_node_network_cache.txt
echo "Exchanging Host Key!"
lava-sync host-key-exchange-start
cat ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa.pub | nc -l 1337
lava-sync host-key-exchange-done
echo "Exchanging Target Key!"
lava-sync target-key-exchange-start
sleep 20
nc $TARGET 1337 > ~/.ssh/authorized_keys
cat ~/.ssh/authorized_keys
lava-sync target-key-exchange-done
cd ~/scripts
export CONFIG=linaro-cross-$(date +%Y%m%dT%H%M%S)
echo "CONFIG is:"
echo $CONFIG
echo "Running SPEC2 Check!"
lava-test-case spec2xxx-check --shell ./spec2xxx-check
echo "Running SPEC2 Install!"
lava-test-case spec2xxx-install --shell ./spec2xxx-install ~/$(basename $5)
echo "Running SPEC2 Prepare!"
lava-test-case spec2xxx-prepare --shell ./spec2xxx-prepare ./linux-armv7l-gcc4-linaro.in $CROSS_COMPILE
echo "Running SPEC2 Build!"
lava-test-case spec2xxx-build --shell ./spec2xxx-build
echo "Running SPEC2!"
lava-test-case spec2xxx-run --shell ./spec2xxx-run
echo "Running SPEC2 Results"
mkdir -p result
lava-test-case spec2xxx-result --shell ./spec2xxx-result ./result
for file in ./result/*; do
        cat $file
done 
lava-sync done