=== modified file 'lava_dispatcher/actions/__init__.py'
@@ -57,20 +57,6 @@
return self.command_name
-class BaseAndroidAction(BaseAction):
- def __init__(self, context):
- self.context = context
-
- def check_sys_bootup(self):
- result_pattern = "([0-1])"
- cmd = "getprop sys.boot_completed"
- self.client.proc.sendline(cmd)
- id = self.client.proc.expect([result_pattern], timeout = 60)
- if id == 0:
- return True
- else:
- return False
-
def _find_commands(module):
cmds = {}
for name, cls in module.__dict__.iteritems():
=== modified file 'lava_dispatcher/actions/android_0xbench.py'
@@ -19,17 +19,17 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses>.
-from lava_dispatcher.actions import BaseAndroidAction
+from lava_dispatcher.actions import BaseAction
import time
import pexpect
import logging
-class cmd_test_android_0xbench(BaseAndroidAction):
+class cmd_test_android_0xbench(BaseAction):
def run(self):
#Make sure in test image now
self.client.in_test_shell()
time.sleep(30)
- if not self.check_sys_bootup():
+ if not self.client.check_sys_bootup():
# TODO: Fetch the logcat message as attached
logging.warning("0xbench Test: sys bootup fail, aborted")
return
=== modified file 'lava_dispatcher/actions/android_basic.py'
@@ -19,21 +19,19 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses>.
-from lava_dispatcher.actions import BaseAndroidAction
-from lava_dispatcher.client import OperationFailed
+from lava_dispatcher.actions import BaseAction
import time
import pexpect
-import sys
import logging
from datetime import datetime
from lava_dispatcher.android_util import savebundlefile
-class cmd_test_android_monkey(BaseAndroidAction):
+class cmd_test_android_monkey(BaseAction):
def run(self):
#Make sure in test image now
self.client.in_test_shell()
time.sleep(30)
- if not self.check_sys_bootup():
+ if not self.client.check_sys_bootup():
# TODO: Fetch the logcat message as attachment
logging.warning("monkey run test skipped: sys bootup fail")
return
@@ -65,7 +63,7 @@
self.client.proc.sendline("")
-class cmd_test_android_basic(BaseAndroidAction):
+class cmd_test_android_basic(BaseAction):
def run(self):
#Make sure in test image now
self.client.in_test_shell()
=== modified file 'lava_dispatcher/actions/boot_control.py'
@@ -22,10 +22,10 @@
import logging
-from lava_dispatcher.actions import BaseAction, BaseAndroidAction
+from lava_dispatcher.actions import BaseAction
from lava_dispatcher.client import CriticalError
-class cmd_boot_linaro_android_image(BaseAndroidAction):
+class cmd_boot_linaro_android_image(BaseAction):
""" Call client code to boot to the master image
"""
def run(self):
=== modified file 'lava_dispatcher/android_client.py'
@@ -198,3 +198,9 @@
time.sleep(1)
raise GeneralError('The home screen does not displayed')
+ def check_sys_bootup(self):
+ result_pattern = "([0-1])"
+ cmd = "getprop sys.boot_completed"
+ self.proc.sendline(cmd)
+ match_id = self.proc.expect([result_pattern], timeout = 60)
+ return match_id == 0