From: Donghoon Shin Date: Fri, 9 Sep 2016 17:37:50 +0000 (+0000) Subject: Update mock device type default template X-Git-Tag: 0.3.3~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e88070e511fa06ed927796bfb8d7ec604a8c8521;p=tools%2Flitmus.git Update mock device type default template --- diff --git a/litmus/__init__.py b/litmus/__init__.py index d2c8074..8b9e108 100644 --- a/litmus/__init__.py +++ b/litmus/__init__.py @@ -21,4 +21,4 @@ _duts_ = os.path.join(_confdir_, 'topology') _projects_ = os.path.join(_confdir_, 'projects') _tmpdir_ = '/tmp' _path_for_locks_ = '/var/lock/litmus/' -_dev_types_ = ('u3', 'xu3', 'empty') +_dev_types_ = ('u3', 'xu3', 'mock', 'empty') diff --git a/litmus/templates/mock/__init__.py b/litmus/templates/mock/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/litmus/templates/mock/conf.yaml b/litmus/templates/mock/conf.yaml new file mode 100644 index 0000000..072e0d7 --- /dev/null +++ b/litmus/templates/mock/conf.yaml @@ -0,0 +1,4 @@ +binary_urls: + - http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/ +username: +password: diff --git a/litmus/templates/mock/tc.yaml b/litmus/templates/mock/tc.yaml new file mode 100644 index 0000000..44ed8a2 --- /dev/null +++ b/litmus/templates/mock/tc.yaml @@ -0,0 +1,23 @@ +testcases: + - name: verify_process_is_running + from: litmus.helper.tests + result_dir: result + plan: + - name: enlightenment_is_running + param: enlightenment + pattern: .*/usr/bin/enlightenment.* + - name: deviced_is_running + param: deviced + pattern: .*/usr/bin/deviced.* + - name: pulseaudio_is_running + param: pulseaudio + pattern: .*/usr/bin/pulseaudio.* + - name: sdbd_is_running + param: sdbd + pattern: .*/usr/sbin/sdbd.* + - name: alarm-server_is_running + param: alarm-server + pattern: .*/usr/bin/alarm-server.* + - name: media-server_is_running + param: media-server + pattern: .*/usr/bin/media-server.* diff --git a/litmus/templates/mock/userscript.py b/litmus/templates/mock/userscript.py new file mode 100755 index 0000000..2abe0c9 --- /dev/null +++ b/litmus/templates/mock/userscript.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 +import os +from litmus.core.util import load_yaml +from litmus.core.manager import manager +from litmus.helper.helper import tizen_snapshot_downloader as downloader +from litmus.helper.tests import add_test_helper + + +def main(*args, **kwargs): + + # init manager instance + mgr = manager(*args, **kwargs) + + # init working directory + mgr.init_workingdir() + + # get projectinfo + project_info = load_yaml('conf.yaml') + + username = project_info['username'] + password = project_info['password'] + binary_urls = project_info['binary_urls'] + + # get version from parameter + try: + version = kwargs['param'][0] + except (IndexError, TypeError): + version = None + + # download binaries from snapshot download server + filenames = [] + for url in binary_urls: + filenames.extend(downloader(url=url, + username=username, + password=password, + version=version)) + + # get an available device for testing. + dut = mgr.acquire_dut('mock', max_retry_times=180) + + # flashing binaries to device. + dut.flash(filenames) + + # turn on dut. + dut.on() + + # run helper functions for testing. + if not os.path.exists('result'): + os.mkdir('result') + + testcases = load_yaml('tc.yaml') + add_test_helper(dut, testcases) + dut.run_tests() + + # turn off dut. + dut.off() + + # release a device + mgr.release_dut(dut) diff --git a/litmus/templates/u3/conf.yaml b/litmus/templates/u3/conf.yaml index 5dff57d..9a76742 100644 --- a/litmus/templates/u3/conf.yaml +++ b/litmus/templates/u3/conf.yaml @@ -1,5 +1,5 @@ binary_urls: - http://download.tizen.org/snapshots/tizen/tv/latest/images/arm-wayland/tv-wayland-armv7l-odroidu3/ - http://download.tizen.org/snapshots/tizen/tv/latest/images/arm-wayland/tv-boot-armv7l-odroidu3/ -username : -password : +username: +password: diff --git a/litmus/templates/xu3/conf.yaml b/litmus/templates/xu3/conf.yaml index ba78dc8..b218ccd 100644 --- a/litmus/templates/xu3/conf.yaml +++ b/litmus/templates/xu3/conf.yaml @@ -1,5 +1,5 @@ binary_urls: - http://download.tizen.org/snapshots/tizen/tv/latest/images/arm-wayland/tv-wayland-armv7l-odroidu3/ - http://download.tizen.org/snapshots/tizen/tv/latest/images/arm-wayland/tv-boot-armv7l-odroidxu3/ -username : -password : +username: +password: