From patchwork Thu Mar 29 07:53:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10314659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5CF2460212 for ; Thu, 29 Mar 2018 07:54:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 535C62A166 for ; Thu, 29 Mar 2018 07:54:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47B0D2A1D6; Thu, 29 Mar 2018 07:54:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEA752A166 for ; Thu, 29 Mar 2018 07:54:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177AbeC2HyM (ORCPT ); Thu, 29 Mar 2018 03:54:12 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33674 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbeC2HyI (ORCPT ); Thu, 29 Mar 2018 03:54:08 -0400 Received: by mail-pf0-f195.google.com with SMTP id f15so2715046pfn.0 for ; Thu, 29 Mar 2018 00:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=tN5jnq7d3rhFg/Xuk9yLGZPdZLw8//y2hDcA6dL3jIk=; b=bYa1EBVuQJmOCcVotvw6gocZDEysgnivjvoApyZL5DxDQ4BjVr5Iia7dQY6MvGbT4u lkTUTQ1Yoop0dpTRAmzdd2fhLyJ+5SGRwfCMsuVlCtDFE9g31fgNIMBCRhUBLNmeGxpX S89625fydHYxymaJC2NcfJZjX4wdabdlApz4sXPDVhaRJzv8qNPnxm+1lLTcl2k795cx Ei1LnN8XUI+8PRyMsuJdbHCaVyEVBaUmO0AcW1QEO0XvZ/xm5jL+NFInQpq71nRF2PLZ uB8C5RMefOdnCbkbf29uKpZZfCU/BxdQpZaftysuOaZ/hkAkiamMbxBBHU9Z/xBOxMge PfUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=tN5jnq7d3rhFg/Xuk9yLGZPdZLw8//y2hDcA6dL3jIk=; b=AlQR5hKCyeVuUjLgvhDT3BtVZK+oFw9vmHy5ul8pYwYZZrF4GHBglLJJmfv7RjgVUk lA0VEO6sSrJDrI2Im10RMgzcFLApYB4TtLUBzKGvK7xvsl8bAMt6ZKWaGlinirBgXlVT 7kBdjHYK/9mSOGea0ZSnQYfIpNYJPlCsgq07K003nIzOExCeNXHNk/ybWxn57FYA1wAF yo1xPY4ANbWLiw7vbSaPrH2wCYqT1e6gsSdRBI2pwcmvx0HqToCGfNjryFF8VJ/SsSpO 1cp5WY3tLooVUfvPL7KMB7RAU3PIDiwkTUZjGJhmDFpnnAd7iYF/sLe2EbOtRVtgmDyR e/fA== X-Gm-Message-State: AElRT7H36TxARXxKLCowD6URU3zQgqKNtB5VA78P/BHs6odwgxU2TU+4 2Ti2PKObeMwevanihgQCvZrx7AwqwT0= X-Google-Smtp-Source: AIpwx485lqAnWTvivb0OGa1G9k88934SMYJ/ysYLxoWSbBYo5Gf1UD+9nO5VnJXxKZVTpL7hZClZMg== X-Received: by 10.98.137.15 with SMTP id v15mr5476701pfd.95.1522310047957; Thu, 29 Mar 2018 00:54:07 -0700 (PDT) Received: from localhost.localdomain ([2601:602:8801:8110:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id j65sm9763790pge.58.2018.03.29.00.54.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 00:54:07 -0700 (PDT) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 5/5] libbtrfsutil: fix test assumptions about top-level subvolume Date: Thu, 29 Mar 2018 00:53:57 -0700 Message-Id: <459ffd8130e337e16fc2205584ee27883e959442.1522309741.git.osandov@fb.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval Since "btrfs-progs: mkfs: add uuid and otime to ROOT_ITEM of, FS_TREE", the top-level subvolume has a non-zero UUID, ctime, and otime. Fix the subvolume_info() test to not check for zero. Signed-off-by: Omar Sandoval Reviewed-by: Tomohiro Misono --- libbtrfsutil/python/tests/test_subvolume.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libbtrfsutil/python/tests/test_subvolume.py b/libbtrfsutil/python/tests/test_subvolume.py index a46d4a34..93396cba 100644 --- a/libbtrfsutil/python/tests/test_subvolume.py +++ b/libbtrfsutil/python/tests/test_subvolume.py @@ -95,7 +95,8 @@ class TestSubvolume(BtrfsTestCase): self.assertEqual(info.parent_id, 0) self.assertEqual(info.dir_id, 0) self.assertEqual(info.flags, 0) - self.assertEqual(info.uuid, bytes(16)) + self.assertIsInstance(info.uuid, bytes) + self.assertEqual(len(info.uuid), 16) self.assertEqual(info.parent_uuid, bytes(16)) self.assertEqual(info.received_uuid, bytes(16)) self.assertNotEqual(info.generation, 0) @@ -103,8 +104,8 @@ class TestSubvolume(BtrfsTestCase): self.assertEqual(info.otransid, 0) self.assertEqual(info.stransid, 0) self.assertEqual(info.rtransid, 0) - self.assertEqual(info.ctime, 0) - self.assertEqual(info.otime, 0) + self.assertIsInstance(info.ctime, float) + self.assertIsInstance(info.otime, float) self.assertEqual(info.stime, 0) self.assertEqual(info.rtime, 0) @@ -117,6 +118,7 @@ class TestSubvolume(BtrfsTestCase): self.assertEqual(info.dir_id, 256) self.assertEqual(info.flags, 0) self.assertIsInstance(info.uuid, bytes) + self.assertEqual(len(info.uuid), 16) self.assertEqual(info.parent_uuid, bytes(16)) self.assertEqual(info.received_uuid, bytes(16)) self.assertNotEqual(info.generation, 0)