From patchwork Thu Dec 13 21:38:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 153700 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1322459ljp; Thu, 13 Dec 2018 13:41:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/XnuLF3wtLIn8A16LP0Y5LbYvkfshWdm0keb3DeNLrQxWFPduq87EalQg7+obYhoTW2l5f+ X-Received: by 2002:a65:560e:: with SMTP id l14mr430578pgs.168.1544737263306; Thu, 13 Dec 2018 13:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544737263; cv=none; d=google.com; s=arc-20160816; b=bP0KtQMLXSoE0nEYWRfBCJ8G48FYfGgo6DsQbDK89uALxue2rxLWLl2+sySYqNtR9j 33B1kVJYQPk6LRHHPD5kOWVQsyrxzBcuML+lvIoRs5emAFD3yaZUD5nfD/CmTz4x8CZa JJMc/SWIhHEOKTmPAyt6z/cQhu2I1QmA+WoW5wBJfLurgZNXsrhVmEcufc9rZeFDYcFk EJ6yOl9wLqvr+56vuX+WnTWnkB0g/8UMQQlsVoQU9LotA/Y4Yrc10/mZfeOL1RiuASpo 5YB78IJYrfG2ak9TxekmXbK8mRGi/0bhoQF9A1nJU++eKwqeg8klNiW6tX5OkpS9apcy Yb4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=3yhmbNPgQUKZRBlZztvw2oGgSG+GeHg9jpAZOEkQkuo=; b=x9f36F2cXktF1ff1ju5dAGurpACJaj1isHL4ywzAZXvZh+roRCkf72zGWgAJCbp6kc 09Il0leitgGSR24ETUxX01689gtqyI9wioWNdFps7R786hM97WPulDVdkQ6WmvVV4bz8 j5+g7zgOUvhkV0eIs/8PnN0nLBd0IUW14xCDgfyzu4eVvUc+NETxiFxnUZxRBuflFo/j taruD62sreZ9Aj/QreVpbX17wiLqghlE2O2HcC0+ALPyTZCpugIwgOXrn83FI552AxXh wSUSv6unfth1pgYk4DlBRqZhyJZquB4jH/I1OpY6TYead7yuVDpd6GRToP8jIx8PK7JV WjBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=gkz7PTcn; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id u69si2550567pfj.219.2018.12.13.13.41.03; Thu, 13 Dec 2018 13:41:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=gkz7PTcn; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id B1A6579DC0; Thu, 13 Dec 2018 21:39:39 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by mail.openembedded.org (Postfix) with ESMTP id 593DE746BB for ; Thu, 13 Dec 2018 21:39:17 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id e5so1671949plb.5 for ; Thu, 13 Dec 2018 13:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=hosjN0YKlKRRF9ubLk+ggaxWNhBm16aEBPM7vRSArcA=; b=gkz7PTcnOhMflJxggxSvBUG4lOtD2QLMHpifh7br2rYPFuQ42VBRJnHOXe1o7HwdvJ 7zarDiHOzHh9V5ZpoXBkqOyLycliVLha4JpQHow+6sbyHqLrzKS6gpkxbFbK9bqraKKI UEz17lwGLBt3lD2PZbwrTp68uZYg5lF0BNQQHVVbz1plHUxH5ud2ujIHzoaH5bKt5dBD pXi5lCy8WBuyjjwSXldA927nMDUJHAEbFZSUPV2e7qZA2i4iSI2eYdnJQt8F3J4LIJCs 43IwEsQ4IqKC2F15VOf9KgHepFQdPj1F+YFreck/SP1pu7qHayi5w7dEtqvNrz2BKbqg F4AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=hosjN0YKlKRRF9ubLk+ggaxWNhBm16aEBPM7vRSArcA=; b=DN6IFwRKrlv20qgNDRJdysEUydL5HnvefuCAe0TQJGHQUTR4jV02rKjGCRyHO76Rbm jU3Mn5RfjHS/pItm2rJYtPLOBEnWxzSIyr4s/i+/SmWitDMHiop7+HNWfOc8lSchK7md NxHC8JgwjHduvUlNlpY4/D1MlKDUscpDOuNDPAg9KKZdZCzOZGcSaUS39YJ4Z/Xsgsoy rt+XYxFmvdTSQC0zN98xQmreUIEAo8g44nj7k+DBvasUhusmf9dXdX7HfGaUNu8AfUrW zHW/oYVpBksEswBendmzRTBuzXlmCgNeL8G4dm0Sdtp8WqdGuFx1HvmiCQrAbEK9+Y8X BV1g== X-Gm-Message-State: AA+aEWaeixlWI4DQQ36jC8sjQIZPZUwnMbjmVw2No9RIv98gUd0mNNhP Vxmugm8fujKGgSA/ozPdOYKlIbxb X-Received: by 2002:a17:902:b943:: with SMTP id h3mr479495pls.12.1544737158428; Thu, 13 Dec 2018 13:39:18 -0800 (PST) Received: from akuster-ThinkPad-T460s.hsd1.ca.comcast.net ([2601:202:4180:c33:79af:1f36:1822:3801]) by smtp.gmail.com with ESMTPSA id b9sm3288912pfi.118.2018.12.13.13.39.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Dec 2018 13:39:17 -0800 (PST) From: Armin Kuster To: openembedded-core@lists.openembedded.org, akuster808@gmail.com Date: Thu, 13 Dec 2018 13:38:23 -0800 Message-Id: <31370a26389ff70c879f13ef314627a7d8efc6c4.1544735897.git.akuster808@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [OE-core] [PATCH 15/45] oeqa/oelib/path: don't leak temporary directories X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Ross Burton setUp() is used to populate a directory of temporary files, and deleted in __del__. However setUp() is called once *per test* so __del__ would only be able to remove the last directory created. Fix the code by using the natural counterpart to setUp, tearDown(), to clean up. (From OE-Core rev: 68b4723e6fb11d171869185bccf28f32f6284c18) (From OE-Core rev: edd2ecbc86d8b02a0467491451306f67e81d9ead) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/oelib/path.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oeqa/selftest/cases/oelib/path.py b/meta/lib/oeqa/selftest/cases/oelib/path.py index 75a27c0..e0eb813 100644 --- a/meta/lib/oeqa/selftest/cases/oelib/path.py +++ b/meta/lib/oeqa/selftest/cases/oelib/path.py @@ -38,13 +38,6 @@ class TestRealPath(TestCase): ( "b/test", errno.ENOENT ), ] - def __del__(self): - try: - #os.system("tree -F %s" % self.tmpdir) - shutil.rmtree(self.tmpdir) - except: - pass - def setUp(self): self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path") self.root = os.path.join(self.tmpdir, "R") @@ -59,6 +52,9 @@ class TestRealPath(TestCase): for l in self.LINKS: os.symlink(l[1], os.path.join(self.root, l[0])) + def tearDown(self): + shutil.rmtree(self.tmpdir) + def __realpath(self, file, use_physdir, assume_dir = True): return oe.path.realpath(os.path.join(self.root, file), self.root, use_physdir, assume_dir = assume_dir)