diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-03-19 13:11:37 +0000 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-03-19 13:11:37 +0000 |
commit | e58dcf978402315d78265636e7be82b5a613a3f4 (patch) | |
tree | 152759f269e735a1e0d5fcb36b42f95c52e5aa77 |
initial commit
-rwxr-xr-x | prepare-agenda.py | 29 | ||||
-rwxr-xr-x | prepare-config.py | 26 | ||||
-rwxr-xr-x | prepare-device.sh | 4 | ||||
-rwxr-xr-x | run-workload.sh | 4 | ||||
-rw-r--r-- | wa2host.yaml | 28 | ||||
-rw-r--r-- | wa2multi.json | 109 | ||||
-rw-r--r-- | wa2target.yaml | 23 |
7 files changed, 223 insertions, 0 deletions
diff --git a/prepare-agenda.py b/prepare-agenda.py new file mode 100755 index 0000000..ae3693f --- /dev/null +++ b/prepare-agenda.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +import yaml +from optparse import OptionParser + +TEMPLATE_PATH = "templates/" +SQLITE_DB = 'sqlite_database' +CONFIG = 'config' + +if __name__ == '__main__': + + usage = "usage: %prog [OPTIONS]" + parser = OptionParser(usage=usage) + parser.add_option("-a", "--agenda", dest="agenda", + help="Agenda file template to be used") + parser.add_option("-n", "--job-name", dest="job_name", + help="Job name to be used as db name in agenda file") + (options, args) = parser.parse_args() + + if not options.agenda: + parser.error("Agenda name missing") + if not options.job_name: + parser.error("Job name missing") + + agenda = open(TEMPLATE_PATH + options.agenda, "r") + agenda_yaml = yaml.load(agenda) + agenda_yaml[CONFIG][SQLITE_DB] = 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 new file mode 100755 index 0000000..ab2adf5 --- /dev/null +++ b/prepare-config.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +from ConfigParser import RawConfigParser +from optparse import OptionParser +from strint import Template +from StringIO import StringIO + +TEMPLATE_PATH = "templates/" +CONFIG_NAME = "config.py" +CONFIG_PATH = TEMPLATE_PATH + CONFIG_NAME +LAVA_CACHE_PATH = "/tmp/lava_multi_node_cache.txt" +ROOT = 'root' + +if __name__ == '__main__': + lava_cache_file = open(LAVA_CACHE_PATH, 'r') + lava_cache = '[' + ROOT + ']\n' + lava_cache_file.read() + lava_cache_file.close() + lava_cache_config = StringIO(lava_cache) + lava_cache_reader = RawConfigParser() + lava_cache_reader.readfp(lava_cache_config) + ipaddr = lava_cache_reader.read(ROOT, 'ipaddr') + config = open(CONFIG_PATH, "r") + config_template = Template(config.read()) + config.close() + dest_config = open(CONFIG_NAME, "w") + dest_config.write(config_template.substitute(ipaddr=ipaddr + ":5555")) + dest_config.close() diff --git a/prepare-device.sh b/prepare-device.sh new file mode 100755 index 0000000..814a5b2 --- /dev/null +++ b/prepare-device.sh @@ -0,0 +1,4 @@ +#!/usr/bin/sh + +echo "Preparing device for mode: $1" +exit 0 diff --git a/run-workload.sh b/run-workload.sh new file mode 100755 index 0000000..c9fcbc7 --- /dev/null +++ b/run-workload.sh @@ -0,0 +1,4 @@ +#!/usr/bin/sh + +run_workloads $1 -v -f -d $2 -c config.py +exit 0 diff --git a/wa2host.yaml b/wa2host.yaml new file mode 100644 index 0000000..8e33a1c --- /dev/null +++ b/wa2host.yaml @@ -0,0 +1,28 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: wa2-host + description: "WAv2 - host part of multinode job" + maintainer: + - milosz.wasilewski@linaro.org + os: + - ubuntu + scope: + - functional + devices: + - kvm + +params: + AGENDA: "hmp_audio.yaml" + JOB_NAME: "workload-automation" + MODE: "mp" + +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 lava-wait send-ip + - lava-test-case step5-prepare-config --shell ./prepare-config.py + - lava-test-case step6-prepare-device --shell ./prepare-device.sh $MODE + - lava-test-case step7-run-workload --shell ./run-workload.sh $AGENDA $JOB_NAME + - lava-test-case step8-multinode-sync --shell lava-sync workload-finished diff --git a/wa2multi.json b/wa2multi.json new file mode 100644 index 0000000..dc5c780 --- /dev/null +++ b/wa2multi.json @@ -0,0 +1,109 @@ +{ + "health_check": false, + "logging_level": "DEBUG", + "timeout": 6600, + "job_name": "WAv2 multi node", + "device_group": [ + { + "role": "host", + "count": 1, + "device_type": "dummy-ssh" + }, + { + "role": "target", + "count": 1, + "device_type": "vexpress-tc2" + } + ], + "actions": [ + { + "command": "dummy_deploy", + "parameters": { + "target_type": "ubuntu" + } + }, + { + "command": "deploy_linaro_android_image", + "metadata": { + "android.build": "202", + "android.name": "linaro-android-vexpress-lsk", + "android.url": "https://android-build.linaro.org/builds/~linaro-android/vexpress-lsk/" + }, + "parameters": { + "boot": "http://snapshots.linaro.org/android/~linaro-android/vexpress-lsk/202/boot.tar.bz2", + "data": "http://snapshots.linaro.org/android/~linaro-android/vexpress-lsk/202/userdata.tar.bz2", + "system": "http://snapshots.linaro.org/android/~linaro-android/vexpress-lsk/202/system.tar.bz2", + "role": "target" + } + }, + { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/people/milosz.wasilewski/wa2-lava.git", + "testdef": "wa2host.yaml", + "parameters": { + "AGENDA": "hmp_audio.yaml", + "JOB_NAME": "hmp_multinode_experiment1", + "MODE": "mp" + } + } + ], + "timeout": 4200, + "role": "host" + } + }, + { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/people/milosz.wasilewski/wa2-lava.git", + "testdef": "wa2target.yaml" + } + ], + "timeout": 2400, + "role": "target" + } + }, + { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/people/milosz.wasilewski/wa2-lava.git", + "testdef": "wa2host.yaml", + "parameters": { + "AGENDA": "hmp_audio.yaml", + "JOB_NAME": "hmp_multinode_experiment1", + "MODE": "mp" + } + } + ], + "timeout": 4200, + "role": "host" + } + }, + { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/people/milosz.wasilewski/wa2-lava.git", + "testdef": "wa2target.yaml" + } + ], + "timeout": 2400, + "role": "target" + } + }, + { + "command": "submit_results_on_host", + "parameters": { + "stream": "/anonymous/mwasilew/", + "server": "http://validation.linaro.org/RPC2/" + } + } + ] +} diff --git a/wa2target.yaml b/wa2target.yaml new file mode 100644 index 0000000..2e7fc11 --- /dev/null +++ b/wa2target.yaml @@ -0,0 +1,23 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: wa2-target + description: "WAv2 - target part of multinode job" + maintainer: + - milosz.wasilewski@linaro.org + os: + - ubuntu + scope: + - functional + devices: + - vexpress-tc2 + +run: + steps: + - lava-test-case step1-cat-build-info --shell cat /system/build.prop + - lava-test-case step2-get-adb --shell getprop service.adb.tcp.port + - 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 workload-finished + |