1# Copyright (C) 2017-2018 Wind River Systems, Inc. 2# 3# SPDX-License-Identifier: GPL-2.0-only 4# 5 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 34