blob: 96ba3c31954fa8f88a08a0f4d17e3675d02f86dd [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
Andrew Geisslerc9f78652020-09-18 14:11:35 -05006from oeqa.runtime.case import OERuntimeTestCase
7from oeqa.core.decorator.depends import OETestDepends
8from oeqa.runtime.decorator.package import OEHasPackage
9
10import threading
11import time
12
13class TerminalTest(OERuntimeTestCase):
14
15 @OEHasPackage(['matchbox-terminal'])
16 @OETestDepends(['ssh.SSHTest.test_ssh'])
17 def test_terminal_running(self):
Andrew Geisslerd1e89492021-02-12 15:35:20 -060018 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 -050019 t_thread.start()
20 time.sleep(2)
Andrew Geisslerd1e89492021-02-12 15:35:20 -060021
Andrew Geisslerc9f78652020-09-18 14:11:35 -050022 status, output = self.target.run('pidof matchbox-terminal')
Andrew Geisslerd1e89492021-02-12 15:35:20 -060023 number_of_terminal = len(output.split())
24 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 -050025 self.target.run('kill -9 %s' % output)
Andrew Geisslerd1e89492021-02-12 15:35:20 -060026 self.assertEqual(status, 0, msg='Not able to find process that runs terminal.')