From c3d8128ff33a45eafd15fc5d4a03024836f4712e Mon Sep 17 00:00:00 2001 From: Pawan Bathe Date: Sat, 15 Aug 2015 02:10:08 +0530 Subject: [PATCH 1/8] Androbench Storage Benchmark Workload Addition --- wlauto/workloads/androbench/__init__.py | 84 +++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 wlauto/workloads/androbench/__init__.py diff --git a/wlauto/workloads/androbench/__init__.py b/wlauto/workloads/androbench/__init__.py new file mode 100644 index 00000000..c38c7063 --- /dev/null +++ b/wlauto/workloads/androbench/__init__.py @@ -0,0 +1,84 @@ +# Copyright 2013-2015 ARM Limited +# +# 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 os +import re +import time + +from wlauto import AndroidBenchmark +from uiautomator import Device + + +class Androbench(AndroidBenchmark): + + name = 'androbench' + description = """Androbench measures the storage performance of device""" + package = 'com.andromeda.androbench2' + activity = '.main' + device='' + + def setup(self, context): + global device + os.system('adb devices > deviceinfo') + devinf = open('deviceinfo','rb') + dev = devinf.readlines()[1].split('\t')[0] + devinf.close() + device=Device(dev) + os.system('rm deviceinfo') + + + def run(self, context): + global device,package,activity + os.system('adb shell pm clear com.andromeda.androbench2') + os.system('adb shell am start -n com.andromeda.androbench2/.main') + while True : + if device(text="Measure your storage performance").exists : + time.sleep(1) + break + + if device(textStartsWith="Micro").exists : + device(textStartsWith="Micro").click() + if device(text="Yes").exists : + device(textStartsWith="Yes").click() + + + while True : + if device(text="Cancel").exists : + device(text="Cancel").click() + time.sleep(1) + break + + + def update_result(self, context): + super(Androbench, self).update_result(context) + os.system('adb shell cp /data/data/com.andromeda.androbench2/databases/history.db /sdcard/results.db') + os.system('adb pull /sdcard/results.db .') + os.system('sqlite3 results.db "select * from history" > results.raw') + fhresults=open("results.raw","rb") + results=fhresults.readlines()[0].split('|') + context.result.add_metric('Sequential Read MB/s', results[8]) + context.result.add_metric('Sequential Write MB/s', results[9]) + context.result.add_metric('Random Read MB/s', results[10]) + context.result.add_metric('Random Write MB/s', results[12]) + os.system('rm results.raw') + + + + def teardown(self, context): + pass + + def validate(self): + pass From 1cf60c26156e815295057d039e7d2d3e8c269446 Mon Sep 17 00:00:00 2001 From: Pawan Bathe Date: Sat, 15 Aug 2015 02:39:45 +0530 Subject: [PATCH 2/8] Results format --- wlauto/workloads/androbench/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wlauto/workloads/androbench/__init__.py b/wlauto/workloads/androbench/__init__.py index c38c7063..f2d51fa8 100644 --- a/wlauto/workloads/androbench/__init__.py +++ b/wlauto/workloads/androbench/__init__.py @@ -69,10 +69,10 @@ class Androbench(AndroidBenchmark): os.system('sqlite3 results.db "select * from history" > results.raw') fhresults=open("results.raw","rb") results=fhresults.readlines()[0].split('|') - context.result.add_metric('Sequential Read MB/s', results[8]) - context.result.add_metric('Sequential Write MB/s', results[9]) - context.result.add_metric('Random Read MB/s', results[10]) - context.result.add_metric('Random Write MB/s', results[12]) + context.result.add_metric('Sequential Read MB/s ', results[8]) + context.result.add_metric('Sequential Write MB/s ', results[9]) + context.result.add_metric('Random Read MB/s ', results[10]) + context.result.add_metric('Random Write MB/s ', results[12]) os.system('rm results.raw') From e4ee496bc9415a577fd3f60db23d59b59b197c95 Mon Sep 17 00:00:00 2001 From: Pawan Bathe Date: Mon, 17 Aug 2015 23:20:30 +0530 Subject: [PATCH 3/8] Use sqllite3 instead of sqllite to remove host dependencies and result unit in proper format --- wlauto/workloads/androbench/__init__.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/wlauto/workloads/androbench/__init__.py b/wlauto/workloads/androbench/__init__.py index f2d51fa8..9a91654b 100644 --- a/wlauto/workloads/androbench/__init__.py +++ b/wlauto/workloads/androbench/__init__.py @@ -64,21 +64,12 @@ class Androbench(AndroidBenchmark): def update_result(self, context): super(Androbench, self).update_result(context) - os.system('adb shell cp /data/data/com.andromeda.androbench2/databases/history.db /sdcard/results.db') - os.system('adb pull /sdcard/results.db .') - os.system('sqlite3 results.db "select * from history" > results.raw') + os.system('adb shell sqlite3 /data/data/com.andromeda.androbench2/databases/history.db "select * from history" > results.raw') fhresults=open("results.raw","rb") results=fhresults.readlines()[0].split('|') - context.result.add_metric('Sequential Read MB/s ', results[8]) - context.result.add_metric('Sequential Write MB/s ', results[9]) - context.result.add_metric('Random Read MB/s ', results[10]) - context.result.add_metric('Random Write MB/s ', results[12]) + context.result.add_metric('Sequential Read ', results[8], 'MB/s') + context.result.add_metric('Sequential Write MB/s ', results[9] , 'MB/s') + context.result.add_metric('Random Read MB/s ', results[10], 'MB/s') + context.result.add_metric('Random Write MB/s ', results[12], 'MB/s') os.system('rm results.raw') - - - def teardown(self, context): - pass - - def validate(self): - pass From 2d8b8ba799ad6361f0a61a9103dda3695af0e3ee Mon Sep 17 00:00:00 2001 From: Pawan Bathe Date: Tue, 18 Aug 2015 00:46:48 +0530 Subject: [PATCH 4/8] moved UiAutomator code to java, and removed not required python code for device interfacing --- wlauto/workloads/androbench/__init__.py | 46 ++------- .../com.arm.wlauto.uiauto.androbench.jar | Bin 0 -> 3052 bytes wlauto/workloads/androbench/uiauto/build.sh | 28 ++++++ wlauto/workloads/androbench/uiauto/build.xml | 92 ++++++++++++++++++ .../androbench/uiauto/project.properties | 14 +++ .../com/arm/wlauto/uiauto/UiAutomation.java | 67 +++++++++++++ 6 files changed, 207 insertions(+), 40 deletions(-) create mode 100644 wlauto/workloads/androbench/com.arm.wlauto.uiauto.androbench.jar create mode 100755 wlauto/workloads/androbench/uiauto/build.sh create mode 100644 wlauto/workloads/androbench/uiauto/build.xml create mode 100644 wlauto/workloads/androbench/uiauto/project.properties create mode 100644 wlauto/workloads/androbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java diff --git a/wlauto/workloads/androbench/__init__.py b/wlauto/workloads/androbench/__init__.py index 9a91654b..92c09169 100644 --- a/wlauto/workloads/androbench/__init__.py +++ b/wlauto/workloads/androbench/__init__.py @@ -18,49 +18,15 @@ import os import re import time -from wlauto import AndroidBenchmark -from uiautomator import Device +from wlauto import AndroidUiAutoBenchmark - -class Androbench(AndroidBenchmark): +class Androbench(AndroidUiAutoBenchmark): name = 'androbench' description = """Androbench measures the storage performance of device""" package = 'com.andromeda.androbench2' activity = '.main' - device='' - - def setup(self, context): - global device - os.system('adb devices > deviceinfo') - devinf = open('deviceinfo','rb') - dev = devinf.readlines()[1].split('\t')[0] - devinf.close() - device=Device(dev) - os.system('rm deviceinfo') - - - def run(self, context): - global device,package,activity - os.system('adb shell pm clear com.andromeda.androbench2') - os.system('adb shell am start -n com.andromeda.androbench2/.main') - while True : - if device(text="Measure your storage performance").exists : - time.sleep(1) - break - - if device(textStartsWith="Micro").exists : - device(textStartsWith="Micro").click() - if device(text="Yes").exists : - device(textStartsWith="Yes").click() - - - while True : - if device(text="Cancel").exists : - device(text="Cancel").click() - time.sleep(1) - break - + run_timeout = 10 * 60 def update_result(self, context): super(Androbench, self).update_result(context) @@ -68,8 +34,8 @@ class Androbench(AndroidBenchmark): fhresults=open("results.raw","rb") results=fhresults.readlines()[0].split('|') context.result.add_metric('Sequential Read ', results[8], 'MB/s') - context.result.add_metric('Sequential Write MB/s ', results[9] , 'MB/s') - context.result.add_metric('Random Read MB/s ', results[10], 'MB/s') - context.result.add_metric('Random Write MB/s ', results[12], 'MB/s') + context.result.add_metric('Sequential Write ', results[9] , 'MB/s') + context.result.add_metric('Random Read ', results[10], 'MB/s') + context.result.add_metric('Random Write ', results[12], 'MB/s') os.system('rm results.raw') diff --git a/wlauto/workloads/androbench/com.arm.wlauto.uiauto.androbench.jar b/wlauto/workloads/androbench/com.arm.wlauto.uiauto.androbench.jar new file mode 100644 index 0000000000000000000000000000000000000000..d047faf24f97b0243f083c6afbe43ac50f3170c1 GIT binary patch literal 3052 zcmZ{mcRU+v7sq4oqDHAzwQ9F^8+*iv8LLvIHjRo+h+XPZRP8M`MJcscTcc_OEh(zW zZIM=E#)wf~z4v|Zdq4N{zUTRzbN+aKzw?~uzppu%f|4EppalTzC@<;*{uXoqN`Q%; zm6o)jDMp`C@v5H>KxGO$QOYi(kW@ryKL zUIN1L-}0S+}qSZWd|^yUBz zXND8Ff&sO%>_!ij(q_kH-Q!ZhT_q`!B)JS&i>Px3EOE@Zl2WDs_E$E(%DL16G|X|& za5*@)txHcv2QEF1jliA437~|^ksM2|0ni{fi!O=t7r&`iq!`qzmnNZx+GR8JN_$Cig(6qmNm8EM-@UiLTd5mXnu%2Qg6C~( z_O{RsM$g~$LB6+4!7Yz|PT7k8B;TDiIzuM^^iMv`;{3@Yee_#)A2!|ra^x~alX>b2 zS$(cQ)Mol!HG#v6J~ULtE4nN^k+%Ij2=b@mhyK2pK)AJEnr% zDfG3|WPe!A^T6vkUzaFq6`(yE~cl^ijUy;!{alF z!n3M|ijnkLRdji!;fYvfhM^$f#zm74PWi#~+?Bm$oGz_*-m0v#1+^!((anRxb=OB# zx~_i_6?BUv{d^fmQft#((fO?GXHCJ{=%S%fZhBC0->ha|eM^uls(t~ns857MLJUNA z_5J~H;O6vwIXJw`kEWN?^wW6!iGBr zCF1sh#%4-70S0=KQ}Ma6S{yrl2Iv3k+{ZcB3;}_5dB(%71}7!^rR(NcWQ8vzDcV7RvDWUY~uZ$l0`=g)9|4%;48r6bbq6pxa$6;+;%&56i@S#9BS*_2|hV{CRrSw zhY55jM(_n%1<-W)WxM+}B)1_D2>!dkfq;z*gW|8BwzA^ASuHs7#)Zpc=VawNC=nqo zH~K)!J$&+-lk=EY@A*G@-4J!VcBP~>~@qbm3}mp zt+9QqVf11)M$ZbU!*&$MligWL2pYLLLC6QU8wIs)%}uEvbT=uY(QFRKAy0I63gL4< zCXp=;KwU7ejRQ=miFn-2H9aLdDfyKvxcu!isWtbYLHe7e(@mCb4=FC#XUwM0?;|xeei}N<%e^O|d@}mO#Ifa*o*dBO zo1MCQ-#i^f3EJa_qwl75?15A` zkJ=RFb(c2Xd{WbkVBXLVNX4-tsrB3!CpV6bDFht_99vrnP;3(M?v`>#3A1*1!llM0 zMeXW@TmF(v*!HESK-#b2DNSyI!|K&v!Yc$8+8$*SSL^6#h=nT;bKj`09J^a%RLx@Zt=j(mn(;0h<-6|Vb&Kn#yu@P4ud#l<=#wQU zrgK1IbZq4n8-9)!iq)-jr+O6$8?I_InrK6I`pEh6TUUvv>@;EsQ|gm!T7IsIt-Q+7 zEyglt{3}qI{hKfI+05(TZQj^ay-{#=zy2=j+KXFn^f?X75Q)U9f^4~_whuBQz7YdE z4SAXhsMtCt-fOC#gd455&3SfLe-k`<>&&{p+6iJUY*NyL`Nz8waXvhI%a** zlDBH@n!UkGkrMs5)O|6?h!V9j)(WDSe@fTj6<+^kv5m(VA*eU#P(eCKU5y+(ob~H_ zXrMAg6nIyrA6H$bI0=23VB+Pl(ybPSsb_mgw(_C!QwXca(*oB$i^3nTC64$&eXwxV zdKKl6PON2Lb3n1iL`H(+7UQYhkR0>0T=3OwKTj$k@7UutLZW&DOusufZ{4oq{RSe? z9H>5Vr_6dC7PkB`);93#=iM4pV5?r2(#(%cJ6#NOaD#smj42|yJYspT#^-k@CrO?( zH&L8Y>b8J0*uS;d#DA<*iEiwnsSUxT=;pBdf+TWlAWk+TN?K@xrFjp=*5xwhq0SKIGMTuIvwCB^w^JMUM1Q8D0O5vY(F literal 0 HcmV?d00001 diff --git a/wlauto/workloads/androbench/uiauto/build.sh b/wlauto/workloads/androbench/uiauto/build.sh new file mode 100755 index 00000000..2bec8695 --- /dev/null +++ b/wlauto/workloads/androbench/uiauto/build.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Copyright 2013-2015 ARM Limited +# +# 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. +# + + + +class_dir=bin/classes/com/arm/wlauto/uiauto +base_class=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', 'BaseUiAutomation.class')"` +mkdir -p $class_dir +cp $base_class $class_dir + +ant build + +if [[ -f bin/com.arm.wlauto.uiauto.androbench.jar ]]; then + cp bin/com.arm.wlauto.uiauto.androbench.jar .. +fi diff --git a/wlauto/workloads/androbench/uiauto/build.xml b/wlauto/workloads/androbench/uiauto/build.xml new file mode 100644 index 00000000..6293990f --- /dev/null +++ b/wlauto/workloads/androbench/uiauto/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wlauto/workloads/androbench/uiauto/project.properties b/wlauto/workloads/androbench/uiauto/project.properties new file mode 100644 index 00000000..a3ee5ab6 --- /dev/null +++ b/wlauto/workloads/androbench/uiauto/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-17 diff --git a/wlauto/workloads/androbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/androbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java new file mode 100644 index 00000000..dd621aad --- /dev/null +++ b/wlauto/workloads/androbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -0,0 +1,67 @@ +/* Copyright 2013-2015 ARM Limited + * + * 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. +*/ + + +package com.arm.wlauto.uiauto.androbench; + +import android.app.Activity; +import android.os.Bundle; +import android.util.Log; + +// Import the uiautomator libraries +import com.android.uiautomator.core.UiObject; +import com.android.uiautomator.core.UiObjectNotFoundException; +import com.android.uiautomator.core.UiScrollable; +import com.android.uiautomator.core.UiSelector; +import com.android.uiautomator.testrunner.UiAutomatorTestCase; + +import com.arm.wlauto.uiauto.BaseUiAutomation; + +public class UiAutomation extends BaseUiAutomation { + + public static String TAG = "androbench"; + + public void runUiAutomation() throws Exception { + Bundle status = new Bundle(); + status.putString("product", getUiDevice().getProductName()); + UiSelector selector = new UiSelector(); + sleep(3); + UiObject btn_microbench = new UiObject(selector .textContains("Micro") + .className("android.widget.Button")); + btn_microbench.click(); + + UiObject btn_yes= new UiObject(selector .textContains("Yes") + .className("android.widget.Button")); + btn_yes.click(); + + + try{ + UiObject complete_text = new UiObject(selector .text("Cancel") + .className("android.widget.Button")); + + waitObject(complete_text); + + sleep(2); + complete_text.click(); + } finally{ + //complete_text.click(); + } + + sleep(5); + takeScreenshot("Androbench"); + getAutomationSupport().sendStatus(Activity.RESULT_OK, status); + } + +} From 03a94700074840470ccf08cc2ce9d8e6d297e1a2 Mon Sep 17 00:00:00 2001 From: Pawan Bathe Date: Tue, 18 Aug 2015 01:09:45 +0530 Subject: [PATCH 5/8] Fixed issue reported by pep8 checkers --- wlauto/workloads/androbench/__init__.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wlauto/workloads/androbench/__init__.py b/wlauto/workloads/androbench/__init__.py index 92c09169..49b1f072 100644 --- a/wlauto/workloads/androbench/__init__.py +++ b/wlauto/workloads/androbench/__init__.py @@ -20,8 +20,8 @@ import time from wlauto import AndroidUiAutoBenchmark -class Androbench(AndroidUiAutoBenchmark): +class Androbench(AndroidUiAutoBenchmark): name = 'androbench' description = """Androbench measures the storage performance of device""" package = 'com.andromeda.androbench2' @@ -30,12 +30,14 @@ class Androbench(AndroidUiAutoBenchmark): def update_result(self, context): super(Androbench, self).update_result(context) - os.system('adb shell sqlite3 /data/data/com.andromeda.androbench2/databases/history.db "select * from history" > results.raw') - fhresults=open("results.raw","rb") - results=fhresults.readlines()[0].split('|') + db = '/data/data/com.andromeda.androbench2/databases/history.db' + qs = 'select * from history' + res = 'results.raw' + os.system('adb shell sqlite3 %s "%s" > %s' % (db, qs, res)) + fhresults = open("results.raw", "rb") + results = fhresults.readlines()[0].split('|') context.result.add_metric('Sequential Read ', results[8], 'MB/s') - context.result.add_metric('Sequential Write ', results[9] , 'MB/s') + context.result.add_metric('Sequential Write ', results[9], 'MB/s') context.result.add_metric('Random Read ', results[10], 'MB/s') context.result.add_metric('Random Write ', results[12], 'MB/s') os.system('rm results.raw') - From e38c87f258f38b62957f1695452f85f71c4548e7 Mon Sep 17 00:00:00 2001 From: Pawan Bathe Date: Tue, 18 Aug 2015 01:28:09 +0530 Subject: [PATCH 6/8] Fix pylint errors --- wlauto/workloads/androbench/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/wlauto/workloads/androbench/__init__.py b/wlauto/workloads/androbench/__init__.py index 49b1f072..d60ff918 100644 --- a/wlauto/workloads/androbench/__init__.py +++ b/wlauto/workloads/androbench/__init__.py @@ -15,8 +15,6 @@ import os -import re -import time from wlauto import AndroidUiAutoBenchmark From 8513304aeb5d33f6cb9c5e767ceedebeb25fb1e8 Mon Sep 17 00:00:00 2001 From: Pawan Bathe Date: Wed, 19 Aug 2015 21:53:50 +0530 Subject: [PATCH 7/8] python sqlite3 to remove host/DUT dependencies + other changes --- wlauto/workloads/androbench/__init__.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/wlauto/workloads/androbench/__init__.py b/wlauto/workloads/androbench/__init__.py index d60ff918..20d5115a 100644 --- a/wlauto/workloads/androbench/__init__.py +++ b/wlauto/workloads/androbench/__init__.py @@ -15,7 +15,7 @@ import os - +import sqlite3 from wlauto import AndroidUiAutoBenchmark @@ -28,14 +28,16 @@ class Androbench(AndroidUiAutoBenchmark): def update_result(self, context): super(Androbench, self).update_result(context) - db = '/data/data/com.andromeda.androbench2/databases/history.db' + dbn = 'databases/history.db' + db = self.device.path.join(self.device.package_data_directory, self.package, dbn) + host_results = os.path.join(context.output_directory, 'results.db') + self.device.pull_file(db, host_results) qs = 'select * from history' - res = 'results.raw' - os.system('adb shell sqlite3 %s "%s" > %s' % (db, qs, res)) - fhresults = open("results.raw", "rb") - results = fhresults.readlines()[0].split('|') + conn = sqlite3.connect(host_results) + c = conn.cursor() + c.execute(qs) + results = c.fetchone() context.result.add_metric('Sequential Read ', results[8], 'MB/s') context.result.add_metric('Sequential Write ', results[9], 'MB/s') context.result.add_metric('Random Read ', results[10], 'MB/s') context.result.add_metric('Random Write ', results[12], 'MB/s') - os.system('rm results.raw') From f44fd9df7ac7fa5e553e99d98c1376439a33ffc8 Mon Sep 17 00:00:00 2001 From: Pawan Bathe Date: Thu, 20 Aug 2015 21:25:55 +0530 Subject: [PATCH 8/8] Change device pull to handle root,and renamed local file as well history.db from results.db --- wlauto/workloads/androbench/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wlauto/workloads/androbench/__init__.py b/wlauto/workloads/androbench/__init__.py index 20d5115a..861fe45a 100644 --- a/wlauto/workloads/androbench/__init__.py +++ b/wlauto/workloads/androbench/__init__.py @@ -30,8 +30,8 @@ class Androbench(AndroidUiAutoBenchmark): super(Androbench, self).update_result(context) dbn = 'databases/history.db' db = self.device.path.join(self.device.package_data_directory, self.package, dbn) - host_results = os.path.join(context.output_directory, 'results.db') - self.device.pull_file(db, host_results) + host_results = os.path.join(context.output_directory, 'history.db') + self.device.pull_file(db, host_results, as_root=True) qs = 'select * from history' conn = sqlite3.connect(host_results) c = conn.cursor()