diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/commands')
-rw-r--r-- | bitbake/lib/toaster/tests/commands/test_loaddata.py | 4 | ||||
-rw-r--r-- | bitbake/lib/toaster/tests/commands/test_lsupdates.py | 3 | ||||
-rw-r--r-- | bitbake/lib/toaster/tests/commands/test_runbuilds.py | 13 |
3 files changed, 13 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/tests/commands/test_loaddata.py b/bitbake/lib/toaster/tests/commands/test_loaddata.py index 9e8d5553cf..7d04f030ee 100644 --- a/bitbake/lib/toaster/tests/commands/test_loaddata.py +++ b/bitbake/lib/toaster/tests/commands/test_loaddata.py | |||
@@ -6,13 +6,13 @@ | |||
6 | # | 6 | # |
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | import pytest | |
10 | from django.test import TestCase | 10 | from django.test import TestCase |
11 | from django.core import management | 11 | from django.core import management |
12 | 12 | ||
13 | from orm.models import Layer_Version, Layer, Release, ToasterSetting | 13 | from orm.models import Layer_Version, Layer, Release, ToasterSetting |
14 | 14 | ||
15 | 15 | @pytest.mark.order(2) | |
16 | class TestLoadDataFixtures(TestCase): | 16 | class TestLoadDataFixtures(TestCase): |
17 | """ Test loading our 3 provided fixtures """ | 17 | """ Test loading our 3 provided fixtures """ |
18 | def test_run_loaddata_poky_command(self): | 18 | def test_run_loaddata_poky_command(self): |
diff --git a/bitbake/lib/toaster/tests/commands/test_lsupdates.py b/bitbake/lib/toaster/tests/commands/test_lsupdates.py index 3c4fbe0550..30c6eeb4ac 100644 --- a/bitbake/lib/toaster/tests/commands/test_lsupdates.py +++ b/bitbake/lib/toaster/tests/commands/test_lsupdates.py | |||
@@ -7,12 +7,13 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | import pytest | ||
10 | from django.test import TestCase | 11 | from django.test import TestCase |
11 | from django.core import management | 12 | from django.core import management |
12 | 13 | ||
13 | from orm.models import Layer_Version, Machine, Recipe | 14 | from orm.models import Layer_Version, Machine, Recipe |
14 | 15 | ||
15 | 16 | @pytest.mark.order(3) | |
16 | class TestLayerIndexUpdater(TestCase): | 17 | class TestLayerIndexUpdater(TestCase): |
17 | def test_run_lsupdates_command(self): | 18 | def test_run_lsupdates_command(self): |
18 | # Load some release information for us to fetch from the layer index | 19 | # Load some release information for us to fetch from the layer index |
diff --git a/bitbake/lib/toaster/tests/commands/test_runbuilds.py b/bitbake/lib/toaster/tests/commands/test_runbuilds.py index e223b95fcb..849c227edc 100644 --- a/bitbake/lib/toaster/tests/commands/test_runbuilds.py +++ b/bitbake/lib/toaster/tests/commands/test_runbuilds.py | |||
@@ -19,12 +19,14 @@ import time | |||
19 | import subprocess | 19 | import subprocess |
20 | import signal | 20 | import signal |
21 | 21 | ||
22 | import logging | ||
23 | |||
22 | 24 | ||
23 | class KillRunbuilds(threading.Thread): | 25 | class KillRunbuilds(threading.Thread): |
24 | """ Kill the runbuilds process after an amount of time """ | 26 | """ Kill the runbuilds process after an amount of time """ |
25 | def __init__(self, *args, **kwargs): | 27 | def __init__(self, *args, **kwargs): |
26 | super(KillRunbuilds, self).__init__(*args, **kwargs) | 28 | super(KillRunbuilds, self).__init__(*args, **kwargs) |
27 | self.setDaemon(True) | 29 | self.daemon = True |
28 | 30 | ||
29 | def run(self): | 31 | def run(self): |
30 | time.sleep(5) | 32 | time.sleep(5) |
@@ -34,9 +36,12 @@ class KillRunbuilds(threading.Thread): | |||
34 | pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."), | 36 | pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."), |
35 | ".runbuilds.pid") | 37 | ".runbuilds.pid") |
36 | 38 | ||
37 | with open(pidfile_path) as pidfile: | 39 | try: |
38 | pid = pidfile.read() | 40 | with open(pidfile_path) as pidfile: |
39 | os.kill(int(pid), signal.SIGTERM) | 41 | pid = pidfile.read() |
42 | os.kill(int(pid), signal.SIGTERM) | ||
43 | except ProcessLookupError: | ||
44 | logging.warning("Runbuilds not running or already killed") | ||
40 | 45 | ||
41 | 46 | ||
42 | class TestCommands(TestCase): | 47 | class TestCommands(TestCase): |