aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-03-20 11:28:27 +0000
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-03-20 11:28:27 +0000
commit7f23f73ddaba4f7b498b4330b2fa2a3f03a004dd (patch)
tree7e5b12bf137190cd46e99a83a8882334999c6c67
parent03094b9deb2137536cebeb91d0e0a21737aaaf6a (diff)
added support for prefixing all signals to make sure correct lava shells are used
-rwxr-xr-xprepare-agenda.py3
-rwxr-xr-xprepare-config.py35
-rwxr-xr-xtear-down.sh5
-rw-r--r--wa2host.yaml10
-rw-r--r--wa2multi.json8
-rw-r--r--wa2target.yaml6
6 files changed, 42 insertions, 25 deletions
diff --git a/prepare-agenda.py b/prepare-agenda.py
index ae3693f..1d3704a 100755
--- a/prepare-agenda.py
+++ b/prepare-agenda.py
@@ -3,6 +3,7 @@ import yaml
from optparse import OptionParser
TEMPLATE_PATH = "templates/"
+SQLITE_DB_GLOBAL_PATH = "/root/db_results/"
SQLITE_DB = 'sqlite_database'
CONFIG = 'config'
@@ -23,7 +24,7 @@ if __name__ == '__main__':
agenda = open(TEMPLATE_PATH + options.agenda, "r")
agenda_yaml = yaml.load(agenda)
- agenda_yaml[CONFIG][SQLITE_DB] = options.job_name + ".db"
+ agenda_yaml[CONFIG][SQLITE_DB] = SQLITE_DB_GLOBAL_PATH + options.job_name + ".db"
agenda.close()
with open(options.agenda, 'w') as outfile:
outfile.write( yaml.dump(agenda_yaml, default_flow_style=True) )
diff --git a/prepare-config.py b/prepare-config.py
index c1b301c..ab0c70a 100755
--- a/prepare-config.py
+++ b/prepare-config.py
@@ -2,28 +2,39 @@
import re
import sys
from string import Template
+from optparse import OptionParser
TEMPLATE_PATH = "templates/"
CONFIG_NAME = "config.py"
CONFIG_PATH = TEMPLATE_PATH + CONFIG_NAME
LAVA_CACHE_PATH = "/tmp/lava_multi_node_cache.txt"
-ROOT = 'root'
IPADDR_FILE = "IPADDR"
+IPADDR = "-ipaddr"
if __name__ == '__main__':
+ usage = "usage: %prog [OPTIONS]"
+ parser = OptionParser(usage=usage)
+ parser.add_option("-p", "--prefix", dest="prefix",
+ help="Signal prefix used in the multinode job to retrieve IP address")
+ (options, args) = parser.parse_args()
+
+ if not options.prefix:
+ parser.error("Prefix missing")
+
lava_cache_file = open(LAVA_CACHE_PATH, 'r')
- lava_cache = lava_cache_file.read()
- lava_cache_file.close()
- lava_cache_regexp = re.compile("^(?P<device_id>[a-zA-Z0-9_\-]+):(?P<key>\w+)=(?P<value>.*)$")
- print lava_cache
- lava_cache_match = lava_cache_regexp.search(lava_cache)
+ lava_cache_regexp = re.compile("^(?P<device_id>[a-zA-Z0-9_\-]+):(?P<key>[a-zA-Z0-9_\-]+)=(?P<value>.*)$")
ipaddr = None
- if lava_cache_match:
- ipaddr = lava_cache_match.group("value")
- ipaddr_file = open(IPADDR_FILE, "w")
- ipaddr_file.write(ipaddr)
- ipaddr_file.close()
- else:
+ for line in lava_cache_file.readlines()
+ print line
+ lava_cache_match = lava_cache_regexp.search(line)
+ if lava_cache_match:
+ if lava_cache_match.group("key") == options.prefix + IPADDR
+ ipaddr = lava_cache_match.group("value")
+ ipaddr_file = open(IPADDR_FILE, "w")
+ ipaddr_file.write(ipaddr)
+ ipaddr_file.close()
+ lava_cache_file.close()
+ if not ipaddr:
sys.exit(1)
config = open(CONFIG_PATH, "r")
config_template = Template(config.read())
diff --git a/tear-down.sh b/tear-down.sh
index ad529e8..a5d77d3 100755
--- a/tear-down.sh
+++ b/tear-down.sh
@@ -5,3 +5,8 @@ adb devices
echo "Disconnecting adb from $IPADDR:5555"
adb disconnect $IPADDR:5555
adb devices
+
+# do post processing of results
+
+# remove database
+#rm /root/db_results/$1.db
diff --git a/wa2host.yaml b/wa2host.yaml
index d9b2ba7..e54846f 100644
--- a/wa2host.yaml
+++ b/wa2host.yaml
@@ -15,18 +15,18 @@ params:
AGENDA: "hmp_audio.yaml"
JOB_NAME: "workload-automation"
MODE: "mp"
- FINISH_SIGNAL: "workload-finished"
+ SIGNAL_PREFIX: "workload"
run:
steps:
- lava-test-case step1-mkdir-templates --shell mkdir templates
- lava-test-case step2-copy-templates --shell cp /root/templates/* templates/
- lava-test-case step3-prepare-agenda --shell ./prepare-agenda.py --agenda $AGENDA --job-name $JOB_NAME
- - lava-test-case step4-wait-for-ip --shell lava-wait send-ip
+ - lava-test-case step4-wait-for-ip --shell lava-wait $SIGNAL_PREFIX-send-ip
- lava-test-case step5-kill-adb-server --shell adb kill-server
- lava-test-case step6-start-adb-server --shell adb start-server
- - lava-test-case step7-prepare-config --shell ./prepare-config.py
+ - lava-test-case step7-prepare-config --shell ./prepare-config.py --prefix $SIGNAL_PREFIX
- lava-test-case step8-prepare-device --shell ./prepare-device.sh $MODE
- lava-test-case step9-run-workload --shell ./run-workload.sh $AGENDA $JOB_NAME
- - lava-test-case step10-tear-down --shell ./tear-down.sh
- - lava-test-case step11-multinode-sync --shell lava-sync $FINISH_SIGNAL
+ - lava-test-case step10-tear-down --shell ./tear-down.sh $JOB_NAME
+ - lava-test-case step11-multinode-sync --shell lava-sync $SIGNAL_PREFIX-finished
diff --git a/wa2multi.json b/wa2multi.json
index a5b8bb6..f290b7e 100644
--- a/wa2multi.json
+++ b/wa2multi.json
@@ -47,7 +47,7 @@
"AGENDA": "hmp_audio.yaml",
"JOB_NAME": "hmp_multinode_experiment1",
"MODE": "mp",
- "FINISH_SIGNAL": "hmp_audio_iter1_finished"
+ "SIGNAL_PREFIX": "hmp-audio-iter1"
}
}
],
@@ -63,7 +63,7 @@
"git-repo": "git://git.linaro.org/people/milosz.wasilewski/wa2-lava.git",
"testdef": "wa2target.yaml",
"parameters": {
- "FINISH_SIGNAL": "hmp_audio_iter1_finished"
+ "SIGNAL_PREFIX": "hmp-audio-iter1"
}
}
@@ -83,7 +83,7 @@
"AGENDA": "hmp_audio.yaml",
"JOB_NAME": "hmp_multinode_experiment1",
"MODE": "mp",
- "FINISH_SIGNAL": "hmp_audio_iter2_finished"
+ "SIGNAL_PREFIX": "hmp-audio-iter2"
}
}
],
@@ -99,7 +99,7 @@
"git-repo": "git://git.linaro.org/people/milosz.wasilewski/wa2-lava.git",
"testdef": "wa2target.yaml",
"parameters": {
- "FINISH_SIGNAL": "hmp_audio_iter2_finished"
+ "SIGNAL_PREFIX": "hmp-audio-iter2"
}
}
],
diff --git a/wa2target.yaml b/wa2target.yaml
index 31a92b4..a6d28f2 100644
--- a/wa2target.yaml
+++ b/wa2target.yaml
@@ -12,7 +12,7 @@ metadata:
- vexpress-tc2
params:
- FINISH_SIGNAL: "workload-finished"
+ SIGNAL_PREFIX: "workload"
run:
steps:
@@ -21,6 +21,6 @@ run:
- lava-test-case step3-set-adb --shell setprop service.adb.tcp.port 5555
- lava-test-case step4-stop-adbd --shell stop adbd
- lava-test-case step5-start-adbd --shell start adbd
- - lava-test-case step6-send-ip --shell lava-send send-ip ipaddr=$(getprop dhcp.eth0.ipaddress)
- - lava-test-case step7-multinode-sync --shell lava-sync $FINISH_SIGNAL
+ - lava-test-case step6-send-ip --shell lava-send $SIGNAL_PREFIX-send-ip $SIGNAL_PREFIX-ipaddr=$(getprop dhcp.eth0.ipaddress)
+ - lava-test-case step7-multinode-sync --shell lava-sync $SIGNAL_PREFIX-finished