All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: yocto@yoctoproject.org
Cc: richard.purdie@intel.com, "Aníbal Limón" <limon.anibal@gmail.com>,
	benjamin.esquivel@intel.com
Subject: [[PATCH][qa-tools] 04/16] tests/toaster/__init__.py: Add support for clone/setup/start/stop
Date: Tue,  9 Feb 2016 16:43:13 -0600	[thread overview]
Message-ID: <1455057798-3213-5-git-send-email-anibal.limon@linux.intel.com> (raw)
In-Reply-To: <1455057798-3213-1-git-send-email-anibal.limon@linux.intel.com>

From: Aníbal Limón <limon.anibal@gmail.com>

The main idea is to have an script for execute tests against toaster
so for now the arguments to execute toaster tests are fixed but
will be configured with args in the console.

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
---
 tests/toaster/__init__.py | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/tests/toaster/__init__.py b/tests/toaster/__init__.py
index 659faa8..3762094 100755
--- a/tests/toaster/__init__.py
+++ b/tests/toaster/__init__.py
@@ -1,5 +1,6 @@
 import unittest, time, re, sys, getopt, os, logging, string, errno, exceptions
 import shutil, argparse, ConfigParser, platform
+
 from selenium import webdriver
 from selenium.common.exceptions import NoSuchElementException
 from selenium import selenium
@@ -7,11 +8,28 @@ from selenium.webdriver.common.by import By
 from selenium.webdriver.common.keys import Keys
 from selenium.webdriver.support.ui import Select
 
+sys.path.insert(0, os.path.join(os.path.dirname(
+    os.path.abspath(__file__)), '../'))
+from toaster.helpers import *
+
+WORK_DIRECTORY = '/tmp/toaster'
+POKY_URL = 'http://git.yoctoproject.org/git/poky.git'
+
 class InitToaster(unittest.TestCase):
-    def setUp(self):
+    @classmethod
+    def setUpClass(self):
+        toaster_clone(WORK_DIRECTORY, POKY_URL, rm=True)
+        toaster_setup(WORK_DIRECTORY)
+        toaster_start(WORK_DIRECTORY)
+
         self.driver = webdriver.Firefox()
         self.timeout = 320
 
+    @classmethod
+    def tearDownClass(self):
+        self.driver.close()
+        toaster_stop(WORK_DIRECTORY)
+
     def is_text_present (self, patterns):
         for pattern in patterns:
             if str(pattern) not in self.driver.page_source:
@@ -102,8 +120,5 @@ class InitToaster(unittest.TestCase):
                 self.fail(msg="Builds did not complete successfully.")
         print "Builds complete!"
 
-    def tearDown(self):
-        self.driver.close()
-
 if __name__ == "__main__":
     unittest.main()
-- 
2.1.4



  parent reply	other threads:[~2016-02-09 22:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 22:43 [[PATCH][qa-tools] 00/16] Add Toaster test suite support Aníbal Limón
2016-02-09 22:43 ` [[PATCH][qa-tools] 01/16] README.md: Update instructions on how install host deps on debian Aníbal Limón
2016-02-09 22:43 ` [[PATCH][qa-tools] 02/16] utils/run/toaster.sh: Get rid of toaster shell script Aníbal Limón
2016-02-09 22:43 ` [[PATCH][qa-tools] 03/16] toaster: Add helpers for clone, setup, start and stop Aníbal Limón
2016-02-09 22:43 ` Aníbal Limón [this message]
2016-02-09 22:43 ` [[PATCH][qa-tools] 05/16] tests/toaster/helpers.py: When execute bash remove interactive mode Aníbal Limón
2016-02-09 22:43 ` [[PATCH][qa-tools] 06/16] tests/toaster/helpers.py: Fix toaster_start deadlocks Aníbal Limón
2016-02-09 22:43 ` [[PATCH][qa-tools] 07/16] ts/toaster/helpers.py: Add new class ToasterHelper instead functions Aníbal Limón
2016-02-09 22:43 ` [[PATCH][qa-tools] 08/16] toaster/helper.py: Add force mode to stop method Aníbal Limón
2016-02-09 22:43 ` [[PATCH][qa-tools] 09/16] toaster/__init__.py: Update toaster test to match new ToasterHelper Aníbal Limón

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455057798-3213-5-git-send-email-anibal.limon@linux.intel.com \
    --to=anibal.limon@linux.intel.com \
    --cc=benjamin.esquivel@intel.com \
    --cc=limon.anibal@gmail.com \
    --cc=richard.purdie@intel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.