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