summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/contrib/tts/tests.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-05-13 13:21:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-14 18:04:10 +0100
commit80ca4f00f82cd2f58fe5cda38c8cc5a719c887b6 (patch)
treef2d5a130213c37b8aed1fb07fecf46eb9e5e1a13 /bitbake/lib/toaster/contrib/tts/tests.py
parent23f5b009e0ebf59cfcc9ae90a1084468fc88e42f (diff)
downloadpoky-80ca4f00f82cd2f58fe5cda38c8cc5a719c887b6.tar.gz
bitbake: toaster/contrib: adding TTS squashed patch
In order to move the Toaster Test System in Toaster itself, we create a contrib directory. The TTS is added as a squashed patch with no history. It contains code contributed by Ke Zou <ke.zou@windriver.com>. (Bitbake rev: 7d24fea2b5dcaac6add738b6fb4700d698824286) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/contrib/tts/tests.py')
-rw-r--r--bitbake/lib/toaster/contrib/tts/tests.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/contrib/tts/tests.py b/bitbake/lib/toaster/contrib/tts/tests.py
new file mode 100644
index 0000000000..3d4cfea2b3
--- /dev/null
+++ b/bitbake/lib/toaster/contrib/tts/tests.py
@@ -0,0 +1,57 @@
1#!/usr/bin/python
2
3# ex:ts=4:sw=4:sts=4:et
4# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
5#
6# Copyright (C) 2015 Alexandru Damian for Intel Corp.
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 2 as
10# published by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21
22# Test definitions. The runner will look for and auto-discover the tests
23# no matter what they file are they in, as long as they are in the same directory
24# as this file.
25
26import unittest
27from shellutils import *
28
29class TestPyCompilable(unittest.TestCase):
30 ''' Verifies that all Python files are syntactically correct '''
31 def test_compile_file(self):
32 try:
33 out = run_shell_cmd("find . -name *py -type f -print0 | xargs -0 -n1 -P20 python -m py_compile", config.testdir)
34 except ShellCmdException as e:
35 self.fail("Error compiling python files: %s" % (e))
36 except Exception as e:
37 self.fail("Unknown error: %s" % e)
38
39
40class TestPySystemStart(unittest.TestCase):
41 ''' Attempts to start Toaster, verify that it is succesfull, and stop it '''
42 def setUp(self):
43 run_shell_cmd("bash -c 'rm -f build/*log'")
44
45 def test_start_interactive_mode(self):
46 try:
47 run_shell_cmd("bash -c 'source %s/oe-init-build-env && source toaster start && source toaster stop'" % config.testdir, config.testdir)
48 except ShellCmdException as e:
49 self.fail("Failed starting interactive mode: %s" % (e))
50
51 def test_start_managed_mode(self):
52 try:
53 run_shell_cmd("./poky/bitbake/bin/toaster webport=56789 & sleep 10 && curl http://localhost:56789/ && kill -2 %1")
54 pass
55 except ShellCmdException as e:
56 self.fail("Failed starting managed mode: %s" % (e))
57