From patchwork Mon Apr 4 22:31:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lo=C3=AFc_Minier?= X-Patchwork-Id: 899 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:47:12 -0000 Delivered-To: patches@linaro.org Received: by 10.68.42.132 with SMTP id o4cs82805pbl; Mon, 4 Apr 2011 15:31:21 -0700 (PDT) Received: by 10.216.44.208 with SMTP id n58mr4845294web.39.1301956280367; Mon, 04 Apr 2011 15:31:20 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id c37si10863290wek.153.2011.04.04.15.31.19; Mon, 04 Apr 2011 15:31:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Q6sIp-0007Bf-Gg for ; Mon, 04 Apr 2011 22:31:19 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 7B16E2E84F6 for ; Mon, 4 Apr 2011 22:31:19 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-maintainers/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 311 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-maintainers/linaro-image-tools/trunk] Rev 311: Mock os.getuid() in test_append_to_fstab() to avoid calling sudo in the tests. Message-Id: <20110404223119.1168.9592.launchpad@loganberry.canonical.com> Date: Mon, 04 Apr 2011 22:31:19 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="12734"; Instance="initZopeless config overlay" X-Launchpad-Hash: 8637101e7de787882a57177826383c6318d5ef00 ------------------------------------------------------------ revno: 311 committer: Loïc Minier branch nick: linaro-image-tools timestamp: Tue 2011-04-05 00:28:58 +0200 message: Mock os.getuid() in test_append_to_fstab() to avoid calling sudo in the tests. modified: linaro_image_tools/media_create/tests/test_media_create.py --- lp:linaro-image-tools https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk You are subscribed to branch lp:linaro-image-tools. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk/+edit-subscription === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2011-04-04 21:23:58 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2011-04-04 22:28:58 +0000 @@ -1127,6 +1127,9 @@ def test_append_to_fstab(self): tempdir = self.useFixture(CreateTempDirFixture()).get_temp_dir() + # we don't really need root (sudo) as we're not writing to a real + # root owned /etc + self.useFixture(MockSomethingFixture(os, 'getuid', lambda: 0)) etc = os.path.join(tempdir, 'etc') os.mkdir(etc) fstab = os.path.join(etc, 'fstab')