Update mock device type default template
authorDonghoon Shin <dhs.shine@gmail.com>
Fri, 9 Sep 2016 17:37:50 +0000 (17:37 +0000)
committerDonghoon Shin <dhs.shine@gmail.com>
Fri, 9 Sep 2016 17:37:50 +0000 (17:37 +0000)
litmus/__init__.py
litmus/templates/mock/__init__.py [new file with mode: 0644]
litmus/templates/mock/conf.yaml [new file with mode: 0644]
litmus/templates/mock/tc.yaml [new file with mode: 0644]
litmus/templates/mock/userscript.py [new file with mode: 0755]
litmus/templates/u3/conf.yaml
litmus/templates/xu3/conf.yaml

index d2c807443680a94f16ec9b6becae93945251c1ae..8b9e108a146e52dd81869fc88aa1acf7518ebfd5 100644 (file)
@@ -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 (file)
index 0000000..e69de29
diff --git a/litmus/templates/mock/conf.yaml b/litmus/templates/mock/conf.yaml
new file mode 100644 (file)
index 0000000..072e0d7
--- /dev/null
@@ -0,0 +1,4 @@
+binary_urls:
+    - http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/
+username: <username>
+password: <password>
diff --git a/litmus/templates/mock/tc.yaml b/litmus/templates/mock/tc.yaml
new file mode 100644 (file)
index 0000000..44ed8a2
--- /dev/null
@@ -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 (executable)
index 0000000..2abe0c9
--- /dev/null
@@ -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)
index 5dff57d980337b1e078f875a800361b42a9c119b..9a7674214edab5334226f84047a72294f39e5b85 100644 (file)
@@ -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   : <username>
-password   : <password>
+username: <username>
+password: <password>
index ba78dc80ab10f61d26da906fb07433a105fb4daf..b218ccd2c79fa9801fa34b17aa0d5afd62b5178d 100644 (file)
@@ -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   : <username>
-password   : <password>
+username: <username>
+password: <password>