Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | # |
| 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 6 | from oeqa.runtime.case import OERuntimeTestCase |
| 7 | from oeqa.core.decorator.depends import OETestDepends |
| 8 | |
| 9 | import time |
| 10 | |
| 11 | class RunLevel_Test(OERuntimeTestCase): |
| 12 | |
| 13 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
| 14 | def test_runlevel_3(self): |
| 15 | (status, output) = self.target.run("init 3 && sleep 5 && runlevel") |
| 16 | runlevel= '5 3' |
| 17 | self.assertEqual(output, runlevel, msg='Failed to set current runlevel to runlevel 3, current runlevel : %s' % output[-1]) |
| 18 | (status, output) = self.target.run("uname -a") |
| 19 | self.assertEqual(status, 0, msg='Failed to run uname command, output: %s' % output) |
| 20 | |
| 21 | @OETestDepends(['runlevel.RunLevel_Test.test_runlevel_3']) |
| 22 | def test_runlevel_5(self): |
| 23 | (status, output) = self.target.run("init 5 && sleep 5 && runlevel") |
| 24 | runlevel = '3 5' |
| 25 | self.assertEqual(output, runlevel, msg='Failed to set current runlevel to runlevel 5, current runlevel : %s' % output[-1]) |
| 26 | (status, output) = self.target.run('export DISPLAY=:0 && x11perf -aa10text') |
| 27 | self.assertEqual(status, 0, msg='Failed to run 2D graphic test, output: %s' % output) |