Version 0.2.0 9 Sep 2016
---------------------------
- Remove acmlock routine to improve test performance
-- Support flash function for mock device type
+- Support flash function for standalone device type
- Update test helper functions
Version 0.2.1 9 Sep 2016
---------------------------
- Update import command to use shell-like path expansions
-- Update mock device type to avoid sdb error
+- Update standalone device type to avoid sdb error
- Update default templates for u3 and xu3
Version 0.3.0 21 Sep 2016
---------------------------
- Update projects/topology file location
- Add projects/topology param at command prompt
-- Support multiple mock devices in topology
-- Add global lock for mock device type
+- Support multiple standalone devices in topology
+- Add global lock for standalone device type
Version 0.3.1 22 Sep 2016
---------------------------
Litmus uses sdb to communicate with device.
sdb is not released on download.tizen.org/tools but you can find it from sdk.
-Installing sdb from tizen sdk or download binary from below url.
+Install sdb from tizen sdk or download binary from below url.
32bit:
http://download.tizen.org/sdk/sdk-packages/official/binary/sdb_2.2.83_ubuntu-32.zip
* Update projects/topology file location
* Add projects/topology param at command prompt
- * Support multiple mock devices in topology
- * Add global lock for mock device type
+ * Support multiple standalone devices in topology
+ * Add global lock for standalone device type
-- Donghoon Shin <dhs.shin@samsung.com> Wed, 21 Sep 2016 15:08:00 +0900
litmus (0.2.1-1) unstable; urgency=low
* Update import command to use shell-like path expansions
- * Update mock device type to avoid sdb error
+ * Update standalone device type to avoid sdb error
* Update default templates for u3 and xu3
-- Donghoon Shin <dhs.shin@samsung.com> Fri, 9 Sep 2016 15:00:00 +0900
litmus (0.2.0-1) unstable; urgency=low
* Remove acmlock routine to imporve test performance
- * Support flash function for mock device type
+ * Support flash function for standalone device type
* Update test helper functions
-- Donghoon Shin <dhs.shin@samsung.com> Fri, 9 Sep 2016 10:03:05 +0900
_projects_ = os.path.join(_confdir_, 'projects')
_tmpdir_ = '/tmp'
_path_for_locks_ = '/var/lock/litmus/'
-_dev_types_ = ('u3', 'xu3', 'mock', 'empty')
+_dev_types_ = ('u3', 'xu3', 'standalone', 'empty')
# Append items
self._all_devices.append(items)
-
- if not next((d for d in self._all_devices if d['dev_type'] == 'mock'),
- None):
- # Add mock device
- mock_devicename = 'MOCK_001'
- mock_ilock_filename = os.path.join(self._path_for_locks,
- mock_devicename)
- mock = {'devicename': mock_devicename,
- 'dev_type': 'mock',
- 'tlock': Lock(),
- 'ilock': fasteners.InterProcessLock(mock_ilock_filename)}
- self._all_devices.append(mock)
+++ /dev/null
-#!/usr/bin/env python3
-# Copyright 2015-2016 Samsung Electronics Co., Ltd.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import time
-import logging
-from litmus.device.device import device
-from litmus.core.util import check_output, find_pattern
-from litmus.core.util import call
-
-
-class devicemock(device):
- """
- Litmus device class.
- User can control device in topology by this class methods.
- """
-
- _booting_time = 60
-
- def __init__(self, *args, **kwargs):
- self.args = args
- self.kwargs = kwargs
- self._name = kwargs['devicename']
- if 'serialno' in kwargs:
- self._id = kwargs['serialno']
- else:
- self._id = self._find_device_id()
-
- self._manager = kwargs['manager']
-
- def _release(self):
- """docstring for _release"""
- pass
-
- def _find_device_id(self):
- """docstring for _find_device_id"""
- self.start_sdb_server()
- outs = check_output(['sdb', 'devices'], timeout=10)
- pattern = '.*List of devices attached \n([a-zA-Z0-9]*).*device.*'
- found = find_pattern(pattern, outs, groupindex=1)
- if found:
- return found
-
- # public methods.
-
- def get_id(self):
- """
- Return the id of acquired device.
- Device instance uses this id for sdb connection.
-
- Example:
- >>> dut = mgr.acquire_dut('xu3')
- >>> dut.get_id()
- 'XU3_001'
-
- :returns str: device id
- """
- return self._id
-
- def on(self, booting_time=None):
- """
- Turn on the device acquired.
-
- :param float powercut_delay: power-cut delay for cutter
- """
- logging.debug('=================Turn on device {}=================='
- .format(self.get_name()))
-
- self.start_sdb_server()
- if self.is_on():
- self._sdb_root_on()
- self.run_cmd('reboot -f', timeout=20)
- wait_for_boot = booting_time if booting_time else self._booting_time
- for loop in range(wait_for_boot):
- logging.debug('Wait {} seconds......'
- .format(wait_for_boot - loop))
- time.sleep(1)
- self.start_sdb_server()
- self._sdb_root_on()
-
- def off(self, powercut_delay=2):
- """
- Trun off the device acquired.
-
- :param float powercut_delay: power-cut delay for cutter
- """
- logging.debug('You can\'t turn off mock type device')
-
- def flash(self, filenames, flasher='lthor', waiting=5,
- partition_bin_mappings={'BOOT': 'zImage',
- 'ROOTFS': 'rootfs.img',
- 'USER': 'user.img',
- 'SYSTEM-DATA': 'system-data.img'}):
- """
- Flash binaries to device.
- This function turn on device and turn off device automatically.
-
- :param dict filenames: filename string or dict
- :param string flasher: external flashing tool name
- :param float waiting: waiting time to acquire cdc_acm device
- :param dict partition_bin_mappings: partition table for device which use heimdall flasher
-
- Example:
- >>> dut.flash(['boot.tar.gz','platform.tar.gz'])
- >>> or
- >>> dut.flash('platform.tar.gz')
-
- """
- logging.debug('================Flash binaries to device============')
- logging.debug(filenames)
-
- self.start_sdb_server()
-
- if not filenames:
- raise Exception('There\'s no file to flash.')
- try:
- self._sdb_root_on()
- self._acquire_global_lock()
- self.run_cmd('reboot -f download', timeout=20)
- time.sleep(waiting)
- if flasher == 'lthor':
- busid = self._find_usb_busid()
- self._release_global_lock()
- self._lthor(filenames=filenames, busid=busid)
- elif flasher == 'heimdall':
- (busaddr, devaddr) = self._find_usb_bus_and_device_address()
- self._release_global_lock()
- self._heimdall(filenames=filenames,
- busaddr=busaddr,
- devaddr=devaddr,
- partition_bin_mappings=partition_bin_mappings)
- except (Exception, KeyboardInterrupt) as e:
- self._release_global_lock()
- logging.debug(e)
- raise Exception('Can\'t flash files : {}.'.format(filenames))
-
- def refresh_sdb_server(self):
- """docstring for refresh_sdb_server"""
- call('sdb kill-server; sdb start-server', shell=True, timeout=10)
- time.sleep(1)
-
- def start_sdb_server(self):
- """docstring for start_sdb_server"""
- call('sdb start-server', shell=True, timeout=10)
- time.sleep(1)
--- /dev/null
+#!/usr/bin/env python3
+# Copyright 2015-2016 Samsung Electronics Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import time
+import logging
+from litmus.device.device import device
+from litmus.core.util import check_output, find_pattern
+from litmus.core.util import call
+
+
+class devicestandalone(device):
+ """
+ Litmus device class.
+ User can control device in topology by this class methods.
+ """
+
+ _booting_time = 60
+
+ def __init__(self, *args, **kwargs):
+ self.args = args
+ self.kwargs = kwargs
+ self._name = kwargs['devicename']
+ if 'serialno' in kwargs:
+ self._id = kwargs['serialno']
+ else:
+ self._id = self._find_device_id()
+
+ self._manager = kwargs['manager']
+
+ def _release(self):
+ """docstring for _release"""
+ pass
+
+ def _find_device_id(self):
+ """docstring for _find_device_id"""
+ self.start_sdb_server()
+ outs = check_output(['sdb', 'devices'], timeout=10)
+ pattern = '.*List of devices attached \n([a-zA-Z0-9]*).*device.*'
+ found = find_pattern(pattern, outs, groupindex=1)
+ if found:
+ return found
+
+ # public methods.
+
+ def get_id(self):
+ """
+ Return the id of acquired device.
+ Device instance uses this id for sdb connection.
+
+ Example:
+ >>> dut = mgr.acquire_dut('xu3')
+ >>> dut.get_id()
+ 'XU3_001'
+
+ :returns str: device id
+ """
+ return self._id
+
+ def on(self, booting_time=None):
+ """
+ Turn on the device acquired.
+
+ :param float powercut_delay: power-cut delay for cutter
+ """
+ logging.debug('=================Turn on device {}=================='
+ .format(self.get_name()))
+
+ self.start_sdb_server()
+ if self.is_on():
+ self._sdb_root_on()
+ self.run_cmd('reboot -f', timeout=20)
+ wait_for_boot = booting_time if booting_time else self._booting_time
+ for loop in range(wait_for_boot):
+ logging.debug('Wait {} seconds......'
+ .format(wait_for_boot - loop))
+ time.sleep(1)
+ self.start_sdb_server()
+ self._sdb_root_on()
+
+ def off(self, powercut_delay=2):
+ """
+ Trun off the device acquired.
+
+ :param float powercut_delay: power-cut delay for cutter
+ """
+ logging.debug('You can\'t turn off standalone type device')
+
+ def flash(self, filenames, flasher='lthor', waiting=5,
+ partition_bin_mappings={'BOOT': 'zImage',
+ 'ROOTFS': 'rootfs.img',
+ 'USER': 'user.img',
+ 'SYSTEM-DATA': 'system-data.img'}):
+ """
+ Flash binaries to device.
+ This function turn on device and turn off device automatically.
+
+ :param dict filenames: filename string or dict
+ :param string flasher: external flashing tool name
+ :param float waiting: waiting time to acquire cdc_acm device
+ :param dict partition_bin_mappings: partition table for device which use heimdall flasher
+
+ Example:
+ >>> dut.flash(['boot.tar.gz','platform.tar.gz'])
+ >>> or
+ >>> dut.flash('platform.tar.gz')
+
+ """
+ logging.debug('================Flash binaries to device============')
+ logging.debug(filenames)
+
+ self.start_sdb_server()
+
+ if not filenames:
+ raise Exception('There\'s no file to flash.')
+ try:
+ self._sdb_root_on()
+ self._acquire_global_lock()
+ self.run_cmd('reboot -f download', timeout=20)
+ time.sleep(waiting)
+ if flasher == 'lthor':
+ busid = self._find_usb_busid()
+ self._release_global_lock()
+ self._lthor(filenames=filenames, busid=busid)
+ elif flasher == 'heimdall':
+ (busaddr, devaddr) = self._find_usb_bus_and_device_address()
+ self._release_global_lock()
+ self._heimdall(filenames=filenames,
+ busaddr=busaddr,
+ devaddr=devaddr,
+ partition_bin_mappings=partition_bin_mappings)
+ except (Exception, KeyboardInterrupt) as e:
+ self._release_global_lock()
+ logging.debug(e)
+ raise Exception('Can\'t flash files : {}.'.format(filenames))
+
+ def refresh_sdb_server(self):
+ """docstring for refresh_sdb_server"""
+ call('sdb kill-server; sdb start-server', shell=True, timeout=10)
+ time.sleep(1)
+
+ def start_sdb_server(self):
+ """docstring for start_sdb_server"""
+ call('sdb start-server', shell=True, timeout=10)
+ time.sleep(1)
+++ /dev/null
-binary_urls:
- - http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/
-username: <username>
-password: <password>
+++ /dev/null
-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.*
+++ /dev/null
-#!/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)
--- /dev/null
+binary_urls:
+ - http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/
+username: <username>
+password: <password>
--- /dev/null
+binary_urls:
+ - http://download.tizen.org/snapshots/tizen/tv/latest/images/arm-wayland/tv-boot-armv7l-odroidxu3/
+ - http://download.tizen.org/snapshots/tizen/tv/latest/images/arm-wayland/tv-wayland-armv7l-odroidu3/
+username: <username>
+password: <password>
--- /dev/null
+binary_urls:
+ - http://download.tizen.org/snapshots/tizen/wearable/latest/images/target-circle/wearable-wayland-armv7l-circle/
+username: <username>
+password: <password>
--- /dev/null
+testcases:
+ - name: verify_process_is_running
+ from: litmus.helper.tests
+ result_dir: result
+ plan:
+ - name: dbus_is_running
+ param: dbus
+ pattern: .*/usr/bin/dbus-daemon.*
+ - name: enlightenment_is_running
+ param: enlightenment
+ pattern: .*/usr/bin/enlightenment.*
+ - name: sensord_is_running
+ param: sensord
+ pattern: .*/usr/bin/sensord.*
+ - 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: msg-server_is_running
+ param: msg-server
+ pattern: .*/usr/bin/msg-server.*
+ - name: connmand_is_running
+ param: connmand
+ pattern: .*/usr/sbin/connmand.*
+ - name: callmgrd_is_running
+ param: callmgrd
+ pattern: .*/usr/bin/callmgrd.*
+ - 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.*
+ - name: verify_dmesg
+ from: litmus.helper.tests
+ result_dir: result
+ plan:
+ - name: panel_is_alive
+ param: panel
+ pattern: .*panel is dead.*
+ - name: verify_wifi_is_working
+ from: litmus.helper.tests
+ wifi_apname: setup
+ wifi_password:
+ result_dir: result
--- /dev/null
+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.*
--- /dev/null
+testcases:
+ - name: verify_process_is_running
+ from: litmus.helper.tests
+ result_dir: result
+ plan:
+ - name: dbus_is_running
+ param: dbus
+ pattern: .*/usr/bin/dbus-daemon.*
+ - name: enlightenment_is_running
+ param: enlightenment
+ pattern: .*/usr/bin/enlightenment.*
+ - name: sensord_is_running
+ param: sensord
+ pattern: .*/usr/bin/sensord.*
+ - 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: msg-server_is_running
+ param: msg-server
+ pattern: .*/usr/bin/msg-server.*
+ - name: connmand_is_running
+ param: connmand
+ pattern: .*/usr/sbin/connmand.*
+ - name: alarm-server_is_running
+ param: alarm-server
+ pattern: .*/usr/bin/alarm-server.*
+ - name: sound_server_is_running
+ param: sound_server
+ pattern: .*/usr/bin/sound_server.*
+ - name: media-server_is_running
+ param: media-server
+ pattern: .*/usr/bin/media-server.*
+ - name: verify_dmesg
+ from: litmus.helper.tests
+ result_dir: result
+ plan:
+ - name: panel_is_alive
+ param: panel
+ pattern: .*panel is dead.*
+ - name: verify_wifi_is_working
+ from: litmus.helper.tests
+ wifi_apname: setup
+ wifi_password:
+ result_dir: result
--- /dev/null
+#!/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_mobile.yaml')
+ #project_info = load_yaml('conf_wearable.yaml')
+ #project_info = load_yaml('conf_tv.yaml')
+
+ username = project_info['username']
+ password = project_info['password']
+ binary_urls = project_info['binary_urls']
+
+ # get version from parameter
+ # ex) 20160923.3
+ 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('standalone', max_retry_times=180)
+ #dut = mgr.acquire_dut_by_name('MyTM1', 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_mobile.yaml')
+ #testcases = load_yaml('tc_wearable.yaml')
+ #testcases = load_yaml('tc_tv.yaml')
+ add_test_helper(dut, testcases)
+ dut.run_tests()
+
+ # turn off dut.
+ dut.off()
+
+ # release a device
+ mgr.release_dut(dut)