summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-05-14 14:33:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-15 17:45:00 +0100
commitc5316d4d57878eb05cabf1e724242610b86ca2cb (patch)
tree3ba05b87388d0bad9de6533e0d307b0ae49ab185 /bitbake/lib/bb
parentf5a87b4707ccd7d7c0063bb4b48865b5433a0332 (diff)
downloadpoky-c5316d4d57878eb05cabf1e724242610b86ca2cb.tar.gz
bitbake: tests/fetch: ensure fetch tests preserve current dir
The fetcher calls os.chdir() in a number of places, which can affect other tests (since the directory it changes into gets deleted) - let's just put the current directory back to where it was when we're done. (This fixes bb.tests.Path.test_unsafe_delete_path failing if it was run as part of a full bitbake-selftest run, where the fetcher tests get to run before it.) (Bitbake rev: b1653855c74f86909c9f329ed6d2b10391c28395) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/tests/fetch.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index d3f7b6ac6c..3575468e57 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -315,6 +315,7 @@ class URITest(unittest.TestCase):
315class FetcherTest(unittest.TestCase): 315class FetcherTest(unittest.TestCase):
316 316
317 def setUp(self): 317 def setUp(self):
318 self.origdir = os.getcwd()
318 self.d = bb.data.init() 319 self.d = bb.data.init()
319 self.tempdir = tempfile.mkdtemp() 320 self.tempdir = tempfile.mkdtemp()
320 self.dldir = os.path.join(self.tempdir, "download") 321 self.dldir = os.path.join(self.tempdir, "download")
@@ -326,6 +327,7 @@ class FetcherTest(unittest.TestCase):
326 self.d.setVar("PERSISTENT_DIR", persistdir) 327 self.d.setVar("PERSISTENT_DIR", persistdir)
327 328
328 def tearDown(self): 329 def tearDown(self):
330 os.chdir(self.origdir)
329 bb.utils.prunedir(self.tempdir) 331 bb.utils.prunedir(self.tempdir)
330 332
331class MirrorUriTest(FetcherTest): 333class MirrorUriTest(FetcherTest):