blob: 8fcca99f474c90dc2a22f5eb8f81f044208ae42d [file] [log] [blame]
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.core.decorator.depends import OETestDepends
3from oeqa.runtime.decorator.package import OEHasPackage
4
5import threading
6import time
7
8class TerminalTest(OERuntimeTestCase):
9
10 @OEHasPackage(['matchbox-terminal'])
11 @OETestDepends(['ssh.SSHTest.test_ssh'])
12 def test_terminal_running(self):
Andrew Geisslerd1e89492021-02-12 15:35:20 -060013 t_thread = threading.Thread(target=self.target.run, args=("export DISPLAY=:0 && matchbox-terminal -e 'sh -c \"uname -a && exec sh\"'",))
Andrew Geisslerc9f78652020-09-18 14:11:35 -050014 t_thread.start()
15 time.sleep(2)
Andrew Geisslerd1e89492021-02-12 15:35:20 -060016
Andrew Geisslerc9f78652020-09-18 14:11:35 -050017 status, output = self.target.run('pidof matchbox-terminal')
Andrew Geisslerd1e89492021-02-12 15:35:20 -060018 number_of_terminal = len(output.split())
19 self.assertEqual(number_of_terminal, 1, msg='There should be only one terminal being launched. Number of terminal launched : %s' % number_of_terminal)
Andrew Geisslerc9f78652020-09-18 14:11:35 -050020 self.target.run('kill -9 %s' % output)
Andrew Geisslerd1e89492021-02-12 15:35:20 -060021 self.assertEqual(status, 0, msg='Not able to find process that runs terminal.')