summaryrefslogtreecommitdiff
path: root/invoke_session_debian
blob: b7bdf75a0c336f0bef34f171b1eb226bdf47fb1f (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
#!/bin/bash
# Usage ./invoke_session <gateway>

# Hack for now until lava-test-shell is smart enough to know it's dispatcher ip
gateway=$1
listener_addr=$2
listener_port=$3
echo "Target's Gateway: $gateway"

if ! grep 'invoke_session' /etc/rc.local
then
	sed -i '/bin/a invoke_session &' /etc/rc.local
fi

# Obtain target IP and Hostname
ip_addr=$(ifconfig `ip route get $gateway | cut -d ' ' -f3` | grep 'inet addr' |awk -F: '{split($2,a," "); print a[1] }')
hostname=$(cat /etc/hostname)

# Set the PATH to use the LAVA api
echo "export PATH=/lava/bin/:$PATH" > ~/.bashrc

echo ""
echo ""
echo "*********************************************************************************************"
echo -n "Please connect to: "
echo -n "ssh -A "
echo -n "-o UserKnownHostsFile=/dev/null "
echo -n "-o StrictHostKeyChecking=no "
echo -n "root@"
echo -n ${ip_addr}.lab
echo ""
echo "Then:"
echo "1) Copy compiler into place on that target"
echo "2) Run benchmark.sh <lava_user>:<lava_token> <benchmark> <compiler> <target>"
echo ""
echo "For example:"
echo "wget http://releases.linaro.org/14.11/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz"
echo "tar xf gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz"
echo "export LAVA_SERVER=bogden:<my_lava_auth_token>@validation.linaro.org/RPC2/"
echo "benchmark.sh fakebench ${HOME}/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc juno-a57"
echo "*********************************************************************************************"
echo ""
echo ""
mkdir -p /run
mkdir -p /run/hacking
echo $$ > /run/hacking/hacking.pid

#suspend in a way that is portable across shells and doesn't involve a busy-wait
pid=
trap 'kill $pid
      trap - SIGCONT' SIGCONT
echo "Benchmarking session active..."
sleep 999d& #timeout after 2 or 3 years... the job is likely to have a rather shorter timeout associated with it
pid=$!
wait

echo "Benchmarking session ended..."
echo "<LAVA_TEST_RUNNER>: exiting"