Hello,

@ Terceiro
Thanks for detailed information and useful link.

I want to small commit into lava-android-test git repository and checked
Linaro contribution guide.
But I knew that need linaro email address to push some commits.
(Who can use it -
https://wiki.linaro.org/Platform/LAVA/Infrastructure/CodeReviewServer?action=show&redirect=Platform%2FLAVA%2FInfrastructure%2FStagingReview
All Linaro employees, and all the people that have an account on Linaro
Login.)
I am not Linaro employees and don't have any account on Linaro Login.
How can I (open source contributor) contribute lava-android-test.git ?

I attach my small commit for lava-android-test.git

Thanks and best regards.

HS Jung

---------- Forwarded message ----------
From: Antonio Terceiro <antonio.terce...@linaro.org>
Date: 2014-03-26 0:17 GMT+09:00
Subject: Re: Ask something to make a commit into lava-android-test.git
To: Heesuk Jung <hsjung1...@gmail.com>


Hello,

Sorry for the delay in the response; I was off for medical reasons. Next
time, please write to the linaro-validation mailing list, where other
people from my team will be able to help you.

On Sat, Mar 15, 2014 at 02:57:04PM +0900, Heesuk Jung wrote:
> Hello, my name is Heesuk Jung.
>
> I want to some commis into lava-android-test.git and so downloaded
> lava-android-test.
>
> After I conmit in local repository, I did not push commit. Because I can'
> find lava-android-test gerrit system.
>
> Could you explan any commit procedure including gerrit system address?

Please read https://wiki.linaro.org/Platform/LAVA/Contribute/Git

--
Antonio Terceiro
Software Engineer - Linaro
http://www.linaro.org

Attachment: signature.asc
Description: PGP signature

From 24f01eaba767b5e4b627474f64e048ce6cb7a236 Mon Sep 17 00:00:00 2001
From: Heesuk Jung <hsjung1...@gmail.com>
Date: Mon, 31 Mar 2014 22:00:01 +0900
Subject: [PATCH] Suggest AndroidTestUninstaller class The lava-android-test
 does not define formal AndroidTestUninstaller class yet. I suggest
 AndroidTestUninstaller class to set up general uninstall step incuding APK
 removing.

---
 lava_android_test/testdef.py | 44 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/lava_android_test/testdef.py b/lava_android_test/testdef.py
index 0cb97aa..195b20f 100644
--- a/lava_android_test/testdef.py
+++ b/lava_android_test/testdef.py
@@ -118,7 +118,7 @@ class AndroidTest(ITest):
         return self.adb
 
     def __init__(self, testname, version="", installer=None, runner=None,
-                 parser=None, default_options=None,
+                 parser=None, uninstaller=None, default_options=None,
                  org_ouput_file='stdout.log',
                  attachments=[]):
         self.testname = testname
@@ -126,6 +126,7 @@ class AndroidTest(ITest):
         self.installer = installer
         self.runner = runner
         self.parser = parser
+        self.uninstaller = uninstaller
         self.default_options = default_options
         self.org_ouput_file = org_ouput_file
         self.origdir = os.path.abspath(os.curdir)
@@ -194,6 +195,9 @@ class AndroidTest(ITest):
         if self.adb.exists(path):
             self.adb.rmtree(path)
 
+        if self.uninstaller is not None:
+            self.uninstaller.uninstall()
+
     def _add_install_options(self, bundle, config):
         optionfile = "%s/%s/install_options" % (config.installdir_android,
                                                 self.testname)
@@ -374,6 +378,44 @@ class AndroidTestInstaller(object):
         self.adb = adb
 
 
+class AndroidTestUninstaller(object):
+
+    adb = ADB()
+
+    """Base class for defining an uninstaller object.
+
+    This class can be used as-is for simple uninstallers, or extended for more
+    advanced funcionality.
+
+    steps_host - list of steps to be executed on host
+    steps_android - list of steps to be executed on android
+    """
+    def __init__(self, steps_host_pre=[], steps_adb_pre=[], pkgs=[],
+                 steps_adb_post=[], steps_host_post=[], **kwargs):
+        self.steps_host_pre = steps_host_pre
+        self.steps_adb_pre = steps_adb_pre
+        self.pkgs = pkgs
+        self.steps_adb_post = steps_adb_post
+        self.steps_host_post = steps_host_post
+
+    def _uninstallapk(self):
+        for pkg in self.pkgs:
+            rc = self.adb.uninstallapk(pkg)
+            if rc:
+                raise RuntimeError(
+                        "Failed to uninstall apk '%s' failed. %d" % (pkg, rc))
+
+    def uninstall(self):
+        _run_steps_host(self.steps_host_pre, self.adb.serial)
+        _run_steps_adb(self.steps_adb_pre, self.adb.serial)
+        self._uninstallapk()
+        _run_steps_adb(self.steps_adb_post, self.adb.serial)
+        _run_steps_host(self.steps_host_post, self.adb.serial)
+
+    def setadb(self, adb=None):
+        self.adb = adb
+
+
 class AndroidTestRunner(object):
 
     adb = ADB()
-- 
1.8.1.2

_______________________________________________
linaro-validation mailing list
linaro-validation@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-validation

Reply via email to