blob: 077382f11d99a1281b9b10e38a966d14d902304a [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001# Copyright (C) 2017-2018 Wind River Systems, Inc.
2#
Brad Bishopc342db32019-05-15 21:57:59 -04003# SPDX-License-Identifier: GPL-2.0-only
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004#
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005
6import unittest
7import tempfile
8import os
9import bb
10
11import logging
12
13class LayersTest(unittest.TestCase):
14
15 def setUp(self):
16 self.origdir = os.getcwd()
17 self.d = bb.data.init()
18 # At least one variable needs to be set
19 self.d.setVar('DL_DIR', os.getcwd())
20
21 if os.environ.get("BB_SKIP_NETTESTS") == "yes":
22 self.d.setVar('BB_NO_NETWORK', '1')
23
24 self.tempdir = tempfile.mkdtemp()
25 self.logger = logging.getLogger("BitBake")
26
27 def tearDown(self):
28 os.chdir(self.origdir)
29 if os.environ.get("BB_TMPDIR_NOCLEAN") == "yes":
30 print("Not cleaning up %s. Please remove manually." % self.tempdir)
31 else:
32 bb.utils.prunedir(self.tempdir)
33