summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorTeoh Jay Shen <jay.shen.teoh@intel.com>2021-02-18 13:21:01 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-04 17:39:08 +0000
commitd1000e553d2db31331c9c827b8edd8897c9e986f (patch)
treeff0297f47f4fbb34ad030be2fbcba12e34e0670b /meta
parent76a3b07f901f4ada87092f3ea9a95306273f2009 (diff)
downloadpoky-d1000e553d2db31331c9c827b8edd8897c9e986f.tar.gz
oeqa/runlevel : add test for runlevels
This test mimic the boot_from_runlevel_3 and boot_from_runlevel_5 test cases from oeqa/manual/bsp-hw.json. The boot_from_runlevel_3 and boot_from_runlevel_5 manual test cases should be remove from oeqa/manual/bsp-hw.json if this patch get merged. (From OE-Core rev: 56d4c2867743b4b6bf79a4a9472799038522a331) Signed-off-by: Teoh Jay Shen <jay.shen.teoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6effd30f0e3726bc1f2eb7768c57c6b95eddb079) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/runtime/cases/runlevel.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/runlevel.py b/meta/lib/oeqa/runtime/cases/runlevel.py
new file mode 100644
index 0000000000..3a4df8ace1
--- /dev/null
+++ b/meta/lib/oeqa/runtime/cases/runlevel.py
@@ -0,0 +1,22 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.core.decorator.depends import OETestDepends
3
4import time
5
6class RunLevel_Test(OERuntimeTestCase):
7
8 @OETestDepends(['ssh.SSHTest.test_ssh'])
9 def test_runlevel_3(self):
10 (status, output) = self.target.run("init 3 && sleep 5 && runlevel")
11 runlevel= '5 3'
12 self.assertEqual(output, runlevel, msg='Failed to set current runlevel to runlevel 3, current runlevel : %s' % output[-1])
13 (status, output) = self.target.run("uname -a")
14 self.assertEqual(status, 0, msg='Failed to run uname command, output: %s' % output)
15
16 @OETestDepends(['runlevel.RunLevel_Test.test_runlevel_3'])
17 def test_runlevel_5(self):
18 (status, output) = self.target.run("init 5 && sleep 5 && runlevel")
19 runlevel = '3 5'
20 self.assertEqual(output, runlevel, msg='Failed to set current runlevel to runlevel 5, current runlevel : %s' % output[-1])
21 (status, output) = self.target.run('export DISPLAY=:0 && x11perf -aa10text')
22 self.assertEqual(status, 0, msg='Failed to run 2D graphic test, output: %s' % output)