Hello community,
here is the log from the commit of package yast2-storage-ng for
openSUSE:Factory checked in at 2020-12-18 19:56:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-storage-ng (Old)
and /work/SRC/openSUSE:Factory/.yast2-storage-ng.new.5145 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-storage-ng"
Fri Dec 18 19:56:57 2020 rev:96 rq:856891 version:4.3.33
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-storage-ng/yast2-storage-ng.changes
2020-12-15 12:32:42.808112903 +0100
+++
/work/SRC/openSUSE:Factory/.yast2-storage-ng.new.5145/yast2-storage-ng.changes
2020-12-18 19:56:59.709909008 +0100
@@ -1,0 +2,28 @@
+Fri Dec 18 12:35:39 UTC 2020 - Imobach Gonzalez Sosa <[email protected]>
+
+- AutoYaST: setting the 'quotas' element to 'false' disables
+ subvolumes quotas, no matter whether the 'referenced_limit'
+ was specified or not (related to jsc#SLE-7742).
+- 4.3.33
+
+-------------------------------------------------------------------
+Thu Dec 17 11:31:34 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Fixed deletion of dependant devicegraph nodes (bsc#1179590)
+- 4.3.32
+
+-------------------------------------------------------------------
+Tue Dec 15 15:56:44 UTC 2020 - José Iván López González <[email protected]>
+
+- AutoYaST: added management of tmpfs file systems (jsc#SLE-11308).
+- 4.3.31
+
+-------------------------------------------------------------------
+Tue Dec 15 13:34:29 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Do not enforce installation of packages that are not strictly
+ needed (bsc#1065588).
+- Partitioner: improved calculation of which packages need to be
+ installed in the running system (bsc#1168077).
+
+-------------------------------------------------------------------
Old:
----
yast2-storage-ng-4.3.29.tar.bz2
New:
----
yast2-storage-ng-4.3.33.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-storage-ng.spec ++++++
--- /var/tmp/diff_new_pack.LdU9KN/_old 2020-12-18 19:57:00.289909628 +0100
+++ /var/tmp/diff_new_pack.LdU9KN/_new 2020-12-18 19:57:00.293909632 +0100
@@ -17,7 +17,7 @@
Name: yast2-storage-ng
-Version: 4.3.29
+Version: 4.3.33
Release: 0
Summary: YaST2 - Storage Configuration
License: GPL-2.0-only OR GPL-3.0-only
++++++ yast2-storage-ng-4.3.29.tar.bz2 -> yast2-storage-ng-4.3.33.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/package/yast2-storage-ng.changes
new/yast2-storage-ng-4.3.33/package/yast2-storage-ng.changes
--- old/yast2-storage-ng-4.3.29/package/yast2-storage-ng.changes
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/package/yast2-storage-ng.changes
2020-12-18 14:40:18.000000000 +0100
@@ -1,4 +1,32 @@
-------------------------------------------------------------------
+Fri Dec 18 12:35:39 UTC 2020 - Imobach Gonzalez Sosa <[email protected]>
+
+- AutoYaST: setting the 'quotas' element to 'false' disables
+ subvolumes quotas, no matter whether the 'referenced_limit'
+ was specified or not (related to jsc#SLE-7742).
+- 4.3.33
+
+-------------------------------------------------------------------
+Thu Dec 17 11:31:34 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Fixed deletion of dependant devicegraph nodes (bsc#1179590)
+- 4.3.32
+
+-------------------------------------------------------------------
+Tue Dec 15 15:56:44 UTC 2020 - José Iván López González <[email protected]>
+
+- AutoYaST: added management of tmpfs file systems (jsc#SLE-11308).
+- 4.3.31
+
+-------------------------------------------------------------------
+Tue Dec 15 13:34:29 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Do not enforce installation of packages that are not strictly
+ needed (bsc#1065588).
+- Partitioner: improved calculation of which packages need to be
+ installed in the running system (bsc#1168077).
+
+-------------------------------------------------------------------
Thu Dec 10 16:45:41 UTC 2020 - Imobach Gonzalez Sosa <[email protected]>
- AutoYaST: add support for Btrfs quotas (jsc#SLE-7742).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/package/yast2-storage-ng.spec
new/yast2-storage-ng-4.3.33/package/yast2-storage-ng.spec
--- old/yast2-storage-ng-4.3.29/package/yast2-storage-ng.spec 2020-12-14
11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/package/yast2-storage-ng.spec 2020-12-18
14:40:18.000000000 +0100
@@ -16,7 +16,7 @@
#
Name: yast2-storage-ng
-Version: 4.3.29
+Version: 4.3.33
Release: 0
Summary: YaST2 - Storage Configuration
License: GPL-2.0-only OR GPL-3.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2partitioner/widgets/overview.rb
new/yast2-storage-ng-4.3.33/src/lib/y2partitioner/widgets/overview.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2partitioner/widgets/overview.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2partitioner/widgets/overview.rb
2020-12-18 14:40:18.000000000 +0100
@@ -214,7 +214,7 @@
def packages_installed?
return true if Yast::Mode.installation
- pkgs = device_graph.used_features.pkg_list
+ pkgs = device_graph.actiongraph.used_features.pkg_list
Y2Storage::PackageHandler.new(pkgs).install
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2partitioner/widgets/summary_text.rb
new/yast2-storage-ng-4.3.33/src/lib/y2partitioner/widgets/summary_text.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2partitioner/widgets/summary_text.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2partitioner/widgets/summary_text.rb
2020-12-18 14:40:18.000000000 +0100
@@ -100,6 +100,10 @@
# Updates the value of {#packages}
def calculate_packages
+ # This is only used during installation (the summary in an installed
system does not
+ # include the packages to be installed because they are interactively
installed right
+ # away), so we use Devicegraph#used_features (without arguments) to
display all packages
+ # that are added to the software proposal, both optional and required.
@packages = current_graph.used_features.pkg_list
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/actiongraph.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/actiongraph.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/actiongraph.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/actiongraph.rb
2020-12-18 14:40:18.000000000 +0100
@@ -48,6 +48,11 @@
storage_forward :storage_compound_actions, to: :compound_actions, as:
"CompoundAction"
private :storage_compound_actions
+ # @!method storage_used_features
+ # @return [Integer] bit-field with the used features of the actiongraph
+ storage_forward :storage_used_features, to: :used_features
+ private :storage_used_features
+
# List of compound actions of the actiongraph.
#
# @note This is different from ::Storage#compound_actions because this
@@ -62,6 +67,13 @@
storage_compound_actions
end
+ # List of storage features used by the actiongraph
+ #
+ # @return [StorageFeaturesList]
+ def used_features
+ StorageFeaturesList.from_bitfield(storage_used_features)
+ end
+
private
# Checks whether the compound actions have already been generated for this
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/autoinst_profile/drive_section.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/autoinst_profile/drive_section.rb
---
old/yast2-storage-ng-4.3.29/src/lib/y2storage/autoinst_profile/drive_section.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/src/lib/y2storage/autoinst_profile/drive_section.rb
2020-12-18 14:40:18.000000000 +0100
@@ -215,6 +215,8 @@
init_from_btrfs(device)
elsif device.is?(:nfs)
init_from_nfs(device)
+ elsif device.is?(:tmpfs)
+ init_from_tmpfs(device)
else
init_from_disk(device)
end
@@ -464,6 +466,17 @@
@partitions = [PartitionSection.new_from_storage(device, self)]
true
+ end
+
+ # Method used by {.new_from_storage} to populate the attributes when
cloning a tmpfs
+ #
+ # @param device [Y2Storage::Filesystems::Tmpfs]
+ # @return [Boolean]
+ def init_from_tmpfs(device)
+ @type = :CT_TMPFS
+ @partitions = [PartitionSection.new_from_storage(device, self)]
+
+ true
end
def partitions_from_hash(hash)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/autoinst_profile/partition_section.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/autoinst_profile/partition_section.rb
---
old/yast2-storage-ng-4.3.29/src/lib/y2storage/autoinst_profile/partition_section.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/src/lib/y2storage/autoinst_profile/partition_section.rb
2020-12-18 14:40:18.000000000 +0100
@@ -334,6 +334,8 @@
init_disk_device_fields(device)
elsif device.is?(:nfs)
init_nfs_fields(device)
+ elsif device.is?(:tmpfs)
+ init_tmpfs_fields(device)
elsif device.is?(:blk_filesystem)
init_blk_filesystem_fields(device)
else
@@ -441,6 +443,13 @@
init_mount_options(device)
end
+ def init_tmpfs_fields(device)
+ @create = nil
+ @resize = nil
+ init_mount_options(device)
+ @mountby = nil
+ end
+
# Whether the given existing partition should be reported as GRUB (GPT
# Bios Boot) in the cloned profile.
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/autoinst_profile/partitioning_section.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/autoinst_profile/partitioning_section.rb
---
old/yast2-storage-ng-4.3.29/src/lib/y2storage/autoinst_profile/partitioning_section.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/src/lib/y2storage/autoinst_profile/partitioning_section.rb
2020-12-18 14:40:18.000000000 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) [2017-2019] SUSE LLC
+# Copyright (c) [2017-2020] SUSE LLC
#
# All Rights Reserved.
#
@@ -139,6 +139,13 @@
drives.select { |d| d.type == :CT_BTRFS }
end
+ # Drive sections with type :CT_TMPFS
+ #
+ # @return [Array<DriveSection>]
+ def tmpfs_drives
+ drives.select { |d| d.type == :CT_TMPFS }
+ end
+
# All drive sections generated from a given devicegraph
#
# It creates a drive section for each exportable device, see
{#exportable_devices}.
@@ -148,15 +155,32 @@
def self.drives_from_storage(devicegraph)
devices = exportable_devices(devicegraph)
- devices.map { |d| DriveSection.new_from_storage(d) }.compact
+ drives = devices.map { |d| DriveSection.new_from_storage(d) }.compact
+ merge_by_type(drives, :CT_TMPFS)
+ end
+
+ # Merges drive sections of a given type into a single section
+ #
+ # @param drives [Array<DriveSection>] Drive sections
+ # @param type [Symbol] Type to merge
+ # @return [Array<DriveSection>] Drive sections containing a single
section, if any, of
+ # the given type
+ def self.merge_by_type(drives, type)
+ by_type, others = drives.partition { |d| d.type == type }
+ return others if by_type.empty?
+
+ parts = by_type.map(&:partitions).flatten
+ merged_drive = by_type.first.clone
+ merged_drive.partitions = parts
+ others + [merged_drive]
end
+ private_class_method :merge_by_type
# All devices that can be exported by AutoYaST
#
# @param devicegraph [Devicegraph]
# @return [Array<Device>]
def self.exportable_devices(devicegraph)
- # TODO: consider also TMPFS
[].concat(
devicegraph.bcaches,
devicegraph.software_raids,
@@ -164,7 +188,8 @@
devicegraph.disk_devices,
devicegraph.stray_blk_devices,
devicegraph.multidevice_btrfs_filesystems,
- devicegraph.nfs_mounts
+ devicegraph.nfs_mounts,
+ devicegraph.tmp_filesystems
)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/autoinst_proposal.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/autoinst_proposal.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/autoinst_proposal.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/autoinst_proposal.rb
2020-12-18 14:40:18.000000000 +0100
@@ -40,7 +40,7 @@
# proposal.devices # => Proposed layout
#
class AutoinstProposal < Proposal::Base
- # @return [Hash] Partitioning layout from an AutoYaST profile
+ # @return [AutoinstProfile::PartitioningSection] Partitioning layout from
an AutoYaST profile
attr_reader :partitioning
# @return [AutoinstIssues::List] List of found AutoYaST issues
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/clients/inst_disk_proposal.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/clients/inst_disk_proposal.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/clients/inst_disk_proposal.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/clients/inst_disk_proposal.rb
2020-12-18 14:40:18.000000000 +0100
@@ -46,6 +46,7 @@
include InstDialogMixin
include PartitioningFeatures
+ # Constructor
def initialize
textdomain "storage"
@@ -60,6 +61,7 @@
create_initial_proposal
end
+ # Executes the client
def run
log.info("BEGIN of inst_disk_proposal")
@@ -101,6 +103,8 @@
ret
end
+ # Saves the result to the instance of {StorageManager}, called when the
user
+ # clicks 'next'
def save_to_storage_manager
if @proposal
log.info "Storing accepted proposal"
@@ -113,6 +117,7 @@
save_used_fs_list
end
+ # Executes the Guided Setup, called when the user presses the
corresponding button
def guided_setup
return if manual_partitioning? && !overwrite_manual_settings?
@@ -126,6 +131,7 @@
end
end
+ # Executes the Partitioner, called when the user presses the
corresponding button
def expert_partitioner(initial_graph)
return unless initial_graph && run_partitioner?
@@ -157,7 +163,21 @@
# set of packages to be installed.
def add_storage_packages
features = storage_manager.staging.used_features
- pkg_handler = Y2Storage::PackageHandler.new(features.pkg_list)
+ required_features =
storage_manager.staging.used_features(required_only: true)
+
+ required_packages = required_features.pkg_list
+ optional_packages = features.pkg_list - required_packages
+
+ set_proposal_packages(required_packages, false)
+ set_proposal_packages(optional_packages, true)
+ end
+
+ # @see #add_storage_packages
+ #
+ # @param pkgs [Array<String>] list of packages
+ # @param optional [Boolean] whether the packages in the list are optional
+ def set_proposal_packages(pkgs, optional)
+ pkg_handler = Y2Storage::PackageHandler.new(pkgs, optional: optional)
pkg_handler.set_proposal_packages
end
@@ -172,10 +192,12 @@
res
end
+ # @return StorageManager
def storage_manager
StorageManager.instance
end
+ # @return DiskAnalyzer
def probed_analyzer
storage_manager.probed_disk_analyzer
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/devicegraph.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/devicegraph.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/devicegraph.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/devicegraph.rb
2020-12-18 14:40:18.000000000 +0100
@@ -81,7 +81,8 @@
# (like, for example, a duplicated id)
storage_forward :check
- # @!method storage_used_features
+ # @!method storage_used_features(dependency_type)
+ # @param dependency_type [Integer] value of
Storage::UsedFeaturesDependencyType
# @return [Integer] bit-field with the used features of the devicegraph
storage_forward :storage_used_features, to: :used_features
private :storage_used_features
@@ -552,9 +553,22 @@
# List of storage features used by the devicegraph
#
+ # By default, it returns the features associated to all devices and
filesystems
+ # in the devicegraph. The required_only argument can be used to limit the
result
+ # by excluding features associated to those filesystems that have no mount
point.
+ #
+ # @param required_only [Boolean] whether the result should only include
those
+ # features that are mandatory (ie. associated to devices with a mount
point)
# @return [StorageFeaturesList]
- def used_features
- StorageFeaturesList.from_bitfield(storage_used_features)
+ def used_features(required_only: false)
+ type =
+ if required_only
+ Storage::UsedFeaturesDependencyType_REQUIRED
+ else
+ Storage::UsedFeaturesDependencyType_SUGGESTED
+ end
+
+ StorageFeaturesList.from_bitfield(storage_used_features(type))
end
private
@@ -593,10 +607,10 @@
raise(ArgumentError, "No device provided") if device.nil?
raise(ArgumentError, "Device not found") unless
device.exists_in_devicegraph?(self)
- children = device.children
+ children = device.children(View::REMOVE)
until children.empty?
remove_with_dependants(children.first, keep: keep + [device])
- children = device.children
+ children = device.children(View::REMOVE)
end
orphans = device.respond_to?(:potential_orphans) ?
device.potential_orphans : []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/package_handler.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/package_handler.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/package_handler.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/package_handler.rb
2020-12-18 14:40:18.000000000 +0100
@@ -52,8 +52,10 @@
# Constructor
#
# @param packages [Array<String>] packages to be added to {#pkg_list}
- def initialize(packages)
+ # @param optional [Boolean] see {#optional}
+ def initialize(packages, optional: false)
textdomain("storage")
+ @optional = optional
@pkg_list = []
add_packages(packages)
end
@@ -102,8 +104,10 @@
def set_proposal_packages
return true if @pkg_list.empty?
- log.info("Marking #{pkg_list} for installation")
- success = Yast::PackagesProposal.SetResolvables(PROPOSAL_ID, :package,
@pkg_list)
+ log.info("Marking #{pkg_list} for installation (optional: #{optional})")
+ success = Yast::PackagesProposal.SetResolvables(
+ PROPOSAL_ID, :package, @pkg_list, optional: optional
+ )
if !success
log.error("PackagesProposal::SetResolvables() for #{pkg_list} failed")
set_resolvables_error_popup
@@ -115,6 +119,14 @@
private
+ # Whether the packages should be considered as optional when adding them
to the
+ # installation proposal.
+ #
+ # Obviously, this is relevant for {#set_proposal_packages} but not for
{#install}.
+ #
+ # @return [Boolean]
+ attr_reader :optional
+
# Add a number of packages to the list of packages to be installed
#
# @param pkg_list [Array<String>] package names
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/planned/devices_collection.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/planned/devices_collection.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/planned/devices_collection.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/planned/devices_collection.rb
2020-12-18 14:40:18.000000000 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) [2018-2019] SUSE LLC
+# Copyright (c) [2018-2020] SUSE LLC
#
# All Rights Reserved.
#
@@ -164,6 +164,13 @@
@btrfs_filesystems ||= devices.select { |d| d.is_a?(Planned::Btrfs) }
end
+ # Returns the list of planned Tmpfs filesystems
+ #
+ # @return [Array<Planned::Tmpfs>]
+ def tmpfs_filesystems
+ @tmpfs_filesystems ||= devices.select { |d| d.is_a?(Planned::Tmpfs) }
+ end
+
# Returns all devices, including nested ones
#
# @return [Array<Planned::Device>]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/planned/tmpfs.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/planned/tmpfs.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/planned/tmpfs.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/planned/tmpfs.rb
2020-12-18 14:40:18.000000000 +0100
@@ -0,0 +1,68 @@
+# Copyright (c) [2020] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require "yast"
+require "y2storage/planned/device"
+require "y2storage/planned/mixins"
+require "y2storage/match_volume_spec"
+require "y2storage/filesystems/type"
+
+module Y2Storage
+ module Planned
+ # Specification for a Y2Storage::Filesystems::Tmpfs object to be created
during the AutoYaST proposal
+ #
+ # @see Device
+ class Tmpfs < Device
+ include Planned::CanBeMounted
+ include MatchVolumeSpec
+
+ # Constructor
+ #
+ # @param mount_point [String] mount path for this filesystem in the
AutoYaST profile
+ # @param fstab_options [Array<String>] fstab options for this filesystem
in the AutoYaST profile
+ def initialize(mount_point, fstab_options)
+ super()
+
+ initialize_can_be_mounted
+
+ self.mount_point = mount_point
+ self.fstab_options = fstab_options
+ end
+
+ # @return [Array<Symbol>]
+ def self.to_string_attrs
+ [:mount_point]
+ end
+
+ protected
+
+ # Values for volume specification matching
+ #
+ # @see MatchVolumeSpec
+ def volume_match_values
+ {
+ mount_point: mount_point,
+ size: nil,
+ fs_type: Filesystems::Type::TMPFS,
+ partition_id: nil
+ }
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-storage-ng-4.3.29/src/lib/y2storage/planned.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/planned.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/planned.rb 2020-12-14
11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/planned.rb 2020-12-18
14:40:18.000000000 +0100
@@ -25,6 +25,7 @@
require "y2storage/planned/md"
require "y2storage/planned/bcache"
require "y2storage/planned/nfs"
+require "y2storage/planned/tmpfs"
require "y2storage/planned/assigned_space"
require "y2storage/planned/partitions_distribution"
require "y2storage/planned/devices_collection"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_devices_creator.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_devices_creator.rb
---
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_devices_creator.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_devices_creator.rb
2020-12-18 14:40:18.000000000 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) [2017-2019] SUSE LLC
+# Copyright (c) [2017-2020] SUSE LLC
#
# All Rights Reserved.
#
@@ -26,6 +26,7 @@
require "y2storage/proposal/lvm_creator"
require "y2storage/proposal/btrfs_creator"
require "y2storage/proposal/nfs_creator"
+require "y2storage/proposal/tmpfs_creator"
require "y2storage/proposal/autoinst_creator_result"
require "y2storage/exceptions"
@@ -62,7 +63,9 @@
# when it is not possible to place the devices in the given free space. But
# we would also need to do further changes, like skipping some checks when
# running in this flexible mode.
- class AutoinstDevicesCreator
+ #
+ # FIXME: class too long, refactoring needed.
+ class AutoinstDevicesCreator # rubocop:disable Metrics/ClassLength
include Yast::Logger
include AutoinstPartitionSize
@@ -171,6 +174,7 @@
process_bcaches
process_btrfs_filesystems
process_nfs_filesystems
+ process_tmpfs_filesystems
Y2Storage::Proposal::AutoinstCreatorResult.new(creator_result,
devices_to_create)
end
@@ -253,6 +257,12 @@
self.creator_result =
create_nfs_filesystems(planned_devices.nfs_filesystems)
end
+ # Process planned Tmpfs filesystems
+ def process_tmpfs_filesystems
+ add_devices_to_create(planned_devices.tmpfs_filesystems)
+ self.creator_result =
create_tmpfs_filesystems(planned_devices.tmpfs_filesystems)
+ end
+
# Reuses a partitionable device
#
# @param reused_devices [Array<Planned::Device>] MD RAIDs or bcache to
reuse
@@ -423,6 +433,17 @@
end
end
+ # Creates Tmpfs filesystems
+ #
+ # @param tmpfs_filesystems [Array<Planned::Tmpfs>] List of planned Tmpfs
filesystems
+ # @return [Proposal::CreatorResult] Result containing the specified
Tmpfs filesystems
+ def create_tmpfs_filesystems(tmpfs_filesystems)
+ tmpfs_filesystems.reduce(creator_result) do |result, planned_tmpfs|
+ new_result = create_tmpfs_filesystem(result.devicegraph,
planned_tmpfs)
+ result.merge(new_result)
+ end
+ end
+
# Creates a MD RAID in the given devicegraph
#
# @param devicegraph [Devicegraph] Starting devicegraph
@@ -492,6 +513,17 @@
nfs_creator.create_nfs(planned_nfs)
end
+ # Creates a Tmpfs filesystem in the given devicegraph
+ #
+ # @param devicegraph [Devicegraph] Starting devicegraph
+ # @param planned_tmpfs [Planned::Tmpfs]
+ #
+ # @return [Proposal::CreatorResult] Result containing the specified Tmpfs
+ def create_tmpfs_filesystem(devicegraph, planned_tmpfs)
+ tmpfs_creator = Proposal::TmpfsCreator.new(devicegraph)
+ tmpfs_creator.create_tmpfs(planned_tmpfs)
+ end
+
# Finds the Bcache member in the previous result and in the list of
devices to use
#
# @return [String, nil] nil if no device is found
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_devices_planner.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_devices_planner.rb
---
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_devices_planner.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_devices_planner.rb
2020-12-18 14:40:18.000000000 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) [2017-2019] SUSE LLC
+# Copyright (c) [2017-2020] SUSE LLC
#
# All Rights Reserved.
#
@@ -26,6 +26,7 @@
require "y2storage/proposal/autoinst_bcache_planner"
require "y2storage/proposal/autoinst_nfs_planner"
require "y2storage/proposal/autoinst_btrfs_planner"
+require "y2storage/proposal/autoinst_tmpfs_planner"
require "y2storage/planned"
module Y2Storage
@@ -73,9 +74,6 @@
# @return [AutoinstIssues::List] List of AutoYaST issues to register them
attr_reader :issues_list
- # FIXME: Disabling rubocop. Not sure how to improve this method without
making it less readable.
- # rubocop:disable Metrics/CyclomaticComplexity
- #
# Returns a list of planned devices according to an AutoYaST
specification
#
# @param drive [AutoinstProfile::DriveSection] drive section describing
the device
@@ -83,22 +81,28 @@
#
# @return [Array<Planned::Device>, nil] nil if the device cannot be
planned
def planned_for_drive(drive, disk_name)
+ handlers = {
+ CT_DISK: :planned_for_disk_device,
+ CT_DMMULTIPATH: :planned_for_disk_device,
+ CT_LVM: :planned_for_vg,
+ CT_MD: :planned_for_md,
+ CT_BCACHE: :planned_for_bcache,
+ CT_NFS: :planned_for_nfs,
+ CT_BTRFS: :planned_for_btrfs,
+ CT_TMPFS: :planned_for_tmpfs
+ }
+
+ handler = handlers[drive.type]
+
+ return unless handler
+
case drive.type
when :CT_DISK, :CT_DMMULTIPATH
- planned_for_disk_device(drive, disk_name)
- when :CT_LVM
- planned_for_vg(drive)
- when :CT_MD
- planned_for_md(drive)
- when :CT_BCACHE
- planned_for_bcache(drive)
- when :CT_NFS
- planned_for_nfs(drive)
- when :CT_BTRFS
- planned_for_btrfs(drive)
+ send(handler, drive, disk_name)
+ else
+ send(handler, drive)
end
end
- # rubocop:enable all
# Returns a list of planned partitions (or disks) according to an
AutoYaST specification
#
@@ -157,6 +161,15 @@
planner.planned_devices(drive)
end
+ # Returns a list of planned Tmpfs filesystems according to an AutoYaST
specification
+ #
+ # @param drive [AutoinstProfile::DriveSection] drive section describing
the Tmpfs
+ # @return [Array<Planned::Tmpfs>]
+ def planned_for_tmpfs(drive)
+ planner = Y2Storage::Proposal::AutoinstTmpfsPlanner.new(devicegraph,
issues_list)
+ planner.planned_devices(drive)
+ end
+
# Removes shadowed subvolumes from each planned device that can be
mounted
#
# @param planned_devices [Array<Planned::Device>]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_drive_planner.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_drive_planner.rb
---
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_drive_planner.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_drive_planner.rb
2020-12-18 14:40:18.000000000 +0100
@@ -245,18 +245,21 @@
# Sets the Btrfs quotas according to the section and the subvolumes
#
+ # If `section.quotas` is nil, it inspect whether quotas are needed for
any
+ # of the subvolumes. In that case, it sets `device.quota` to true.
+ #
# @param device [Planned::Device] Planned device
# @param section [AutoinstProfile::PartitionSection] AutoYaST
specification
def configure_btrfs_quotas(device, section)
- if section.quotas
- device.quota = true
+ if !section.quotas.nil?
+ device.quota = section.quotas
return
end
subvols_with_quotas = device.subvolumes.select do |subvol|
subvol.referenced_limit && !subvol.referenced_limit.unlimited?
end
- return if subvols_with_quotas.empty? || device.quota?
+ return if subvols_with_quotas.empty?
device.quota = true
issues_list.add(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_drives_map.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_drives_map.rb
---
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_drives_map.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_drives_map.rb
2020-12-18 14:40:18.000000000 +0100
@@ -61,6 +61,7 @@
add_mds(partitioning.md_drives)
add_bcaches(partitioning.bcache_drives)
add_btrfs_filesystems(partitioning.btrfs_drives)
+ add_tmpfs_filesystems(partitioning.tmpfs_drives)
add_nfs_filesystems(partitioning.nfs_drives)
end
@@ -203,6 +204,14 @@
btrfs_drives.each { |d| @drives[d.device] = d }
end
+ # Adds Tmpfs filesystems to the device map
+ #
+ # @param tmpfs_drives [Array<AutoinstProfile::DriveSection>] List of
Tmpfs specifications from
+ # AutoYaST
+ def add_tmpfs_filesystems(tmpfs_drives)
+ tmpfs_drives.each_with_index { |d, i| @drives["tmpfs-#{i}"] = d }
+ end
+
# Adds NFS filesystems to the device map
#
# All NFS filesystems should have a "device" property.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_tmpfs_planner.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_tmpfs_planner.rb
---
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/autoinst_tmpfs_planner.rb
1970-01-01 01:00:00.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/autoinst_tmpfs_planner.rb
2020-12-18 14:40:18.000000000 +0100
@@ -0,0 +1,53 @@
+# Copyright (c) [2020] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require "y2storage/proposal/autoinst_drive_planner"
+require "y2storage/planned/tmpfs"
+require "y2storage/autoinst_issues"
+
+module Y2Storage
+ module Proposal
+ # This class converts an AutoYaST specification into a Planned::Tmpfs
+ class AutoinstTmpfsPlanner < AutoinstDrivePlanner
+ # Returns a planned Tmpfs according to an AutoYaST specification
+ #
+ # @param drive_section [AutoinstProfile::DriveSection] drive section
describing the Tmpfs
+ # @return [Array<Planned::Tmpfs>] Array containing the planned Tmpfs
+ def planned_devices(drive_section)
+ drive_section.partitions.map { |p| planned_tmpfs(p) }.compact
+ end
+
+ private
+
+ # Generates a planned Tmpfs from a drive section
+ #
+ # @param partition_section [AutoinstProfile::PartitionSection] partition
section
+ # describing the tmpfs filesystem
+ # @return [Planned::Tmpfs,nil] A planned tmpfs or nil if it some error
ocurred
+ def planned_tmpfs(partition_section)
+ if partition_section.mount.nil? || partition_section.mount.empty?
+ issues_list.add(Y2Storage::AutoinstIssues::MissingValue,
partition_section, :mount)
+ return
+ end
+
+ Planned::Tmpfs.new(partition_section.mount,
partition_section.fstab_options)
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/tmpfs_creator.rb
new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/tmpfs_creator.rb
--- old/yast2-storage-ng-4.3.29/src/lib/y2storage/proposal/tmpfs_creator.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/src/lib/y2storage/proposal/tmpfs_creator.rb
2020-12-18 14:40:18.000000000 +0100
@@ -0,0 +1,51 @@
+# Copyright (c) [2020] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require "y2storage/filesystems/tmpfs"
+require "y2storage/proposal/creator_result"
+
+module Y2Storage
+ module Proposal
+ # Class to create a Tmpfs filesystem according to a Planned::Tmpfs object
+ class TmpfsCreator
+ attr_reader :original_devicegraph
+
+ # Constructor
+ #
+ # @param original_devicegraph [Devicegraph] Initial devicegraph
+ def initialize(original_devicegraph)
+ @original_devicegraph = original_devicegraph
+ end
+
+ # Creates the Tmpfs filesystem
+ #
+ # @param planned_tmpfs [Planned::Tmpfs] planned Tmpfs filesystem
+ # @return [CreatorResult] result containing the new Tmpfs filesystem
+ def create_tmpfs(planned_tmpfs)
+ new_graph = original_devicegraph.duplicate
+
+ tmpfs = Filesystems::Tmpfs.create(new_graph)
+ tmpfs.mount_path = planned_tmpfs.mount_point
+ tmpfs.mount_point.mount_options = planned_tmpfs.fstab_options
+
+ CreatorResult.new(new_graph, tmpfs.mount_path => planned_tmpfs)
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/support/storage_helpers.rb
new/yast2-storage-ng-4.3.33/test/support/storage_helpers.rb
--- old/yast2-storage-ng-4.3.29/test/support/storage_helpers.rb 2020-12-14
11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/test/support/storage_helpers.rb 2020-12-18
14:40:18.000000000 +0100
@@ -153,6 +153,11 @@
add_planned_attributes(btrfs, attrs)
end
+ def planned_tmpfs(mount, attrs = {})
+ tmpfs = Y2Storage::Planned::Tmpfs.new(mount, [])
+ add_planned_attributes(tmpfs, attrs)
+ end
+
def add_planned_attributes(device, attrs)
attrs = attrs.dup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2partitioner/widgets/overview_test.rb
new/yast2-storage-ng-4.3.33/test/y2partitioner/widgets/overview_test.rb
--- old/yast2-storage-ng-4.3.29/test/y2partitioner/widgets/overview_test.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/test/y2partitioner/widgets/overview_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -426,6 +426,7 @@
context "when the current setup is valid" do
let(:valid_setup) { true }
+ let(:actiongraph) { instance_double(Y2Storage::Actiongraph) }
it "does not show an error popup" do
expect(Yast2::Popup).to_not receive(:show)
@@ -436,13 +437,23 @@
expect(subject.validate).to eq(true)
end
- it "checks for needed packages" do
+ # bsc#1168077: in a installed system check only for packages needed for
the actions
+ it "gets the list of needed packages from the actiongraph" do
+ expect(current_graph).to_not receive(:used_features)
+
+ expect(current_graph).to receive(:actiongraph).and_return actiongraph
+ expect(actiongraph).to receive(:used_features).and_return used_features
+
+ subject.validate
+ end
+
+ it "checks whether the needed packages are installed" do
expect(Yast::PackageSystem).to receive(:CheckAndInstallPackages)
.with(["xfsprogs"])
subject.validate
end
- context "but the user refuses to install them " do
+ context "but the user refuses to install the packages" do
let(:installed_packages) { false }
it "returns false" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/actiongraph_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/actiongraph_test.rb
--- old/yast2-storage-ng-4.3.29/test/y2storage/actiongraph_test.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/test/y2storage/actiongraph_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -0,0 +1,43 @@
+#!/usr/bin/env rspec
+
+# Copyright (c) [2020] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require_relative "spec_helper"
+require "y2storage"
+
+describe Y2Storage::Actiongraph do
+ describe "#used_features" do
+ let(:scenario) { "mixed_disks" }
+ let(:staging) { Y2Storage::StorageManager.instance.staging }
+
+ before do
+ fake_scenario(scenario)
+ ntfs = staging.filesystems.find { |fs| fs.type.is?(:ntfs) }
+ ntfs.mount_path = "/mnt"
+ end
+
+ it "returns the expected set of storage features" do
+ features = staging.actiongraph.used_features
+ expect(features).to be_a Y2Storage::StorageFeaturesList
+ expect(features.size).to eq 1
+ expect(features.first.id).to eq :UF_NTFS
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/autoinst_profile/drive_section_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/autoinst_profile/drive_section_test.rb
---
old/yast2-storage-ng-4.3.29/test/y2storage/autoinst_profile/drive_section_test.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/test/y2storage/autoinst_profile/drive_section_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -213,6 +213,11 @@
expect(described_class.new_from_storage(nfs)).to be_a described_class
end
+ it "returns a DriveSection object for a tmpfs filesystem" do
+ tmpfs = Y2Storage::Filesystems::Tmpfs.create(fake_devicegraph)
+ expect(described_class.new_from_storage(tmpfs)).to be_a described_class
+ end
+
it "returns a DriveSection object for a multi-device Btrfs filesystem" do
sdd1 = device("sdd1")
sdd3 = device("sdd3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/autoinst_profile/partition_section_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/autoinst_profile/partition_section_test.rb
---
old/yast2-storage-ng-4.3.29/test/y2storage/autoinst_profile/partition_section_test.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/test/y2storage/autoinst_profile/partition_section_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -567,6 +567,27 @@
end
end
+ context "given a tmpfs" do
+ let(:scenario) { "tmpfs1-devicegraph.xml" }
+
+ let(:dev) do
+ fake_devicegraph.tmp_filesystems.find { |d| d.mount_path == "/test1" }
+ end
+
+ subject(:section) { described_class.new_from_storage(dev) }
+
+ it "initializes #create and #resize to nil" do
+ expect(section.create).to be_nil
+ expect(section.resize).to be_nil
+ end
+
+ it "initializes mount options except the mountby attribute" do
+ expect(section.mount).to eq(dev.mount_path)
+ expect(section.mountby).to be_nil
+ expect(section.fstab_options).to eq(dev.mount_options)
+ end
+ end
+
context "given a partition which is part of a Btrfs multidevice" do
let(:scenario) { "btrfs2-devicegraph.xml" }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/autoinst_profile/partitioning_section_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/autoinst_profile/partitioning_section_test.rb
---
old/yast2-storage-ng-4.3.29/test/y2storage/autoinst_profile/partitioning_section_test.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/test/y2storage/autoinst_profile/partitioning_section_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -26,14 +26,24 @@
let(:sda) { { "device" => "/dev/sda", "use" => "linux" } }
let(:sdb) { { "device" => "/dev/sdb", "use" => "all" } }
- let(:disk_section) { double("disk_section") }
- let(:dasd_section) { double("dasd_section") }
- let(:vg_section) { double("vg_section") }
- let(:md_section) { double("md_section") }
- let(:stray_section) { double("stray_section") }
- let(:bcache_section) { double("bcache_section") }
- let(:nfs_section) { double("nfs_section") }
- let(:btrfs_section) { double("btrfs_section") }
+ let(:disk_section) { double("disk_section", type: :CT_DISK) }
+ let(:dasd_section) { double("dasd_section", type: :CT_DISK) }
+ let(:vg_section) { double("vg_section", type: :CT_LVM) }
+ let(:md_section) { double("md_section", type: :CT_MD) }
+ let(:stray_section) { double("stray_section", type: :CT_DISK) }
+ let(:bcache_section) { double("bcache_section", type: :CT_BCACHE) }
+ let(:nfs_section) { double("nfs_section", type: :CT_NFS) }
+ let(:btrfs_section) { double("btrfs_section", type: :CT_BTRFS) }
+ let(:tmpfs0_section) do
+ Y2Storage::AutoinstProfile::DriveSection.new_from_hashes(
+ "type" => :CT_TMPFS, "partitions" => [{ "mount" => "/srv" }]
+ )
+ end
+ let(:tmpfs1_section) do
+ Y2Storage::AutoinstProfile::DriveSection.new_from_hashes(
+ "type" => :CT_TMPFS, "partitions" => [{ "mount" => "/var/tmp" }]
+ )
+ end
let(:partitioning) { [sda, sdb] }
describe ".new_from_hashes" do
@@ -75,7 +85,8 @@
stray_blk_devices: [stray],
bcaches: [bcache],
nfs_mounts: [nfs],
- multidevice_btrfs_filesystems: [btrfs]
+ multidevice_btrfs_filesystems: [btrfs],
+ tmp_filesystems: [tmpfs0, tmpfs1]
)
end
@@ -88,6 +99,8 @@
let(:bcache) { instance_double(Y2Storage::Bcache) }
let(:nfs) { instance_double(Y2Storage::Filesystems::Nfs) }
let(:btrfs) { instance_double(Y2Storage::Filesystems::Btrfs) }
+ let(:tmpfs0) { instance_double(Y2Storage::Filesystems::Tmpfs) }
+ let(:tmpfs1) { instance_double(Y2Storage::Filesystems::Tmpfs) }
before do
allow(Y2Storage::AutoinstProfile::DriveSection).to
receive(:new_from_storage)
@@ -106,6 +119,10 @@
.with(nfs).and_return(nfs_section)
allow(Y2Storage::AutoinstProfile::DriveSection).to
receive(:new_from_storage)
.with(btrfs).and_return(btrfs_section)
+ allow(Y2Storage::AutoinstProfile::DriveSection).to
receive(:new_from_storage)
+ .with(tmpfs0).and_return(tmpfs0_section)
+ allow(Y2Storage::AutoinstProfile::DriveSection).to
receive(:new_from_storage)
+ .with(tmpfs1).and_return(tmpfs1_section)
end
subject(:section) { described_class.new_from_storage(devicegraph) }
@@ -146,6 +163,12 @@
expect(section.drives).to include(btrfs_section)
end
+ it "creates a single entry in #drives grouping all tmpfs filesystems" do
+ tmpfs = section.drives.select { |d| d.type == :CT_TMPFS }
+ expect(tmpfs.size).to eq(1)
+ expect(tmpfs.first.partitions.map(&:mount)).to contain_exactly("/srv",
"/var/tmp")
+ end
+
it "ignores irrelevant drives" do
allow(Y2Storage::AutoinstProfile::DriveSection).to
receive(:new_from_storage)
.with(disk).and_return(nil)
@@ -199,6 +222,7 @@
let(:drive9) { double("DriveSection", type: :CT_NFS) }
let(:drive10) { double("DriveSection", type: :CT_BTRFS) }
let(:drive11) { double("DriveSection", type: :CT_DMMULTIPATH) }
+ let(:drive12) { double("DriveSection", type: :CT_TMPFS) }
let(:wrongdrv1) { double("DriveSection", device: "/dev/md", type:
:CT_DISK) }
let(:wrongdrv2) { double("DriveSection", device: "/dev/sdc", type: :CT_MD)
}
let(:wrongdrv3) { double("DriveSection", device: "/dev/sdd", type:
:CT_WRONG) }
@@ -208,7 +232,7 @@
before do
section.drives = [
drive1, drive2, drive3, drive4, drive5, drive6, drive7, drive8,
drive9, drive10,
- drive11, wrongdrv1, wrongdrv2, wrongdrv3, wrongdrv4, wrongdrv5
+ drive11, drive12, wrongdrv1, wrongdrv2, wrongdrv3, wrongdrv4, wrongdrv5
]
end
@@ -251,6 +275,12 @@
expect(section.nfs_drives).to contain_exactly(drive9)
end
end
+
+ describe "#tmpfs_drives" do
+ it "returns drives which type is :CT_TMPFS" do
+ expect(section.tmpfs_drives).to contain_exactly(drive12)
+ end
+ end
end
describe "#section_name" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/autoinst_proposal_tmpfs_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/autoinst_proposal_tmpfs_test.rb
--- old/yast2-storage-ng-4.3.29/test/y2storage/autoinst_proposal_tmpfs_test.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/test/y2storage/autoinst_proposal_tmpfs_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -0,0 +1,107 @@
+#!/usr/bin/env rspec
+
+# Copyright (c) [2020] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require_relative "spec_helper"
+require "y2storage"
+
+describe Y2Storage::AutoinstProposal do
+ using Y2Storage::Refinements::SizeCasts
+
+ subject(:proposal) do
+ described_class.new(
+ partitioning: partitioning, devicegraph: fake_devicegraph, issues_list:
issues_list
+ )
+ end
+
+ let(:issues_list) { ::Installation::AutoinstIssues::List.new }
+
+ describe "#propose" do
+ before { fake_scenario(scenario) }
+
+ let(:scenario) { "empty_hard_disk_50GiB" }
+
+ let(:vda) do
+ {
+ "device" => "/dev/sda",
+ "type" => :CT_DISK,
+ "use" => "all",
+ "partitions" => [
+ { "create" => true, "format" => true, "mount" => "/", "size" =>
"max" },
+ { "create" => true, "format" => true, "mount" => "swap", "size" =>
"1GiB" }
+ ]
+ }
+ end
+
+ let(:tmpfs0) do
+ {
+ "type" => :CT_TMPFS,
+ "partitions" => [
+ { "mount" => "/srv", "fstopt" => "size=512M" },
+ { "mount" => "/var/tmp", "fstopt" => "size=3GB" }
+ ]
+ }
+ end
+
+ let(:tmpfs1) do
+ {
+ "type" => :CT_TMPFS,
+ "partitions" => [
+ { "mount" => "/mnt/tmp", "fstopt" => "size=256M" }
+ ]
+ }
+ end
+
+ let(:partitioning) { [vda, tmpfs0, tmpfs1] }
+
+ it "adds one tmp filesystem for each partition section" do
+ proposal.propose
+ tmpfs = proposal.devices.tmp_filesystems
+ expect(tmpfs).to contain_exactly(
+ an_object_having_attributes(mount_path: "/srv", mount_options:
["size=512M"]),
+ an_object_having_attributes(mount_path: "/var/tmp", mount_options:
["size=3GB"]),
+ an_object_having_attributes(mount_path: "/mnt/tmp", mount_options:
["size=256M"])
+ )
+ end
+
+ it "does not register any issue" do
+ proposal.propose
+ expect(issues_list).to be_empty
+ end
+
+ context "when a mount point is missing" do
+ let(:tmpfs1) do
+ {
+ "type" => :CT_TMPFS,
+ "partitions" => [
+ { "fstopt" => "size=256M" }
+ ]
+ }
+ end
+
+ it "registers an issue" do
+ proposal.propose
+ issue = issues_list.find { |i|
i.is_a?(Y2Storage::AutoinstIssues::MissingValue) }
+ expect(issue).to_not be_nil
+ expect(issue.attr).to eq(:mount)
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/devicegraph_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/devicegraph_test.rb
--- old/yast2-storage-ng-4.3.29/test/y2storage/devicegraph_test.rb
2020-12-14 11:28:45.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/test/y2storage/devicegraph_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -809,6 +809,36 @@
end
end
+ describe "#remove_btrfs_subvolume" do
+ subject(:devicegraph) { Y2Storage::StorageManager.instance.staging }
+
+ before do
+ fake_scenario("mixed_disks_btrfs")
+ btrfs.quota = true
+ end
+
+ let(:btrfs) { devicegraph.find_by_name("/dev/sda2").filesystem }
+
+ it "removes the given subvolume" do
+ subvol = btrfs.find_btrfs_subvolume_by_path("@/srv")
+ expect(subvol).to_not be_nil
+
+ devicegraph.remove_btrfs_subvolume(subvol)
+
+ subvol = btrfs.find_btrfs_subvolume_by_path("@/srv")
+ expect(subvol).to be_nil
+ end
+
+ it "removes the corresponding qgroup" do
+ subvol = btrfs.find_btrfs_subvolume_by_path("@/srv")
+ qgroups = btrfs.btrfs_qgroups.size
+
+ devicegraph.remove_btrfs_subvolume(subvol)
+
+ expect(btrfs.btrfs_qgroups.size).to eq(qgroups - 1)
+ end
+ end
+
describe "#remove_md" do
subject(:devicegraph) { Y2Storage::StorageManager.instance.staging }
@@ -1162,6 +1192,13 @@
expect(features.map(&:id))
.to contain_exactly(:UF_BTRFS, :UF_EXT4, :UF_NTFS, :UF_XFS, :UF_SWAP)
end
+
+ it "returns only the features for mounted filesystems if required_only
is given" do
+ features = fake_devicegraph.used_features(required_only: true)
+ expect(features).to be_a Y2Storage::StorageFeaturesList
+ expect(features.map(&:id))
+ .to contain_exactly(:UF_BTRFS, :UF_XFS, :UF_SWAP)
+ end
end
context "with unformatted DASD and FC devices" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/planned/tmpfs_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/planned/tmpfs_test.rb
--- old/yast2-storage-ng-4.3.29/test/y2storage/planned/tmpfs_test.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/test/y2storage/planned/tmpfs_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -0,0 +1,62 @@
+#!/usr/bin/env rspec
+#
+# Copyright (c) [2020] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require_relative "../spec_helper"
+require "y2storage/planned"
+
+describe Y2Storage::Planned::Tmpfs do
+ using Y2Storage::Refinements::SizeCasts
+
+ subject(:tmpfs) { described_class.new(mount_point, "size=3G") }
+
+ # Only basic cases are tested here. More exhaustive tests can be found in
tests
+ # for Y2Storage::MatchVolumeSpec
+ describe "#match_value?" do
+ let(:volume) do
+ Y2Storage::VolumeSpecification.new({}).tap do |vol|
+ vol.mount_point = "/boot"
+ vol.fs_types = [Y2Storage::Filesystems::Type::TMPFS]
+ end
+ end
+
+ let(:excludes) { [:size, :partition_id] }
+
+ before do
+ tmpfs.mount_point = mount_point
+ end
+
+ context "when the planned partition has the same values" do
+ let(:mount_point) { volume.mount_point }
+
+ it "returns true" do
+ expect(tmpfs.match_volume?(volume, exclude: excludes)).to eq(true)
+ end
+ end
+
+ context "when the planned tmpfs does not have same values" do
+ let(:mount_point) { "/srv" }
+
+ it "returns false" do
+ expect(tmpfs.match_volume?(volume, exclude: excludes)).to eq(false)
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/autoinst_devices_creator_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/autoinst_devices_creator_test.rb
---
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/autoinst_devices_creator_test.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/autoinst_devices_creator_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -529,6 +529,24 @@
end
end
+ describe "using Tmpfs" do
+ let(:tmpfs0) do
+ planned_tmpfs("/srv", fstab_options: ["size=2GB"])
+ end
+
+ let(:planned_devices) {
Y2Storage::Planned::DevicesCollection.new([tmpfs0]) }
+
+ it "adds the tmpfs filesystem" do
+ result = creator.populated_devicegraph(planned_devices, [])
+ devicegraph = result.devicegraph
+ tmpfs = devicegraph.tmp_filesystems.first
+
+ expect(tmpfs).to be_a(Y2Storage::Filesystems::Tmpfs)
+ expect(tmpfs.mount_path).to eq("/srv")
+ expect(tmpfs.mount_options).to eq(["size=2GB"])
+ end
+ end
+
describe "resizing partitions" do
let(:root) do
Y2Storage::Planned::Partition.new("/", filesystem_type).tap do |part|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/autoinst_devices_planner_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/autoinst_devices_planner_test.rb
---
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/autoinst_devices_planner_test.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/autoinst_devices_planner_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -327,5 +327,21 @@
end
end
end
+
+ context "using CT_TMPFS as type" do
+ let(:partitioning_array) do
+ [{
+ "type" => :CT_TMPFS, "partitions" => [{ "mount" => "/srv" }, {
"mount" => "/var/tmp" }]
+ }]
+ end
+
+ it "plans a tmpfs file system for each partition section" do
+ devices = planner.planned_devices(drives_map)
+ expect(devices.tmpfs_filesystems).to contain_exactly(
+ an_object_having_attributes(mount_point: "/srv"),
+ an_object_having_attributes(mount_point: "/var/tmp")
+ )
+ end
+ end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/autoinst_disk_device_planner_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/autoinst_disk_device_planner_test.rb
---
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/autoinst_disk_device_planner_test.rb
2020-12-14 11:28:45.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/autoinst_disk_device_planner_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -771,21 +771,13 @@
expect(planned_root.quota?).to eq(false)
end
- context "but a subvolume requires quotas" do
+ context "and a subvolume requires quotas" do
let(:subvolumes) do
[{ "path" => "@/tmp", "referenced_limit" => "1GiB" }]
end
- it "plans for quotas" do
- expect(planned_root.quota?).to eq(true)
- end
-
- it "reports an issue" do
- planner.planned_devices(drive)
- issue = planner.issues_list.find do |i|
- i.is_a?(Y2Storage::AutoinstIssues::MissingBtrfsQuotas)
- end
- expect(issue).to_not be_nil
+ it "does not plan for quotas" do
+ expect(planned_root.quota?).to eq(false)
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/autoinst_tmpfs_planner_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/autoinst_tmpfs_planner_test.rb
---
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/autoinst_tmpfs_planner_test.rb
1970-01-01 01:00:00.000000000 +0100
+++
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/autoinst_tmpfs_planner_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -0,0 +1,68 @@
+#!/usr/bin/env rspec
+#
+# Copyright (c) [2020] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require_relative "../spec_helper"
+require_relative "../../support/autoinst_devices_planner_btrfs"
+require "y2storage/proposal/autoinst_tmpfs_planner"
+require "y2storage/autoinst_issues"
+require "y2storage/autoinst_profile/drive_section"
+
+describe Y2Storage::Proposal::AutoinstTmpfsPlanner do
+ using Y2Storage::Refinements::SizeCasts
+
+ subject(:planner) { described_class.new(fake_devicegraph, issues_list) }
+ let(:scenario) { "empty_disks" }
+ let(:issues_list) { ::Installation::AutoinstIssues::List.new }
+
+ before do
+ fake_scenario(scenario)
+ end
+
+ describe "#planned_devices" do
+ let(:drive) do
+ Y2Storage::AutoinstProfile::DriveSection.new_from_hashes(
+ "partitions" => [tmpfs0, tmpfs1]
+ )
+ end
+
+ let(:tmpfs0) { { "mount" => "/srv", "fstopt" => "512M" } }
+ let(:tmpfs1) { { "mount" => "/var/tmp", "fstopt" => "size=3G" } }
+
+ it "returns a planned tmpfs device for each partition section" do
+ planned = planner.planned_devices(drive)
+ expect(planned).to contain_exactly(
+ an_object_having_attributes(mount_point: "/srv"),
+ an_object_having_attributes(mount_point: "/var/tmp")
+ )
+ end
+
+ context "when the mount point is missing" do
+ let(:tmpfs0) { { "fstopt" => "512M" } }
+
+ it "registers and issue" do
+ planner.planned_devices(drive)
+ issue = issues_list.find { |i|
i.is_a?(Y2Storage::AutoinstIssues::MissingValue) }
+ expect(issue).to_not be_nil
+ expect(issue.attr).to eq(:mount)
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-storage-ng-4.3.29/test/y2storage/proposal/tmpfs_creator_test.rb
new/yast2-storage-ng-4.3.33/test/y2storage/proposal/tmpfs_creator_test.rb
--- old/yast2-storage-ng-4.3.29/test/y2storage/proposal/tmpfs_creator_test.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-storage-ng-4.3.33/test/y2storage/proposal/tmpfs_creator_test.rb
2020-12-18 14:40:18.000000000 +0100
@@ -0,0 +1,46 @@
+#!/usr/bin/env rspec
+#
+# Copyright (c) [2020] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require_relative "../spec_helper"
+require "y2storage"
+
+describe Y2Storage::Proposal::TmpfsCreator do
+ before do
+ fake_scenario(scenario)
+ end
+
+ subject { described_class.new(fake_devicegraph) }
+
+ describe "#create_filesystem" do
+ let(:scenario) { "empty_disks" }
+
+ let(:planned_srv) do
+ planned_tmpfs("/srv", fstab_options: ["size=256M"])
+ end
+
+ it "creates a new tmpfs filesystem" do
+ result = subject.create_tmpfs(planned_srv)
+ tmpfs = result.devicegraph.tmp_filesystems.first
+ expect(tmpfs.mount_path).to eq(planned_srv.mount_point)
+ expect(tmpfs.mount_options).to eq(planned_srv.fstab_options)
+ end
+ end
+end
_______________________________________________
openSUSE Commits mailing list -- [email protected]
To unsubscribe, email [email protected]
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives:
https://lists.opensuse.org/archives/list/[email protected]