diff options
author | Stefan Stanacar <stefanx.stanacar@intel.com> | 2013-09-19 13:49:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-22 12:19:33 +0100 |
commit | ad77d1038674ee23ec62aa0df7acbc50f7c4d6d8 (patch) | |
tree | 8da3d7e56656a748890fb96bf81353e838792cc6 /meta/lib/oeqa | |
parent | f3ab2fc731e5e64e2408eefd6b255a2714c44c30 (diff) | |
download | poky-ad77d1038674ee23ec62aa0df7acbc50f7c4d6d8.tar.gz |
lib/oeqa/runtime: cleanup and improve output readability for some tests
- move everything in the same test. setUp/tearDown aren't quite
the right thing here, everything it's part of the same test. (and
it get's confusing when ssh fails)
ldd:
- change test name and add output to error message
vnc:
- remove unnecessary check as there is no point in doing
both ps and netstat. Also improve error output a bit.
(From OE-Core rev: 2f91bb438cfcdd0a40daed5902b6e98fc0aee67f)
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/runtime/date.py | 10 | ||||
-rw-r--r-- | meta/lib/oeqa/runtime/ldd.py | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/runtime/vnc.py | 9 |
3 files changed, 9 insertions, 14 deletions
diff --git a/meta/lib/oeqa/runtime/date.py b/meta/lib/oeqa/runtime/date.py index 3b35964763..a208e29ada 100644 --- a/meta/lib/oeqa/runtime/date.py +++ b/meta/lib/oeqa/runtime/date.py | |||
@@ -4,13 +4,12 @@ import re | |||
4 | 4 | ||
5 | class DateTest(oeRuntimeTest): | 5 | class DateTest(oeRuntimeTest): |
6 | 6 | ||
7 | def setUp(self): | 7 | @skipUnlessPassed("test_ssh") |
8 | def test_date(self): | ||
8 | (status, output) = self.target.run('date +"%Y-%m-%d %T"') | 9 | (status, output) = self.target.run('date +"%Y-%m-%d %T"') |
9 | self.assertEqual(status, 0, msg="Failed to get initial date, output: %s" % output) | 10 | self.assertEqual(status, 0, msg="Failed to get initial date, output: %s" % output) |
10 | self.oldDate = output | 11 | oldDate = output |
11 | 12 | ||
12 | @skipUnlessPassed("test_ssh") | ||
13 | def test_date(self): | ||
14 | sampleDate = '"2016-08-09 10:00:00"' | 13 | sampleDate = '"2016-08-09 10:00:00"' |
15 | (status, output) = self.target.run("date -s %s" % sampleDate) | 14 | (status, output) = self.target.run("date -s %s" % sampleDate) |
16 | self.assertEqual(status, 0, msg="Date set failed, output: %s" % output) | 15 | self.assertEqual(status, 0, msg="Date set failed, output: %s" % output) |
@@ -19,6 +18,5 @@ class DateTest(oeRuntimeTest): | |||
19 | p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output) | 18 | p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output) |
20 | self.assertTrue(p, msg="The date was not set correctly, output: %s" % output) | 19 | self.assertTrue(p, msg="The date was not set correctly, output: %s" % output) |
21 | 20 | ||
22 | def tearDown(self): | 21 | (status, output) = self.target.run('date -s "%s"' % oldDate) |
23 | (status, output) = self.target.run('date -s "%s"' % self.oldDate) | ||
24 | self.assertEqual(status, 0, msg="Failed to reset date, output: %s" % output) | 22 | self.assertEqual(status, 0, msg="Failed to reset date, output: %s" % output) |
diff --git a/meta/lib/oeqa/runtime/ldd.py b/meta/lib/oeqa/runtime/ldd.py index 577c5e26ef..4374530fc4 100644 --- a/meta/lib/oeqa/runtime/ldd.py +++ b/meta/lib/oeqa/runtime/ldd.py | |||
@@ -11,9 +11,9 @@ class LddTest(oeRuntimeTest): | |||
11 | @skipUnlessPassed('test_ssh') | 11 | @skipUnlessPassed('test_ssh') |
12 | def test_ldd_exists(self): | 12 | def test_ldd_exists(self): |
13 | (status, output) = self.target.run('which ldd') | 13 | (status, output) = self.target.run('which ldd') |
14 | self.assertEqual(status, 0, msg = "ldd does not exist in PATH !") | 14 | self.assertEqual(status, 0, msg = "ldd does not exist in PATH: which ldd: %s" % output) |
15 | 15 | ||
16 | @skipUnlessPassed('test_ldd_exists') | 16 | @skipUnlessPassed('test_ldd_exists') |
17 | def test_ldd(self): | 17 | def test_ldd_rtldlist_check(self): |
18 | (status, output) = self.target.run('for i in $(which ldd | xargs cat | grep "^RTLDLIST"|cut -d\'=\' -f2|tr -d \'"\'); do test -f $i && echo $i && break; done') | 18 | (status, output) = self.target.run('for i in $(which ldd | xargs cat | grep "^RTLDLIST"|cut -d\'=\' -f2|tr -d \'"\'); do test -f $i && echo $i && break; done') |
19 | self.assertEqual(status, 0, msg = "ldd path not correct or RTLDLIST files don't exist. ") | 19 | self.assertEqual(status, 0, msg = "ldd path not correct or RTLDLIST files don't exist. ") |
diff --git a/meta/lib/oeqa/runtime/vnc.py b/meta/lib/oeqa/runtime/vnc.py index ce111793b8..5ed10727bc 100644 --- a/meta/lib/oeqa/runtime/vnc.py +++ b/meta/lib/oeqa/runtime/vnc.py | |||
@@ -9,14 +9,11 @@ class VNCTest(oeRuntimeTest): | |||
9 | 9 | ||
10 | @skipUnlessPassed('test_ssh') | 10 | @skipUnlessPassed('test_ssh') |
11 | def test_vnc(self): | 11 | def test_vnc(self): |
12 | (status, output) = self.target.run('x11vnc -display :0.0 -bg -q') | 12 | (status, output) = self.target.run('x11vnc -display :0 -bg -o x11vnc.log') |
13 | self.assertEqual(status, 0, msg="x11vnc server failed to start: %s" % output) | 13 | self.assertEqual(status, 0, msg="x11vnc server failed to start: %s" % output) |
14 | port = re.search('PORT=[0-9]*', output) | 14 | port = re.search('PORT=[0-9]*', output) |
15 | self.assertTrue(port, msg="Listening port not specified in command output: %s" %output) | 15 | self.assertTrue(port, msg="Listening port not specified in command output: %s" %output) |
16 | 16 | ||
17 | (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [x]11vnc') | ||
18 | self.assertEqual(status, 0, msg="x11vnc process not running") | ||
19 | |||
20 | vncport = port.group(0).split('=')[1] | 17 | vncport = port.group(0).split('=')[1] |
21 | (status, output) = self.target.run('netstat -atun | grep :%s | grep LISTEN' % vncport) | 18 | (status, output) = self.target.run('netstat -ntl | grep ":%s"' % vncport) |
22 | self.assertEqual(status, 0, msg="x11vnc server not running on port %s" % vncport) | 19 | self.assertEqual(status, 0, msg="x11vnc server not running on port %s\n\n%s" % (vncport, self.target.run('netstat -ntl; cat x11vnc.log')[1])) |