|
17 | 17 | # You should have received a copy of the GNU Lesser General Public License |
18 | 18 | # along with Cockpit; If not, see <https://www.gnu.org/licenses/>. |
19 | 19 |
|
| 20 | +from os import getenv |
20 | 21 | from sys import stderr |
21 | 22 |
|
22 | 23 | import storagelib |
@@ -53,8 +54,10 @@ class TestStorageSmart(storagelib.StorageSmartCase): |
53 | 54 | b.wait_in_text(self.card_desc("Device health (SMART)", "Self-test status"), status) |
54 | 55 | if bad_sectors is not None: |
55 | 56 | b.wait_in_text(self.card_desc("Device health (SMART)", "Number of bad sectors"), bad_sectors) |
| 57 | + b.wait_visible(self.card_desc("Device health (SMART)", "Number of bad sectors") + " .pf-m-warning") |
56 | 58 | if failing_attrs is not None: |
57 | 59 | b.wait_in_text(self.card_desc("Device health (SMART)", "Attributes failing"), failing_attrs) |
| 60 | + b.wait_visible(self.card_desc("Device health (SMART)", "Attributes failing") + " .pf-m-warning") |
58 | 61 |
|
59 | 62 | m = self.machine |
60 | 63 | b = self.browser |
@@ -82,17 +85,27 @@ class TestStorageSmart(storagelib.StorageSmartCase): |
82 | 85 | set_smart_dump("INTEL_SSDSA2MH080G1GC--045C8820", "/dev/sda") |
83 | 86 | check_smart_info("Disk is OK", "2309 hours", "Interrupted") |
84 | 87 |
|
85 | | - # Aborted self test and has known bad sector |
| 88 | + # latest libblockdev builds from copr have different behavior when assessing disk as failed |
| 89 | + is_nightly_scenario = "daily" in getenv("TEST_SCENARIO", "") |
| 90 | + |
| 91 | + # Aborted self test and has known bad sector (overall assessment is still OK) |
86 | 92 | set_smart_dump("ST9160821AS--3.CLH", "/dev/sda") |
87 | | - check_smart_info("Disk is failing", "556 hours", "Aborted", bad_sectors="1") |
| 93 | + if is_nightly_scenario: |
| 94 | + check_smart_info("Disk is OK", "556 hours", "Aborted", bad_sectors="1") |
| 95 | + else: |
| 96 | + check_smart_info("Disk is failing", "556 hours", "Aborted", bad_sectors="1") |
88 | 97 |
|
89 | 98 | # Multiple bad sectors |
90 | 99 | set_smart_dump("Maxtor_96147H8--BAC51KJ0", "/dev/sda") |
91 | | - check_smart_info("Disk is failing", "2016 hours", "Successful", bad_sectors="71") |
| 100 | + if is_nightly_scenario: |
| 101 | + check_smart_info("Disk is OK", "2016 hours", "Successful", bad_sectors="71") |
| 102 | + else: |
| 103 | + check_smart_info("Disk is failing", "2016 hours", "Successful", bad_sectors="71") |
92 | 104 |
|
93 | 105 | # Multiple bad sectors with failing attribute |
94 | 106 | set_smart_dump("Maxtor_96147H8--BAC51KJ0--2", "/dev/sda") |
95 | 107 | check_smart_info("Disk is failing", "2262 hours", "Successful", bad_sectors="71", failing_attrs="1") |
| 108 | + b.wait_visible(self.card_desc("Device health (SMART)", "Assessment") + " .pf-m-danger") |
96 | 109 |
|
97 | 110 | # Check that SMART card is not visible on DVD drive |
98 | 111 | b.go("/storage") |
|
0 commit comments