diff --git a/service/lib/agama/storage/config_checkers/alias.rb b/service/lib/agama/storage/config_checkers/alias.rb index a6d9b9ce18..fc71742b85 100644 --- a/service/lib/agama/storage/config_checkers/alias.rb +++ b/service/lib/agama/storage/config_checkers/alias.rb @@ -72,7 +72,7 @@ def overused_alias_issue error( format(_("The device with alias '%s' is used by more than one device"), config.alias), - kind: IssueClasses::Config::ALIAS + kind: IssueClasses::Config::OVERUSED_DEVICE ) end @@ -98,7 +98,7 @@ def formatted_issue ), config.alias ), - kind: IssueClasses::Config::OVERUSED + kind: IssueClasses::Config::OVERUSED_DEVICE ) end @@ -122,7 +122,7 @@ def partitioned_issue ), config.alias ), - kind: IssueClasses::Config::OVERUSED + kind: IssueClasses::Config::OVERUSED_DEVICE ) end end diff --git a/service/lib/agama/storage/config_checkers/boot.rb b/service/lib/agama/storage/config_checkers/boot.rb index 98fc16047c..b7a04bf24e 100644 --- a/service/lib/agama/storage/config_checkers/boot.rb +++ b/service/lib/agama/storage/config_checkers/boot.rb @@ -84,7 +84,7 @@ def invalid_alias_issue # TRANSLATORS: %s is replaced by a device alias (e.g., "boot"). error( format(_("There is no boot device with alias '%s'"), device_alias), - kind: IssueClasses::Config::ALIAS + kind: IssueClasses::Config::NO_SUCH_ALIAS ) end diff --git a/service/lib/agama/storage/config_checkers/encryption.rb b/service/lib/agama/storage/config_checkers/encryption.rb index 24b5bcb33e..f0e356671c 100644 --- a/service/lib/agama/storage/config_checkers/encryption.rb +++ b/service/lib/agama/storage/config_checkers/encryption.rb @@ -62,11 +62,6 @@ def encryption config.encryption end - # @see Base - def error(message) - super(message, kind: IssueClasses::Config::ENCRYPTION) - end - # @return [Issue, nil] def missing_password_issue return unless encryption.missing_password? @@ -77,7 +72,8 @@ def missing_password_issue # (e.g., 'luks1', 'random_swap'). _("No passphrase provided (required for using the method '%{crypt_method}')."), crypt_method: encryption.method.to_human_string - ) + ), + kind: IssueClasses::Config::NO_ENCRYPTION_PASSPHRASE ) end @@ -92,7 +88,8 @@ def unavailable_method_issue # (e.g., 'luks1', 'random_swap'). _("Encryption method '%{crypt_method}' is not available in this system."), crypt_method: method.to_human_string - ) + ), + kind: IssueClasses::Config::WRONG_ENCRYPTION_METHOD ) end @@ -119,7 +116,8 @@ def wrong_method_issue # (e.g., 'luks1', 'random_swap'). _("'%{crypt_method}' is not a suitable method to encrypt the device."), crypt_method: method.to_human_string - ) + ), + kind: IssueClasses::Config::WRONG_ENCRYPTION_METHOD ) end end diff --git a/service/lib/agama/storage/config_checkers/filesystem.rb b/service/lib/agama/storage/config_checkers/filesystem.rb index d67d067fff..1b8fc67646 100644 --- a/service/lib/agama/storage/config_checkers/filesystem.rb +++ b/service/lib/agama/storage/config_checkers/filesystem.rb @@ -65,18 +65,16 @@ def filesystem config.filesystem end - # @see Base - def error(message) - super(message, kind: IssueClasses::Config::FILESYSTEM) - end - # @return [Issue, nil] def missing_filesystem_issue return if filesystem.reuse? return if filesystem.type&.fs_type # TRANSLATORS: %s is replaced by a mount path (e.g., "/home"). - error(format(_("Missing file system type for '%s'"), filesystem.path)) + error( + format(_("Missing file system type for '%s'"), filesystem.path), + kind: IssueClasses::Config::NO_FILESYSTEM_TYPE + ) end # @return [Issue, nil] @@ -100,7 +98,8 @@ def invalid_filesystem_issue _("The file system type '%{filesystem}' is not suitable for '%{path}'"), filesystem: type.to_human_string, path: path - ) + ), + kind: IssueClasses::Config::WRONG_FILESYSTEM_TYPE ) end diff --git a/service/lib/agama/storage/config_checkers/filesystems.rb b/service/lib/agama/storage/config_checkers/filesystems.rb index e30da53f48..e58f0edbe0 100644 --- a/service/lib/agama/storage/config_checkers/filesystems.rb +++ b/service/lib/agama/storage/config_checkers/filesystems.rb @@ -70,7 +70,7 @@ def missing_paths_issue ), missing_paths.join(", ") ), - kind: IssueClasses::Config::REQUIRED_PATHS + kind: IssueClasses::Config::MISSING_PATHS ) end diff --git a/service/lib/agama/storage/config_checkers/logical_volume.rb b/service/lib/agama/storage/config_checkers/logical_volume.rb index 2136ff615a..accc0a4411 100644 --- a/service/lib/agama/storage/config_checkers/logical_volume.rb +++ b/service/lib/agama/storage/config_checkers/logical_volume.rb @@ -80,7 +80,7 @@ def missing_thin_pool_issue error( # TRANSLATORS: %s is the replaced by a device alias (e.g., "pv1"). format(_("There is no LVM thin pool volume with alias '%s'"), config.used_pool), - kind: IssueClasses::Config::ALIAS + kind: IssueClasses::Config::NO_SUCH_ALIAS ) end end diff --git a/service/lib/agama/storage/config_checkers/md_raid.rb b/service/lib/agama/storage/config_checkers/md_raid.rb index 3e2bbcb6d8..6988d88463 100644 --- a/service/lib/agama/storage/config_checkers/md_raid.rb +++ b/service/lib/agama/storage/config_checkers/md_raid.rb @@ -96,7 +96,7 @@ def missing_device_issue(device_alias) error( # TRANSLATORS: %s is the replaced by a device alias (e.g., "md1"). format(_("There is no MD RAID member device with alias '%s'"), device_alias), - kind: IssueClasses::Config::ALIAS + kind: IssueClasses::Config::NO_SUCH_ALIAS ) end @@ -107,7 +107,10 @@ def level_issue return if config.level return unless config.create? - error(format(_("There is a MD RAID without level")), kind: IssueClasses::Config::MD_RAID) + error( + format(_("There is a MD RAID without level")), + kind: IssueClasses::Config::NO_RAID_LEVEL + ) end # Issue if the MD RAID does not contain enough member devices. @@ -119,7 +122,7 @@ def devices_size_issue error( format(_("At least %s devices are required for %s"), config.min_devices, config.level), - kind: IssueClasses::Config::MD_RAID + kind: IssueClasses::Config::WRONG_RAID_MEMBERS ) end @@ -174,7 +177,7 @@ def deleted_reused_member_issue(member_config) member: member_config.found_device.name, md_raid: config.found_device.name ), - kind: IssueClasses::Config::OVERUSED_MD_MEMBER + kind: IssueClasses::Config::MISUSED_MD_MEMBER ) end @@ -197,7 +200,7 @@ def resized_reused_member_issue(member_config) member: member_config.found_device.name, md_raid: config.found_device.name ), - kind: IssueClasses::Config::OVERUSED_MD_MEMBER + kind: IssueClasses::Config::MISUSED_MD_MEMBER ) end @@ -220,7 +223,7 @@ def formatted_reused_member_issue(member_config) member: member_config.found_device.name, md_raid: config.found_device.name ), - kind: IssueClasses::Config::OVERUSED_MD_MEMBER + kind: IssueClasses::Config::MISUSED_MD_MEMBER ) end @@ -243,7 +246,7 @@ def partitioned_reused_member_issue(member_config) member: member_config.found_device.name, md_raid: config.found_device.name ), - kind: IssueClasses::Config::OVERUSED_MD_MEMBER + kind: IssueClasses::Config::MISUSED_MD_MEMBER ) end @@ -265,7 +268,7 @@ def target_reused_member_issue(member_config) member: member_config.found_device.name, md_raid: config.found_device.name ), - kind: IssueClasses::Config::OVERUSED_MD_MEMBER + kind: IssueClasses::Config::MISUSED_MD_MEMBER ) end @@ -290,7 +293,7 @@ def parent_reused_member_issue(device) device: parent_config.found_device.name, md_raid: config.found_device.name ), - kind: IssueClasses::Config::OVERUSED_MD_MEMBER + kind: IssueClasses::Config::MISUSED_MD_MEMBER ) end diff --git a/service/lib/agama/storage/config_checkers/physical_volumes_encryption.rb b/service/lib/agama/storage/config_checkers/physical_volumes_encryption.rb index 35d408bb8a..16bd068d98 100644 --- a/service/lib/agama/storage/config_checkers/physical_volumes_encryption.rb +++ b/service/lib/agama/storage/config_checkers/physical_volumes_encryption.rb @@ -60,7 +60,8 @@ def wrong_method_issue # (e.g., 'luks1'). _("'%{method}' is not a suitable method to encrypt the physical volumes."), method: method.to_human_string - ) + ), + kind: IssueClasses::Config::WRONG_ENCRYPTION_METHOD ) end diff --git a/service/lib/agama/storage/config_checkers/search.rb b/service/lib/agama/storage/config_checkers/search.rb index 045bc375d4..c914a65c28 100644 --- a/service/lib/agama/storage/config_checkers/search.rb +++ b/service/lib/agama/storage/config_checkers/search.rb @@ -62,7 +62,7 @@ def search # @see Base def error(message) - super(message, kind: IssueClasses::Config::SEARCH) + super(message, kind: IssueClasses::Config::SEARCH_NOT_FOUND) end # @return [Issue, nil] diff --git a/service/lib/agama/storage/config_checkers/volume_group.rb b/service/lib/agama/storage/config_checkers/volume_group.rb index 9a0746b921..65ab6ef145 100644 --- a/service/lib/agama/storage/config_checkers/volume_group.rb +++ b/service/lib/agama/storage/config_checkers/volume_group.rb @@ -73,7 +73,10 @@ def issues def name_issue return if config.name && !config.name.empty? - error(_("There is a volume group without name"), kind: IssueClasses::Config::LVM) + error( + _("There is a volume group without name"), + kind: IssueClasses::Config::NO_VOLUME_GROUP_NAME + ) end # Issues from logical volumes. @@ -104,7 +107,7 @@ def missing_physical_volume_issue(pv_alias) error( # TRANSLATORS: %s is the replaced by a device alias (e.g., "pv1"). format(_("There is no LVM physical volume with alias '%s'"), pv_alias), - kind: IssueClasses::Config::ALIAS + kind: IssueClasses::Config::NO_SUCH_ALIAS ) end @@ -136,7 +139,7 @@ def incompatible_physical_volumes_devices_issue ), config.name ), - kind: IssueClasses::Config::LVM + kind: IssueClasses::Config::INCOMPATIBLE_PV_TARGETS ) end @@ -153,7 +156,7 @@ def missing_physical_volumes_device_issue(device_alias) _("There is no target device for LVM physical volumes with alias '%s'"), device_alias ), - kind: IssueClasses::Config::ALIAS + kind: IssueClasses::Config::NO_SUCH_ALIAS ) end diff --git a/service/lib/agama/storage/issue_classes.rb b/service/lib/agama/storage/issue_classes.rb index efc2babbb9..87edb9a472 100644 --- a/service/lib/agama/storage/issue_classes.rb +++ b/service/lib/agama/storage/issue_classes.rb @@ -23,44 +23,55 @@ module Agama module Storage # Module to declare all the known issue classes from the storage scope module IssueClasses - # Generic issue found when calculating the proposal + # It was not possible to accommodate the requested devices PROPOSAL = :proposal # Issue classes related to the configuration provided by the user module Config - # Generic issue with encryption settings - ENCRYPTION = :configEncryption + # A device is used for several incompatible purposes + OVERUSED_DEVICE = :configOverusedDevice - # Generic issue with filesystem settings - FILESYSTEM = :configFilesystem + # A device is used by several volume groups as a target for generating PVs + OVERUSED_PV_TARGET = :configOverusedPvTarget - # Generic issue defining LVM (eg. no volume group name) - LVM = :configLvm + # A device that is part of a reused RAID is chosen to be used with other purpose + MISUSED_MD_MEMBER = :configMisusedMdMember - # Generic issue defining Md RAIDs (eg. no level) - MD_RAID = :configMdRaid + # Reused and new devices are both used as target for generating PVs for the same LV + INCOMPATIBLE_PV_TARGETS = :configIncompatiblePvTargets # No root filesystem was defined - NO_ROOT = :configNoRoot - - # Issue with aliases (eg. same alias defined twice or referencing a non-existent alias) - ALIAS = :configAlias + NO_ROOT = :configNoRoot - # A mandatory separate filesystem is missing in the configuration - REQUIRED_PATHS = :configRequiredPaths + # The referenced alias does not exist in the context it was expected + NO_SUCH_ALIAS = :configNoSuchAlias # The device specified in a 'search' was not found - SEARCH = :configSearch + SEARCH_NOT_FOUND = :configSearchNotFound - # Generic issue when a single device is used for several incompatible purposes - # (eg. to be formatted and also to be an LVM physical volume) - OVERUSED = :configOverused + # A passphrase is required for the encryption but it was not provided + NO_ENCRYPTION_PASSPHRASE = :configNoEncryptionPassphrase - # A device is used by several volume groups as a target for generating PVs - OVERUSED_PV_TARGET = :configOverusedPvTarget + # The specified encryption method cannot be used + WRONG_ENCRYPTION_METHOD = :configWrongEncryptionMethod + + # A filesystem type is required but it was not specified + NO_FILESYSTEM_TYPE = :configNoFilesystemType + + # The specified filesystem type is not suitable for that mount path + WRONG_FILESYSTEM_TYPE = :configWrongFilesystemType + + # One or several mandatory separate filesystems are missing in the configuration + MISSING_PATHS = :configMissingPaths + + # No level was defined for a new MD RAID + NO_RAID_LEVEL = :configNoRaidLevel + + # The number of members for a new RAID is not compatible with the chosen level + WRONG_RAID_MEMBERS = :configNoRaidMembers - # A device is part of a RAID and also chosen for an incompatible purpose - OVERUSED_MD_MEMBER = :configOverusedMdMember + # No name was specified for a new LVM volume group + NO_VOLUME_GROUP_NAME = :configNoVolumeGroupName end end end diff --git a/service/test/agama/storage/config_checker_test.rb b/service/test/agama/storage/config_checker_test.rb index 7720e42694..b0fb9123ef 100644 --- a/service/test/agama/storage/config_checker_test.rb +++ b/service/test/agama/storage/config_checker_test.rb @@ -74,7 +74,7 @@ it "includes the drive issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::SEARCH, + kind: Agama::Storage::IssueClasses::Config::SEARCH_NOT_FOUND, description: "Mandatory device /dev/vda not found" ) end @@ -94,7 +94,7 @@ it "includes the partition issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::FILESYSTEM, + kind: Agama::Storage::IssueClasses::Config::NO_FILESYSTEM_TYPE, description: "Missing file system type for '/'" ) end @@ -110,7 +110,7 @@ it "includes the MD RAID issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::NO_SUCH_ALIAS, description: /no MD RAID member device with alias 'disk1'/ ) end @@ -130,7 +130,7 @@ it "includes the partition issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::FILESYSTEM, + kind: Agama::Storage::IssueClasses::Config::NO_FILESYSTEM_TYPE, description: "Missing file system type for '/'" ) end @@ -165,7 +165,7 @@ it "includes the logical volume issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::FILESYSTEM, + kind: Agama::Storage::IssueClasses::Config::NO_FILESYSTEM_TYPE, description: "Missing file system type for '/'" ) end @@ -203,7 +203,7 @@ it "includes an issue for the missing mount path" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::REQUIRED_PATHS, + kind: Agama::Storage::IssueClasses::Config::MISSING_PATHS, description: /file system for \/ is/ ) end @@ -211,7 +211,7 @@ it "does not include an issue for the present mount path" do issues = subject.issues expect(issues).to_not include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::REQUIRED_PATHS, + kind: Agama::Storage::IssueClasses::Config::MISSING_PATHS, description: /file system for swap/ ) end diff --git a/service/test/agama/storage/config_checkers/alias_test.rb b/service/test/agama/storage/config_checkers/alias_test.rb index e3aaf226e1..063e8caf74 100644 --- a/service/test/agama/storage/config_checkers/alias_test.rb +++ b/service/test/agama/storage/config_checkers/alias_test.rb @@ -26,7 +26,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::OVERUSED_DEVICE, description: /alias '#{device_alias}' is used by more than one/ ) end @@ -145,7 +145,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::OVERUSED, + kind: Agama::Storage::IssueClasses::Config::OVERUSED_DEVICE, description: /alias '#{device_alias}' cannot be formatted because it is used/ ) end @@ -220,7 +220,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::OVERUSED, + kind: Agama::Storage::IssueClasses::Config::OVERUSED_DEVICE, description: /alias '#{device_alias}' cannot be partitioned because it is used/ ) end diff --git a/service/test/agama/storage/config_checkers/boot_test.rb b/service/test/agama/storage/config_checkers/boot_test.rb index 9d6d717f56..a28d1d4aed 100644 --- a/service/test/agama/storage/config_checkers/boot_test.rb +++ b/service/test/agama/storage/config_checkers/boot_test.rb @@ -51,7 +51,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::NO_SUCH_ALIAS, description: /There is no boot device with alias '.*'/ ) end diff --git a/service/test/agama/storage/config_checkers/encryption_test.rb b/service/test/agama/storage/config_checkers/encryption_test.rb index bba8207844..4e758774e8 100644 --- a/service/test/agama/storage/config_checkers/encryption_test.rb +++ b/service/test/agama/storage/config_checkers/encryption_test.rb @@ -54,7 +54,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION, + kind: Agama::Storage::IssueClasses::Config::NO_ENCRYPTION_PASSPHRASE, description: /No passphrase/ ) end @@ -78,7 +78,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION, + kind: Agama::Storage::IssueClasses::Config::WRONG_ENCRYPTION_METHOD, description: /'Pervasive Volume Encryption' is not available/ ) end @@ -102,7 +102,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION, + kind: Agama::Storage::IssueClasses::Config::WRONG_ENCRYPTION_METHOD, description: /'TPM-Based Full Disk Encrytion' is not available/ ) end @@ -121,7 +121,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION, + kind: Agama::Storage::IssueClasses::Config::WRONG_ENCRYPTION_METHOD, description: /'Encryption with Volatile Protected Key' is not a suitable/ ) end diff --git a/service/test/agama/storage/config_checkers/examples.rb b/service/test/agama/storage/config_checkers/examples.rb index ac0d6798f4..7858d13155 100644 --- a/service/test/agama/storage/config_checkers/examples.rb +++ b/service/test/agama/storage/config_checkers/examples.rb @@ -31,7 +31,7 @@ it "includes the search issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::SEARCH, + kind: Agama::Storage::IssueClasses::Config::SEARCH_NOT_FOUND, description: "Mandatory device /test not found" ) end @@ -47,7 +47,7 @@ it "includes the filesystem issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::FILESYSTEM, + kind: Agama::Storage::IssueClasses::Config::NO_FILESYSTEM_TYPE, description: "Missing file system type for '/'" ) end @@ -63,7 +63,7 @@ it "includes the encryption issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION, + kind: Agama::Storage::IssueClasses::Config::NO_ENCRYPTION_PASSPHRASE, description: /No passphrase .*/ ) end @@ -85,7 +85,7 @@ it "includes the partition issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::SEARCH, + kind: Agama::Storage::IssueClasses::Config::SEARCH_NOT_FOUND, description: "Mandatory partition not found" ) end @@ -106,7 +106,7 @@ it "includes the alias issues" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::OVERUSED_DEVICE, description: /alias '#{device_alias}' is used by more than one/ ) end diff --git a/service/test/agama/storage/config_checkers/filesystem_test.rb b/service/test/agama/storage/config_checkers/filesystem_test.rb index caa1f800df..f38d1281ff 100644 --- a/service/test/agama/storage/config_checkers/filesystem_test.rb +++ b/service/test/agama/storage/config_checkers/filesystem_test.rb @@ -53,7 +53,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::FILESYSTEM, + kind: Agama::Storage::IssueClasses::Config::WRONG_FILESYSTEM_TYPE, description: /type 'FAT' is not suitable for '\/'/ ) end @@ -95,7 +95,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::FILESYSTEM, + kind: Agama::Storage::IssueClasses::Config::NO_FILESYSTEM_TYPE, description: /Missing file system type for '\/'/ ) end diff --git a/service/test/agama/storage/config_checkers/logical_volume_test.rb b/service/test/agama/storage/config_checkers/logical_volume_test.rb index 5f0a64e445..b2023c8298 100644 --- a/service/test/agama/storage/config_checkers/logical_volume_test.rb +++ b/service/test/agama/storage/config_checkers/logical_volume_test.rb @@ -64,7 +64,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::NO_SUCH_ALIAS, description: /no LVM thin pool/ ) end @@ -76,7 +76,7 @@ it "does not include an issue" do issues = subject.issues expect(issues).to_not include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::NO_SUCH_ALIAS, description: /no LVM thin pool/ ) end diff --git a/service/test/agama/storage/config_checkers/md_raid_test.rb b/service/test/agama/storage/config_checkers/md_raid_test.rb index 8e90a5634a..bd83dc4209 100644 --- a/service/test/agama/storage/config_checkers/md_raid_test.rb +++ b/service/test/agama/storage/config_checkers/md_raid_test.rb @@ -76,7 +76,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::MD_RAID, + kind: Agama::Storage::IssueClasses::Config::NO_RAID_LEVEL, description: /MD RAID without level/ ) end @@ -93,7 +93,7 @@ it "does not include the issue" do issues = subject.issues expect(issues).to_not include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::MD_RAID + kind: Agama::Storage::IssueClasses::Config::NO_RAID_LEVEL ) end end @@ -108,7 +108,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::MD_RAID, + kind: Agama::Storage::IssueClasses::Config::WRONG_RAID_MEMBERS, description: "At least 2 devices are required for raid0" ) end @@ -120,7 +120,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::NO_SUCH_ALIAS, description: /no MD RAID member device with alias 'disk2'/ ) end @@ -153,7 +153,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::OVERUSED_MD_MEMBER, + kind: Agama::Storage::IssueClasses::Config::MISUSED_MD_MEMBER, description: /.*vda.*cannot be formatted.*part of.*md0/ ) end @@ -171,7 +171,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::OVERUSED_MD_MEMBER, + kind: Agama::Storage::IssueClasses::Config::MISUSED_MD_MEMBER, description: /.*vda.*cannot be partitioned.*part of.*md0/ ) end @@ -189,7 +189,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::OVERUSED_MD_MEMBER, + kind: Agama::Storage::IssueClasses::Config::MISUSED_MD_MEMBER, description: /.*vda.*cannot be used.*part of.*md0/ ) end @@ -215,7 +215,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::OVERUSED_MD_MEMBER, + kind: Agama::Storage::IssueClasses::Config::MISUSED_MD_MEMBER, description: /.*vda1.*cannot be deleted.*part of.*md0/ ) end @@ -241,7 +241,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::OVERUSED_MD_MEMBER, + kind: Agama::Storage::IssueClasses::Config::MISUSED_MD_MEMBER, description: /.*vda1.*cannot be resized.*part of.*md0/ ) end @@ -263,7 +263,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::OVERUSED_MD_MEMBER, + kind: Agama::Storage::IssueClasses::Config::MISUSED_MD_MEMBER, description: /.*vda.*cannot be formatted.*part of.*md0/ ) end diff --git a/service/test/agama/storage/config_checkers/search_test.rb b/service/test/agama/storage/config_checkers/search_test.rb index a3303c2d86..f4fa6fd328 100644 --- a/service/test/agama/storage/config_checkers/search_test.rb +++ b/service/test/agama/storage/config_checkers/search_test.rb @@ -52,7 +52,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::SEARCH, + kind: Agama::Storage::IssueClasses::Config::SEARCH_NOT_FOUND, description: "Mandatory drive not found" ) end diff --git a/service/test/agama/storage/config_checkers/volume_group_test.rb b/service/test/agama/storage/config_checkers/volume_group_test.rb index c11b4146f0..e267b7b596 100644 --- a/service/test/agama/storage/config_checkers/volume_group_test.rb +++ b/service/test/agama/storage/config_checkers/volume_group_test.rb @@ -64,7 +64,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::NO_SUCH_ALIAS, description: /no LVM physical volume with alias 'pv1'/ ) end @@ -84,7 +84,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ALIAS, + kind: Agama::Storage::IssueClasses::Config::NO_SUCH_ALIAS, description: /no target device for LVM physical volumes with alias 'second-disk'/ ) end @@ -110,7 +110,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION, + kind: Agama::Storage::IssueClasses::Config::NO_ENCRYPTION_PASSPHRASE, description: /No passphrase/ ) end @@ -134,7 +134,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION, + kind: Agama::Storage::IssueClasses::Config::WRONG_ENCRYPTION_METHOD, description: /'Regular LUKS2' is not available/ ) end @@ -146,7 +146,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION, + kind: Agama::Storage::IssueClasses::Config::WRONG_ENCRYPTION_METHOD, description: /'Encryption with Volatile Random Key' is not a suitable method/ ) end @@ -164,7 +164,10 @@ it "does not include an encryption issue" do issues = subject.issues expect(issues).to_not include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::ENCRYPTION + kind: Agama::Storage::IssueClasses::Config::NO_ENCRYPTION_PASSPHRASE + ) + expect(issues).to_not include an_object_having_attributes( + kind: Agama::Storage::IssueClasses::Config::WRONG_ENCRYPTION_METHOD ) end end @@ -221,7 +224,7 @@ it "includes the expected issue" do issues = subject.issues expect(issues).to include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::LVM, + kind: Agama::Storage::IssueClasses::Config::INCOMPATIBLE_PV_TARGETS, description: /'system' is mixing reused devices and new devices/ ) end @@ -233,7 +236,7 @@ it "does not include an incompatible targets issue" do issues = subject.issues expect(issues).to_not include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::LVM + kind: Agama::Storage::IssueClasses::Config::INCOMPATIBLE_PV_TARGETS ) end end @@ -244,7 +247,7 @@ it "does not include an incompatible targets issue" do issues = subject.issues expect(issues).to_not include an_object_having_attributes( - kind: Agama::Storage::IssueClasses::Config::LVM + kind: Agama::Storage::IssueClasses::Config::INCOMPATIBLE_PV_TARGETS ) end end diff --git a/web/src/components/storage/ProposalPage.tsx b/web/src/components/storage/ProposalPage.tsx index 8ef3d31382..429138a83c 100644 --- a/web/src/components/storage/ProposalPage.tsx +++ b/web/src/components/storage/ProposalPage.tsx @@ -274,9 +274,9 @@ function ProposalPageContent(): React.ReactNode { const fixable = [ "configNoRoot", - "configRequiredPaths", + "configMissingPaths", "configOverusedPvTarget", - "configOverusedMdMember", + "configMisusedMdMember", "proposal", ]; const configIssues = issues.filter((i) => i.class !== "proposal");