Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2014-09-03 18:21:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2014-08-20 17:54:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2014-09-03 21:23:48.000000000 +0200 @@ -1,0 +2,13 @@ +Tue Sep 2 11:59:32 UTC 2014 - an...@suse.com + +- Use DM device for encrypted partitions during test mount + (bnc#889334) +- 3.1.44 + +------------------------------------------------------------------- +Mon Sep 1 14:16:27 UTC 2014 - an...@suse.com + +- Use options from partitioner during test mount (bnc#873180) +- 3.1.43 + +------------------------------------------------------------------- Old: ---- yast2-packager-3.1.42.tar.bz2 New: ---- yast2-packager-3.1.44.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.Ef0UxX/_old 2014-09-03 21:23:49.000000000 +0200 +++ /var/tmp/diff_new_pack.Ef0UxX/_new 2014-09-03 21:23:49.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.1.42 +Version: 3.1.44 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-packager-3.1.42.tar.bz2 -> yast2-packager-3.1.44.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.42/package/yast2-packager.changes new/yast2-packager-3.1.44/package/yast2-packager.changes --- old/yast2-packager-3.1.42/package/yast2-packager.changes 2014-08-18 16:14:14.000000000 +0200 +++ new/yast2-packager-3.1.44/package/yast2-packager.changes 2014-09-03 14:04:10.000000000 +0200 @@ -1,4 +1,17 @@ ------------------------------------------------------------------- +Tue Sep 2 11:59:32 UTC 2014 - an...@suse.com + +- Use DM device for encrypted partitions during test mount + (bnc#889334) +- 3.1.44 + +------------------------------------------------------------------- +Mon Sep 1 14:16:27 UTC 2014 - an...@suse.com + +- Use options from partitioner during test mount (bnc#873180) +- 3.1.43 + +------------------------------------------------------------------- Mon Aug 18 12:57:01 UTC 2014 - lsle...@suse.cz - fixed adding of new SLP and CD/DVD repositories diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.42/package/yast2-packager.spec new/yast2-packager-3.1.44/package/yast2-packager.spec --- old/yast2-packager-3.1.42/package/yast2-packager.spec 2014-08-18 16:14:14.000000000 +0200 +++ new/yast2-packager-3.1.44/package/yast2-packager.spec 2014-09-03 14:04:10.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.1.42 +Version: 3.1.44 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.42/src/modules/SpaceCalculation.rb new/yast2-packager-3.1.44/src/modules/SpaceCalculation.rb --- old/yast2-packager-3.1.42/src/modules/SpaceCalculation.rb 2014-08-18 16:14:14.000000000 +0200 +++ new/yast2-packager-3.1.44/src/modules/SpaceCalculation.rb 2014-09-03 14:04:10.000000000 +0200 @@ -653,8 +653,14 @@ end used = 0 - if !(Ops.get_boolean(part, "create", false) || - Ops.get_boolean(part, "format", false)) + # If reusing a previously existent filesystem + if !(part["create"] || part["format"]) + + # Mount the filesystem to check the available space. + # FIXME: libstorage provides functions to query free + # information for devices (even caching the information). + # This part should be refactored to rely on libstorage. + tmpdir = Convert.to_string(SCR.Read(path(".target.tmpdir"))) tmpdir = Ops.add(tmpdir, "/diskspace_mount") SCR.Execute( @@ -662,8 +668,11 @@ Builtins.sformat("test -d %1 || mkdir -p %1", tmpdir) ) + # mount options determined by partitioner + mount_options = (part["fstopt"] || "").split(",") + # mount in read-only mode (safer) - mount_options = ["ro"] + mount_options << "ro" # add "nolock" if it's a NFS share (bnc#433893) if used_fs == :nfs @@ -672,12 +681,16 @@ end # join the options - mount_options_str = Builtins.mergestring(mount_options, ",") + mount_options_str = mount_options.uniq.join(",") + + # Use DM device if it's encrypted, plain device otherwise + # (bnc#889334) + device = part["crypt_device"] || part["device"] || "" mount_command = Builtins.sformat( "/bin/mount -o %1 %2 %3", mount_options_str, - Ops.get_string(part, "device", ""), + device, tmpdir ) @@ -717,7 +730,7 @@ else Builtins.y2error( "Mount failed, ignoring partition %1", - Ops.get_string(part, "device", "") + device ) @failed_mounts = Builtins.add(@failed_mounts, part) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.42/test/Makefile.am new/yast2-packager-3.1.44/test/Makefile.am --- old/yast2-packager-3.1.42/test/Makefile.am 2014-08-18 16:14:14.000000000 +0200 +++ new/yast2-packager-3.1.44/test/Makefile.am 2014-09-03 14:04:10.000000000 +0200 @@ -1,6 +1,7 @@ TESTS = \ addon_product_test.rb \ - packages_test.rb + packages_test.rb \ + space_calculation_test.rb TEST_EXTENSIONS = .rb RB_LOG_COMPILER = rspec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.42/test/data/luks_target_map.yml new/yast2-packager-3.1.44/test/data/luks_target_map.yml --- old/yast2-packager-3.1.42/test/data/luks_target_map.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-packager-3.1.44/test/data/luks_target_map.yml 2014-09-03 14:04:10.000000000 +0200 @@ -0,0 +1,147 @@ +--- +"/dev/btrfs": + device: "/dev/btrfs" + name: btrfs + partitions: [] + type: :CT_BTRFS + used_by_device: '' + used_by_type: :UB_NONE +"/dev/sda": + bios_id: '0x80' + bus: IDE + cyl_count: 16709 + cyl_size: 8225280 + device: "/dev/sda" + driver: ahci + driver_module: ahci + label: msdos + max_logical: 255 + max_primary: 4 + model: HARDDISK + name: sda + partitions: + - detected_fs: :swap + device: "/dev/sda1" + fsid: 130 + fstype: Linux swap + inactive: true + mount: swap + mountby: :uuid + name: sda1 + nr: 1 + region: + - 0 + - 262 + size_k: 2103296 + type: :primary + udev_id: + - ata-VBOX_HARDDISK_VB57271fd6-27adef38-part1 + - scsi-0ATA_VBOX_HARDDISK_VB57271fd6-27adef38-part1 + - scsi-1ATA_VBOX_HARDDISK_VB57271fd6-27adef38-part1 + - scsi-SATA_VBOX_HARDDISK_VB57271fd6-27adef38-part1 + udev_path: pci-0000:00:1f.2-ata-1.0-part1 + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :swap + uuid: f5f25b5d-22fd-4ed3-9134-715bc1899db5 + - boot: true + detected_fs: :btrfs + device: "/dev/sda2" + format: true + fsid: 131 + fstype: Linux native + inactive: true + mount: "/" + mountby: :uuid + name: sda2 + nr: 2 + region: + - 261 + - 5224 + size_k: 41946112 + subvol: + - create: true + name: "@/boot/grub2/i386-pc" + - create: true + name: "@/boot/grub2/x86_64-efi" + - create: true + name: "@/opt" + - create: true + name: "@/srv" + - create: true + name: "@/tmp" + - create: true + name: "@/usr/local" + - create: true + name: "@/var/crash" + - create: true + name: "@/var/lib/mailman" + - create: true + name: "@/var/lib/named" + - create: true + name: "@/var/lib/pgsql" + - create: true + name: "@/var/log" + - create: true + name: "@/var/opt" + - create: true + name: "@/var/spool" + - create: true + name: "@/var/tmp" + type: :primary + udev_id: + - ata-VBOX_HARDDISK_VB57271fd6-27adef38-part2 + - scsi-0ATA_VBOX_HARDDISK_VB57271fd6-27adef38-part2 + - scsi-1ATA_VBOX_HARDDISK_VB57271fd6-27adef38-part2 + - scsi-SATA_VBOX_HARDDISK_VB57271fd6-27adef38-part2 + udev_path: pci-0000:00:1f.2-ata-1.0-part2 + used_by: + - device: '12345' + type: :UB_BTRFS + used_by_device: '12345' + used_by_type: :UB_BTRFS + used_fs: :btrfs + userdata: + "/": snapshots + uuid: '12345' + - crypt_device: "/dev/mapper/cr_ata-VBOX_HARDDISK_VB57271fd6-27adef38-part3" + detected_fs: :xfs + device: "/dev/sda3" + enc_type: :luks + fsid: 131 + fstype: Linux native + inactive: true + mount: "/home" + mountby: :uuid + name: sda3 + nr: 3 + region: + - 5484 + - 11225 + size_k: 90165248 + type: :primary + udev_id: + - ata-VBOX_HARDDISK_VB57271fd6-27adef38-part3 + - scsi-0ATA_VBOX_HARDDISK_VB57271fd6-27adef38-part3 + - scsi-1ATA_VBOX_HARDDISK_VB57271fd6-27adef38-part3 + - scsi-SATA_VBOX_HARDDISK_VB57271fd6-27adef38-part3 + udev_path: pci-0000:00:1f.2-ata-1.0-part3 + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :xfs + uuid: bcbd324b-dcae-478e-94a6-fa6ef1a4a663 + proposal_name: 1. IDE Disk, 128.00 GiB, /dev/sda, VBOX-HARDDISK + sector_size: 512 + size_k: 134217728 + transport: :sata + type: :CT_DISK + udev_id: + - ata-VBOX_HARDDISK_VB57271fd6-27adef38 + - scsi-0ATA_VBOX_HARDDISK_VB57271fd6-27adef38 + - scsi-1ATA_VBOX_HARDDISK_VB57271fd6-27adef38 + - scsi-SATA_VBOX_HARDDISK_VB57271fd6-27adef38 + udev_path: pci-0000:00:1f.2-ata-1.0 + unique: 3OOL.F0a81fNDOj7 + used_by_device: '' + used_by_type: :UB_NONE + vendor: VBOX diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.42/test/data/nfs_target_map.yml new/yast2-packager-3.1.44/test/data/nfs_target_map.yml --- old/yast2-packager-3.1.42/test/data/nfs_target_map.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-packager-3.1.44/test/data/nfs_target_map.yml 2014-09-03 14:04:10.000000000 +0200 @@ -0,0 +1,81 @@ +--- +"/dev/nfs": + device: "/dev/nfs" + name: nfs + partitions: + - detected_fs: :nfs + device: nfs-host:/nfsroot + fstopt: noatime,nfsvers=3,nolock + fstype: NFS + inactive: true + mount: "/" + mountby: :device + name: nfs-host:/nfsroot + size_k: 528336896 + type: :nfs + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :nfs + type: :CT_NFS + used_by_device: '' + used_by_type: :UB_NONE +"/dev/sda": + bus: SCSI + cyl_count: 913 + cyl_size: 8225280 + device: "/dev/sda" + driver: hv_storvsc + driver_module: hv_storvsc + label: msdos + max_logical: 255 + max_primary: 4 + model: Virtual Disk + name: sda + partitions: + - detected_fs: :swap + device: "/dev/sda1" + fsid: 130 + fstype: Linux swap + name: sda1 + nr: 1 + region: + - 0 + - 17 + size_k: 128000 + type: :primary + udev_id: + - scsi-14d53465420202020f0b629d55569424d87c45d5d487ba648-part1 + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :swap + uuid: 650ac9f8-affc-4951-8c71-494d1606fb56 + - boot: true + detected_fs: :ext4 + device: "/dev/sda2" + fsid: 131 + fstype: Linux native + label: ar_sl12-dev + name: sda2 + nr: 2 + region: + - 126 + - 787 + size_k: 6313984 + type: :primary + udev_id: + - scsi-14d53465420202020f0b629d55569424d87c45d5d487ba648-part2 + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :ext4 + uuid: 9fe51394-d7de-470c-b176-10996fd09a43 + proposal_name: 1. SCSI Disk, 7.00 GiB, /dev/sda, Msft-Virtual Disk + sector_size: 512 + size_k: 7340032 + transport: :unknown + type: :CT_DISK + udev_id: + - scsi-14d53465420202020f0b629d55569424d87c45d5d487ba648 + unique: R7kM.3NysQ6jC4p5 + used_by_device: '' + used_by_type: :UB_NONE + vendor: Msft diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.42/test/data/xfs_target_map.yml new/yast2-packager-3.1.44/test/data/xfs_target_map.yml --- old/yast2-packager-3.1.42/test/data/xfs_target_map.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-packager-3.1.44/test/data/xfs_target_map.yml 2014-09-03 14:04:10.000000000 +0200 @@ -0,0 +1,90 @@ +--- +"/dev/vda": + bios_id: '0x80' + bus: None + cyl_count: 4307 + cyl_size: 8225280 + device: "/dev/vda" + driver: virtio-pci + driver_module: virtio_pci + label: msdos + max_logical: 15 + max_primary: 4 + name: vda + partitions: + - detected_fs: :xfs + device: "/dev/vda1" + fsid: 131 + fstype: Linux native + name: vda1 + nr: 1 + region: + - 0 + - 2220 + size_k: 17830912 + type: :primary + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :xfs + uuid: 00eea959-67c3-4223-a02d-2fd0dcbc725e + - detected_fs: :swap + device: "/dev/vda2" + fsid: 130 + fstype: "Linux \n swap" + inactive: true + mount: swap + mountby: :uuid + name: vda2 + nr: 2 + region: + - 2219 + - 263 + size_k: 2104320 + type: :primary + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :swap + uuid: 47f2f88d-8b05-46f2-b912-212348586d8f + - boot: true + detected_fs: :ext4 + device: "/dev/vda3" + fsid: 131 + fstype: Linux native + name: vda3 + nr: 3 + region: + - 2481 + - 1308 + size_k: 10490880 + type: :primary + fstopt: acl,user_xattr + mount: "/" + mountby: :uuid + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :ext4 + uuid: 4c486a9b-cc25-40ab-9c49-8203e62a8953 + - detected_fs: :xfs + device: "/dev/vda4" + fsid: 131 + fstype: Linux native + name: vda4 + nr: 4 + region: + - 3788 + - 519 + size_k: 4175872 + type: :primary + used_by_device: '' + used_by_type: :UB_NONE + used_fs: :xfs + uuid: 039bbc0d-ebe9-4b0e-ae6b-9b049398143e + proposal_name: '1. Disk, 33.00 GiB, /dev/vda, ' + sector_size: 512 + size_k: 34603008 + transport: :unknown + type: :CT_DISK + unique: KSbE.Fxp0d3BezAE + used_by_device: '' + used_by_type: :UB_NONE + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.42/test/space_calculation_test.rb new/yast2-packager-3.1.44/test/space_calculation_test.rb --- old/yast2-packager-3.1.42/test/space_calculation_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-packager-3.1.44/test/space_calculation_test.rb 2014-09-03 14:04:10.000000000 +0200 @@ -0,0 +1,113 @@ +#! /usr/bin/env rspec + +require_relative "./test_helper" +require 'yaml' + +Yast.import 'WFM' +Yast.import 'Stage' +Yast.import 'Mode' +Yast.import 'SCR' +Yast.import 'SpaceCalculation' + +DATA_PATH = File.join(File.expand_path(File.dirname(__FILE__)), "data") +SCR_TMPDIR_PATH = Yast::Path.new(".target.tmpdir") +SCR_BASH_PATH = Yast::Path.new(".target.bash") + +def stub_target_map(name, with_fstopt) + path = File.join(DATA_PATH, "#{name}_target_map.yml") + tm = YAML.load_file(path) + # Remove the "fstopt" key from every partition + if with_fstopt == false + tm.each do |k,v| + v["partitions"].each {|p| p.delete("fstopt") } + end + end + allow(Yast::WFM).to(receive(:call).with("wrapper_storage", + ["GetTargetMap"]).and_return(tm)) +end + +def expect_to_execute(command) + expect(Yast::SCR).to receive(:Execute).with(SCR_BASH_PATH, command) +end + +describe Yast::SpaceCalculation do + describe "#get_partition_info" do + + context "on test mount during installation" do + before do + allow(Yast::Stage).to receive(:stage).and_return "initial" + allow(Yast::Mode).to receive(:mode).and_return "normal" + + stub_target_map(target_map, with_options) + + allow(Yast::SCR).to receive(:Read).with(SCR_TMPDIR_PATH).and_return "/tmp" + allow(Yast::SCR).to receive(:Execute).with(SCR_BASH_PATH, /^test -d.* mkdir -p/) + allow(Yast::SCR).to receive(:Execute).with(SCR_BASH_PATH, /^\/bin\/umount/) + end + + context "on xfs" do + let(:target_map) { "xfs" } + + context "with mount options" do + let(:with_options) { true } + + it "honours the options and adds 'ro'" do + expect_to_execute(/mount -o acl,user_xattr,ro \/dev\/vda3/).and_return(-1) + Yast::SpaceCalculation.get_partition_info + end + end + + context "without mount options" do + let(:with_options) { false } + + it "uses 'ro'" do + expect_to_execute(/mount -o ro \/dev\/vda3/).and_return(-1) + Yast::SpaceCalculation.get_partition_info + end + end + end + + context "on nfs" do + let(:target_map) { "nfs" } + + context "with mount options" do + let(:with_options) { true } + + it "honours the options and adds 'ro' and 'nolock'" do + expect_to_execute(/mount -o noatime,nfsvers=3,nolock,ro nfs-host:\/nfsroot/).and_return(-1) + Yast::SpaceCalculation.get_partition_info + end + end + + context "without mount options" do + let(:with_options) { false } + + it "uses 'ro,nolock'" do + expect_to_execute(/mount -o ro,nolock nfs-host:\/nfsroot/).and_return(-1) + Yast::SpaceCalculation.get_partition_info + end + end + end + + context "on non encrypted device" do + let(:target_map) { "xfs" } + let(:with_options) { false } + + it "mounts the plain device" do + expect_to_execute(/mount -o ro \/dev\/vda3/).and_return(-1) + Yast::SpaceCalculation.get_partition_info + end + end + + context "on encrypted device" do + let(:target_map) { "luks" } + let(:with_options) { false } + + it "mounts the DM device" do + expect_to_execute(/mount -o ro \/dev\/mapper\/cr_ata-VBOX_HARDDISK_VB57271fd6-27adef38-part3/).and_return(-1) + Yast::SpaceCalculation.get_partition_info + end + end + end + end +end -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org