From 0286e1f0c2a1986c323b9c6a68dc6e106dcebd26 Mon Sep 17 00:00:00 2001
From: zhouyihang <zhouyihang3@h-partners.com>
Date: Thu, 28 Sep 2023 11:14:18 +0800
Subject: [PATCH] skip brtfs raid test if no support

---
 tests/blivetgui_tests/add_dialog_test.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/blivetgui_tests/add_dialog_test.py b/tests/blivetgui_tests/add_dialog_test.py
index 93d89ec..dd9ff09 100644
--- a/tests/blivetgui_tests/add_dialog_test.py
+++ b/tests/blivetgui_tests/add_dialog_test.py
@@ -10,6 +10,7 @@ import os
 
 from blivet.size import Size
 from blivet import formats
+from blivet import devicefactory
 from blivet.devicelibs import raid
 
 
@@ -349,6 +350,9 @@ class AddDialogTest(unittest.TestCase):
         self.assertTrue(add_dialog.size_area.get_sensitive())
 
     def test_btrfsvolume_widgets(self):
+        btrfs_raid_level=devicefactory.get_supported_raid_levels(devicefactory.DEVICE_TYPE_BTRFS)
+        if not len(btrfs_raid_level):
+            self.skipTest("No supported raid level of btrfs found")
         parent_device = self._get_parent_device()
         free_device = self._get_free_device(parent=parent_device)
 
@@ -760,6 +764,9 @@ class AddDialogTest(unittest.TestCase):
         self.assertEqual(selection.raid_level, raidtype)
 
     def test_btrfs_selection(self):
+        btrfs_raid_level=devicefactory.get_supported_raid_levels(devicefactory.DEVICE_TYPE_BTRFS)
+        if not len(btrfs_raid_level):
+            self.skipTest("No supported raid level of btrfs found")
         parent_device = self._get_parent_device()
         free_device = self._get_free_device(parent=parent_device, size=Size("8 GiB"), is_free_region=False,
                                             is_empty_disk=True)
-- 
2.27.0

