Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test improvements re Disk miss-attribution to ROOT pool #2828 #2829

Conversation

phillxnet
Copy link
Member

Revive/fix prior test_root_disk() awaiting now completed Py3.11 transition. Add test data to test_root_disk() re root on sdag4 dev. Add reproducer test for ROOT on sdag4 with sda as a data pool drive, where a failure was reported to properly label the root device, and a miss-attribution of sda to the ROOT pool was reported within the Web-UI.

Includes a minimum reproducer test. The full real-system command output derived test is maintained as it represents a typical larger disk count install (36). And so may help in future assertions of intended behaviour.

Fixes #2828

…#2828

Revive/fix prior test_root_disk() awaiting now completed Py3.11 transition.
Add test data to test_root_disk() re root on sdag4 dev.
Add reproducer test for ROOT on sdag4 with sda as a data pool drive, where
a failure was reported to properly label the root device, and a
miss-attribution of sda to the ROOT pool was reported within the Web-UI.

Includes a minimum reproducer test. The full real-system command output
derived test is maintained as it represents a typical larger disk count
install (36). And so may help in future assertions of intended behaviour.
@phillxnet
Copy link
Member Author

phillxnet commented Apr 3, 2024

This PR, as a unit test reproducer of an observed failure, introduces the following intended breaking changes for our rpmbuild %check scriptlet:

======================================================================
FAIL: test_scan_disks_root_miss_attribution (rockstor.system.tests.test_osi.OSITests.test_scan_disks_root_miss_attribution)
Miss-attribution of a data drive to the ROOT pool.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/rockstor-buildbot/worker/Poetry-Build-on-Leap15-5/rpmbuild/rockstor-core-5.0.8-2829/src/rockstor/system/tests/test_osi.py", line 3227, in test_scan_disks_root_miss_attribution
    self.assertEqual(
AssertionError: Lists differ: [Disk[482 chars]rted=True, root=False, partitions={'sdag4': 'b[8738 chars]={})] != [Disk[482 chars]rted=False, root=False, partitions={}), Disk(n[8707 chars]={})]
First differing element 1:
Disk([206 chars]65282', parted=True, root=False, partitions={'sdag4': 'btrfs'})
Disk([206 chars]65282', parted=False, root=False, partitions={})
  [Disk(name='nvme0n1', model='SHGP31-1000GM-2', serial='AS0BN60301030BE2O', size=976748544, transport='nvme', vendor=None, hctl=None, type='disk', fstype='btrfs', label='AppPool', uuid='2beebfa1-5ac3-4d2b-85ea-56225e0704ca', parted=False, root=False, partitions={}),
-  Disk(name='sda', model='WDC WD101EMAZ-11G7DA0', serial='VCGRX3EN', size=9771050598, transport='sas', vendor='ATA', hctl='0:0:1:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=True, root=False, partitions={'sdag4': 'btrfs'}),
?                                                                                                                                                                                                                                   -----------                    ----------------
+  Disk(name='sda', model='WDC WD101EMAZ-11G7DA0', serial='VCGRX3EN', size=9771050598, transport='sas', vendor='ATA', hctl='0:0:1:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
?                                                                                                                                                                                                                                           ++++++++++++
   Disk(name='sdaa', model='ST4000NM0043 E', serial='Z1ZANJ6J0000R631JFMH', size=3865470566, transport='sas', vendor='IBM-ESXS', hctl='0:0:27:0', type='disk', fstype='btrfs', label='NAS', uuid='dac090f1-48b8-40a7-b333-a9813541f09b', parted=False, root=False, partitions={}),
   Disk(name='sdab', model='HGST HUH721008ALE604', serial='7SGHEMVC', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:29:0', type='disk', fstype='btrfs', label='NasBackup', uuid='03c59913-ceb6-4b2a-9a27-62707a9dd73d', parted=False, root=False, partitions={}),
   Disk(name='sdac', model='HGST HUH721008ALE604', serial='7SH26E3C', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:28:0', type='disk', fstype='btrfs', label='ChiaPool', uuid='3effcc72-05a2-4394-b229-71042ac46956', parted=False, root=False, partitions={}),
   Disk(name='sdad', model='HGST HUH721008ALE604', serial='7SGZJV0C', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:30:0', type='disk', fstype='btrfs', label='NasBackup', uuid='03c59913-ceb6-4b2a-9a27-62707a9dd73d', parted=False, root=False, partitions={}),
   Disk(name='sdae', model='WDC WD140EDGZ-11B2DA2', serial='2CGLYKDN', size=13636521164, transport='sas', vendor='ATA', hctl='0:0:31:0', type='disk', fstype='btrfs', label='StorjPool', uuid='b8e4bea0-285d-460c-a8a3-816e00b596a8', parted=False, root=False, partitions={}),
   Disk(name='sdaf', model='CT500MX500SSD1', serial='1906E1E91E57', size=488426700, transport='sata', vendor='ATA', hctl='3:0:0:0', type='disk', fstype='btrfs', label='SSDPool', uuid='badb1a86-f340-406d-8ee0-162e3ec71140', parted=False, root=False, partitions={}),
-  Disk(name='sdag', model='PNY CS900 120GB SSD', serial='PNY0520228055010CFE7', size=115028787, transport='sata', vendor='ATA', hctl='6:0:0:0', type='disk', fstype='btrfs', label='ROOT', uuid='4ac51b0f-afeb-4946-aad1-975a2a26c941', parted=True, root=False, partitions={'sdag4': 'btrfs'}),
?                 ^^                                                                                                                                                                                                                                       ^^^^^^             ----------------
+  Disk(name='sdag4', model='PNY CS900 120GB SSD', serial='PNY0520228055010CFE7', size=115028787, transport='sata', vendor='ATA', hctl='6:0:0:0', type='disk', fstype='btrfs', label='ROOT', uuid='4ac51b0f-afeb-4946-aad1-975a2a26c941', parted=True, root=True, partitions={}),
?                 ^^^                                                                                                                                                                                                                                       ^^^^^
   Disk(name='sdah', model='CT500MX500SSD1', serial='1906E1E92271', size=488426700, transport='sata', vendor='ATA', hctl='10:0:0:0', type='disk', fstype='btrfs', label='SSDPool', uuid='badb1a86-f340-406d-8ee0-162e3ec71140', parted=False, root=False, partitions={}),
   Disk(name='sdb', model='WDC WD80EDAZ-11TA3A0', serial='VDKN848K', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:3:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdc', model='HUS72302CLAR2000', serial='YGKU60YK', size=1932735283, transport='sas', vendor='HITACHI', hctl='0:0:0:0', type='disk', fstype='btrfs', label='SASPool', uuid='b3fa44e0-0a6f-4193-a1cf-2d0f248a64a8', parted=False, root=False, partitions={}),
   Disk(name='sdd', model='WDC WD60EZRX-00MVLB1', serial='WD-WX31D847K0HJ', size=5905580032, transport='sas', vendor='ATA', hctl='0:0:2:0', type='disk', fstype=None, label=None, uuid=None, parted=False, root=False, partitions={}),
   Disk(name='sde', model='WDC WD80EDAZ-11TA3A0', serial='VDKN5U2K', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:4:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdf', model='WDC WD40EZRZ-00GXCB0', serial='WD-WCC7K4LZHN8U', size=3865470566, transport='sas', vendor='ATA', hctl='0:0:5:0', type='disk', fstype='btrfs', label='ExternalBackup', uuid='8c1423ff-78ec-4267-9d1c-e05268a60517', parted=False, root=False, partitions={}),
   Disk(name='sdg', model='ST4000VN008-2DR166', serial='ZGY03QJ9', size=3865470566, transport='sas', vendor='ATA', hctl='0:0:6:0', type='disk', fstype='btrfs', label='ExternalBackup', uuid='8c1423ff-78ec-4267-9d1c-e05268a60517', parted=False, root=False, partitions={}),
   Disk(name='sdh', model='ST4000VN008-2DR166', serial='ZGY03Q9C', size=3865470566, transport='sas', vendor='ATA', hctl='0:0:7:0', type='disk', fstype='btrfs', label='NAS', uuid='dac090f1-48b8-40a7-b333-a9813541f09b', parted=False, root=False, partitions={}),
   Disk(name='sdi', model='WDC WD40EZRZ-00GXCB0', serial='WD-WCC7K4HJ726U', size=3865470566, transport='sas', vendor='ATA', hctl='0:0:8:0', type='disk', fstype='btrfs', label='ExternalBackup', uuid='8c1423ff-78ec-4267-9d1c-e05268a60517', parted=False, root=False, partitions={}),
   Disk(name='sdj', model='WDC WD80EZZX-11CSGA0', serial='VK0TZU1Y', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:9:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdk', model='WDC WD80EZAZ-11TDBA0', serial='1EKB60VZ', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:10:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdl', model='WDC WD80EDAZ-11TA3A0', serial='VGH41NAG', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:11:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdm', model='WDC WD80EFAX-68LHPN0', serial='7SGL9JSC', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:12:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdn', model='WDC WD80EFAX-68LHPN0', serial='7SGJWGTC', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:13:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdo', model='WDC WD80EMAZ-00WJTA0', serial='2TJ0YATD', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:14:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdp', model='WDC WD80EZZX-11CSGA0', serial='VK0RGYTY', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:15:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
   Disk(name='sdq', model='ST10000NM0226', serial='ZA22Q7W00000C8115CNQ', size=9663676416, transport='sas', vendor='SEAGATE', hctl='0:0:17:0', type='disk', fstype='btrfs', label='SASPool', uuid='b3fa44e0-0a6f-4193-a1cf-2d0f248a64a8', parted=False, root=False, partitions={}),
   Disk(name='sdr', model='HUS72302CLAR2000', serial='YGKWMWKK', size=1932735283, transport='sas', vendor='HITACHI', hctl='0:0:18:0', type='disk', fstype='btrfs', label='SASPool', uuid='b3fa44e0-0a6f-4193-a1cf-2d0f248a64a8', parted=False, root=False, partitions={}),
   Disk(name='sds', model='HUS72302CLAR2000', serial='YFKVTMNK', size=1932735283, transport='sas', vendor='HITACHI', hctl='0:0:19:0', type='disk', fstype='btrfs', label='SASPool', uuid='b3fa44e0-0a6f-4193-a1cf-2d0f248a64a8', parted=False, root=False, partitions={}),
   Disk(name='sdt', model='HGST HUH721008ALE604', serial='7SH27T6C', size=7838315315, transport='sas', vendor='ATA', hctl='0:0:20:0', type='disk', fstype='btrfs', label='NasBackup', uuid='03c59913-ceb6-4b2a-9a27-62707a9dd73d', parted=False, root=False, partitions={}),
   Disk(name='sdu', model='ST4000NM0043 E', serial='Z1ZAY35T0000C643119P', size=3865470566, transport='sas', vendor='IBM-ESXS', hctl='0:0:21:0', type='disk', fstype='btrfs', label='NAS', uuid='dac090f1-48b8-40a7-b333-a9813541f09b', parted=False, root=False, partitions={}),
   Disk(name='sdv', model='ST4000DM000-1F2168', serial='Z300WT54', size=3865470566, transport='sas', vendor='ATA', hctl='0:0:22:0', type='disk', fstype='btrfs', label='NAS', uuid='dac090f1-48b8-40a7-b333-a9813541f09b', parted=False, root=False, partitions={}),
   Disk(name='sdw', model='HUS72302CLAR2000', serial='YFKY4LKK', size=1932735283, transport='sas', vendor='HITACHI', hctl='0:0:23:0', type='disk', fstype='btrfs', label='SASPool', uuid='b3fa44e0-0a6f-4193-a1cf-2d0f248a64a8', parted=False, root=False, partitions={}),
   Disk(name='sdx', model='WDC WD40EURX-64WRWY0', serial='WD-WCC4E1746586', size=3865470566, transport='sas', vendor='ATA', hctl='0:0:24:0', type='disk', fstype='btrfs', label='NAS', uuid='dac090f1-48b8-40a7-b333-a9813541f09b', parted=False, root=False, partitions={}),
   Disk(name='sdy', model='HGST HDS5C4040ALE630', serial='PL2331LAGGUHRJ', size=3865470566, transport='sas', vendor='ATA', hctl='0:0:25:0', type='disk', fstype='btrfs', label='NAS', uuid='dac090f1-48b8-40a7-b333-a9813541f09b', parted=False, root=False, partitions={}),
   Disk(name='sdz', model='ST10000NM0226', serial='ZA22YJMW0000C8022Q3X', size=9663676416, transport='sas', vendor='SEAGATE', hctl='0:0:26:0', type='disk', fstype='btrfs', label='SASPool', uuid='b3fa44e0-0a6f-4193-a1cf-2d0f248a64a8', parted=False, root=False, partitions={})] : sda data member & sdag4 ROOT member confusion regression:
 
======================================================================
FAIL: test_scan_disks_root_miss_attribution_min_reproducer (rockstor.system.tests.test_osi.OSITests.test_scan_disks_root_miss_attribution_min_reproducer)
Miss-attribution of a data drive to the ROOT pool.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/rockstor-buildbot/worker/Poetry-Build-on-Leap15-5/rpmbuild/rockstor-core-5.0.8-2829/src/rockstor/system/tests/test_osi.py", line 3308, in test_scan_disks_root_miss_attribution_min_reproducer
    self.assertEqual(
AssertionError: Lists differ: [Disk[217 chars]rted=True, root=False, partitions={'sdag4': 'b[290 chars]s'})] != [Disk[217 chars]rted=False, root=False, partitions={}), Disk(n[259 chars]={})]
First differing element 0:
Disk([206 chars]65282', parted=True, root=False, partitions={'sdag4': 'btrfs'})
Disk([206 chars]65282', parted=False, root=False, partitions={})
- [Disk(name='sda', model='WDC WD101EMAZ-11G7DA0', serial='VCGRX3EN', size=9771050598, transport='sas', vendor='ATA', hctl='0:0:1:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=True, root=False, partitions={'sdag4': 'btrfs'}),
?                                                                                                                                                                                                                                   -----------                    ----------------
+ [Disk(name='sda', model='WDC WD101EMAZ-11G7DA0', serial='VCGRX3EN', size=9771050598, transport='sas', vendor='ATA', hctl='0:0:1:0', type='disk', fstype='btrfs', label='JBOD', uuid='b86538f8-e447-48e5-84ec-b72a25c65282', parted=False, root=False, partitions={}),
?                                                                                                                                                                                                                                           ++++++++++++
-  Disk(name='sdag', model='PNY CS900 120GB SSD', serial='PNY0520228055010CFE7', size=115028787, transport='sata', vendor='ATA', hctl='6:0:0:0', type='disk', fstype='btrfs', label='ROOT', uuid='4ac51b0f-afeb-4946-aad1-975a2a26c941', parted=True, root=False, partitions={'sdag4': 'btrfs'})]
?                 ^^                                                                                                                                                                                                                                       ^^^^^^             ----------------
+  Disk(name='sdag4', model='PNY CS900 120GB SSD', serial='PNY0520228055010CFE7', size=115028787, transport='sata', vendor='ATA', hctl='6:0:0:0', type='disk', fstype='btrfs', label='ROOT', uuid='4ac51b0f-afeb-4946-aad1-975a2a26c941', parted=True, root=True, partitions={})]
?                 ^^^                                                                                                                                                                                                                                       ^^^^^
 : sda data member & sdag4 ROOT member confusion regression:
 
----------------------------------------------------------------------
Ran 282 tests in 30.968s
FAILED (failures=2)

Providing a basis for a proof of fix for the following linked issue:

where the following proposed modification of behaviour is intended to address this failure:

However the latter will require all related tests, including those added/modified by this PR, to be modified to represent the intended new behaviour. As such this PR is to be merged as a pre-requisite/dependency of #2824

@phillxnet phillxnet merged commit 6c6acb4 into rockstor:testing Apr 3, 2024
@phillxnet phillxnet deleted the 2828-Unit-test-improvements-re-Disk-miss-attribution-to-ROOT-pool branch April 3, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant