Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Oct 31, 2016
1 parent f0a5c92 commit 4ba269e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
18 changes: 1 addition & 17 deletions src/modules/FileSystems.rb
Expand Up @@ -2065,23 +2065,7 @@ def default_subvol=(name)
#
# @return [String,nil] Default subvolume from the target system
def default_subvol_from_target
Yast.import "Storage"
parts = Storage.GetTargetMap.map { |_k, d| d.fetch("partitions") }.flatten.compact
btrfs_parts = parts.select { |p| p["used_fs"] == :btrfs }
default_subvol_names = btrfs_parts.reduce({}) do |memo, part|
memo[part["mount"]] = btrfs_subvol_name_for(part) unless part["mount"].nil?
memo
end

# Root takes precedence
return default_subvol_names["/"] if default_subvol_names.has_key?("/")

# If all has the same default subvolume name
found_names = default_subvol_names.values.uniq
return found_names.first if found_names.size == 1

# If there are different values, fallback to product's default
default_subvol_from_product
return "@"
end

# Default subvol name from product
Expand Down
5 changes: 1 addition & 4 deletions test/storage_snapper_configure_snapper_test.rb
@@ -1,13 +1,10 @@
#!/usr/bin/env rspec

ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)

require "yast"
require_relative "spec_helper"

Yast.import "StorageSnapper"
Yast.import "Storage"


describe "StorageSnapper#configure_snapper?" do


Expand Down

0 comments on commit 4ba269e

Please sign in to comment.