blob: 6734b0f5edab27ae077462aee74e98c226aa080f [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
Andrew Geissler9b4d8b02021-02-19 12:26:16 -06006from oeqa.runtime.case import OERuntimeTestCase
7from oeqa.core.decorator.depends import OETestDepends
8
9import time
10
11class 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)