neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone

Blame SOURCES/0024-tests-Mark-fake-disks-in-test_get_related_disks-as-n.patch

d891b6
From a709c4db1bcf2e7ff69158a54ed3a1ea92ba4f97 Mon Sep 17 00:00:00 2001
d891b6
From: Vojtech Trefny <vtrefny@redhat.com>
d891b6
Date: Thu, 14 Oct 2021 08:48:05 +0200
d891b6
Subject: [PATCH] tests: Mark "fake" disks in test_get_related_disks as
d891b6
 non-existing
d891b6
d891b6
We are using "real" disk names ("sda", "sdb"...) in this test so
d891b6
we need to avoid reading their real sizes which we do for existing
d891b6
devices using os.stat. The test can fail if we have a disk with
d891b6
the same name and small (or zero) size.
d891b6
d891b6
Resolves: rhbz#2062690
d891b6
---
d891b6
 tests/devicetree_test.py | 6 +++---
d891b6
 1 file changed, 3 insertions(+), 3 deletions(-)
d891b6
d891b6
diff --git a/tests/devicetree_test.py b/tests/devicetree_test.py
d891b6
index 3be4d572..c1b97c52 100644
d891b6
--- a/tests/devicetree_test.py
d891b6
+++ b/tests/devicetree_test.py
d891b6
@@ -406,9 +406,9 @@ class DeviceTreeTestCase(unittest.TestCase):
d891b6
     def test_get_related_disks(self):
d891b6
         tree = DeviceTree()
d891b6
 
d891b6
-        sda = DiskDevice("sda", size=Size('300g'))
d891b6
-        sdb = DiskDevice("sdb", size=Size('300g'))
d891b6
-        sdc = DiskDevice("sdc", size=Size('300G'))
d891b6
+        sda = DiskDevice("sda", size=Size('300g'), exists=False)
d891b6
+        sdb = DiskDevice("sdb", size=Size('300g'), exists=False)
d891b6
+        sdc = DiskDevice("sdc", size=Size('300G'), exists=False)
d891b6
 
d891b6
         tree._add_device(sda)
d891b6
         tree._add_device(sdb)
d891b6
-- 
d891b6
2.34.3
d891b6