diff options
author | Teoh Jay Shen <jay.shen.teoh@intel.com> | 2021-02-18 13:21:01 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-19 10:59:57 +0000 |
commit | 6effd30f0e3726bc1f2eb7768c57c6b95eddb079 (patch) | |
tree | d57b61338fbf9e5e2e9bff23e12d42a15b8fd51d /meta/lib/oeqa/runtime/cases/runlevel.py | |
parent | e632b97d2411bc4510c54f6ac32ffa9042f69034 (diff) | |
download | openembedded-core-contrib-6effd30f0e3726bc1f2eb7768c57c6b95eddb079.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.
Signed-off-by: Teoh Jay Shen <jay.shen.teoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/runlevel.py')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/runlevel.py | 22 |
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 @@ +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends + +import time + +class RunLevel_Test(OERuntimeTestCase): + + @OETestDepends(['ssh.SSHTest.test_ssh']) + def test_runlevel_3(self): + (status, output) = self.target.run("init 3 && sleep 5 && runlevel") + runlevel= '5 3' + self.assertEqual(output, runlevel, msg='Failed to set current runlevel to runlevel 3, current runlevel : %s' % output[-1]) + (status, output) = self.target.run("uname -a") + self.assertEqual(status, 0, msg='Failed to run uname command, output: %s' % output) + + @OETestDepends(['runlevel.RunLevel_Test.test_runlevel_3']) + def test_runlevel_5(self): + (status, output) = self.target.run("init 5 && sleep 5 && runlevel") + runlevel = '3 5' + self.assertEqual(output, runlevel, msg='Failed to set current runlevel to runlevel 5, current runlevel : %s' % output[-1]) + (status, output) = self.target.run('export DISPLAY=:0 && x11perf -aa10text') + self.assertEqual(status, 0, msg='Failed to run 2D graphic test, output: %s' % output) |