Hello community, here is the log from the commit of package autoyast2 for openSUSE:Factory checked in at 2016-09-20 13:20:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old) and /work/SRC/openSUSE:Factory/.autoyast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "autoyast2" Changes: -------- --- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes 2016-08-31 00:02:38.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.autoyast2.new/autoyast2.changes 2016-09-20 13:20:51.000000000 +0200 @@ -1,0 +2,17 @@ +Wed Sep 14 17:19:01 CEST 2016 - sch...@suse.de + +- Adding an missing PREP partition for PPC, BUT not for + Power8 system (powerNV). PowerNV do not have PREP partitions + and do not need any because they do not call grub2-install + (bnc#989392). +- 3.1.151 + +------------------------------------------------------------------- +Wed Sep 7 07:27:53 UTC 2016 - igonzalezs...@suse.com + +- Fix IP detection in AutoYaST installation rules + in order to find the correct profile when "ip route" + mentions "metric" (bnc#997548). +- 3.1.150 + +------------------------------------------------------------------- Old: ---- autoyast2-3.1.149.tar.bz2 New: ---- autoyast2-3.1.151.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ autoyast2.spec ++++++ --- /var/tmp/diff_new_pack.3KMgAN/_old 2016-09-20 13:20:53.000000000 +0200 +++ /var/tmp/diff_new_pack.3KMgAN/_new 2016-09-20 13:20:53.000000000 +0200 @@ -17,7 +17,7 @@ Name: autoyast2 -Version: 3.1.149 +Version: 3.1.151 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ autoyast2-3.1.149.tar.bz2 -> autoyast2-3.1.151.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.149/package/autoyast2.changes new/autoyast2-3.1.151/package/autoyast2.changes --- old/autoyast2-3.1.149/package/autoyast2.changes 2016-08-26 14:10:05.000000000 +0200 +++ new/autoyast2-3.1.151/package/autoyast2.changes 2016-09-15 13:09:13.000000000 +0200 @@ -1,4 +1,21 @@ ------------------------------------------------------------------- +Wed Sep 14 17:19:01 CEST 2016 - sch...@suse.de + +- Adding an missing PREP partition for PPC, BUT not for + Power8 system (powerNV). PowerNV do not have PREP partitions + and do not need any because they do not call grub2-install + (bnc#989392). +- 3.1.151 + +------------------------------------------------------------------- +Wed Sep 7 07:27:53 UTC 2016 - igonzalezs...@suse.com + +- Fix IP detection in AutoYaST installation rules + in order to find the correct profile when "ip route" + mentions "metric" (bnc#997548). +- 3.1.150 + +------------------------------------------------------------------- Fri Aug 26 09:39:55 UTC 2016 - kanders...@suse.com - Profile Location: Use Report instead of Popup to not block diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.149/package/autoyast2.spec new/autoyast2-3.1.151/package/autoyast2.spec --- old/autoyast2-3.1.149/package/autoyast2.spec 2016-08-26 14:10:05.000000000 +0200 +++ new/autoyast2-3.1.151/package/autoyast2.spec 2016-09-15 13:09:13.000000000 +0200 @@ -17,7 +17,7 @@ Name: autoyast2 -Version: 3.1.149 +Version: 3.1.151 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.149/src/include/autoinstall/autopart.rb new/autoyast2-3.1.151/src/include/autoinstall/autopart.rb --- old/autoyast2-3.1.149/src/include/autoinstall/autopart.rb 2016-08-26 14:10:05.000000000 +0200 +++ new/autoyast2-3.1.151/src/include/autoinstall/autopart.rb 2016-09-15 13:09:13.000000000 +0200 @@ -270,7 +270,12 @@ end def try_add_boot(conf, disk) - conf = deep_copy(conf) + tc = Builtins.eval(conf) + # If it is a ppc but not a baremetal Power8 system (powerNV). + # powerNV do not have prep partition and do not need any because + # they do not call grub2-install (bnc#989392). + return tc if Arch.ppc && Arch.board_powernv + disk = deep_copy(disk) dlabel = disk.fetch("label", "") root = Ops.greater_than( @@ -279,16 +284,13 @@ end), 0 ) - tc = Builtins.eval(conf) + if !@planHasBoot && root && - (Ops.greater_than( - Ops.get_integer(disk, "cyl_count", 0), - Partitions.BootCyl - ) || - Arch.ia64 || - Arch.ppc || - Arch.sparc) + (Ops.greater_than( + Ops.get_integer(disk, "cyl_count", 0), + Partitions.BootCyl) || Arch.ppc) pb = {} + # PPCs do not need /boot but prep partition only. if !Arch.ppc Ops.set(pb, "mount", Partitions.BootMount) Ops.set(pb, "fsys", Partitions.DefaultBootFs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.149/src/modules/AutoInstallRules.rb new/autoyast2-3.1.151/src/modules/AutoInstallRules.rb --- old/autoyast2-3.1.149/src/modules/AutoInstallRules.rb 2016-08-26 14:10:05.000000000 +0200 +++ new/autoyast2-3.1.151/src/modules/AutoInstallRules.rb 2016-09-15 13:09:13.000000000 +0200 @@ -1111,14 +1111,17 @@ nil end + # Regexp to extract the IP from the routes table + HOSTADDRESS_REGEXP = /src ([\w.]+) /.freeze + # Return the IP through iproute2 tools # # @return [String] IP address def hostaddress return @hostaddress unless @hostaddress.nil? ip_route = SCR.Execute(path(".target.bash_output"), "/usr/sbin/ip route") - regexp = /src ([\w.]+) \n/ - if ret = ip_route["stdout"][regexp, 1] + if ret = ip_route["stdout"][HOSTADDRESS_REGEXP, 1] + log.info "Found IP address: #{ret}" ret else log.warn "Cannot evaluate IP address: #{ip_route}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.149/test/fixtures/output/ip_route.out new/autoyast2-3.1.151/test/fixtures/output/ip_route.out --- old/autoyast2-3.1.149/test/fixtures/output/ip_route.out 2016-08-26 14:10:05.000000000 +0200 +++ new/autoyast2-3.1.151/test/fixtures/output/ip_route.out 2016-09-15 13:09:14.000000000 +0200 @@ -1,3 +1,4 @@ -10.13.32.0/24 dev eth0 proto kernel scope link src 10.13.32.195 +default via 10.13.32.1 dev eth0 proto dhcp +10.13.32.0/24 dev eth0 proto kernel scope link src 10.13.32.195 metric 600 10.163.0.1 dev tun0 proto kernel scope link src 10.163.0.6 -10.163.2.0/28 dev eth1 proto kernel scope link src 10.163.2.1 +10.163.2.0/28 dev eth1 proto kernel scope link src 10.163.2.1 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.149/test/fixtures/profiles/ppc_partitions.xml new/autoyast2-3.1.151/test/fixtures/profiles/ppc_partitions.xml --- old/autoyast2-3.1.149/test/fixtures/profiles/ppc_partitions.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/autoyast2-3.1.151/test/fixtures/profiles/ppc_partitions.xml 2016-09-15 13:09:14.000000000 +0200 @@ -0,0 +1,316 @@ +<?xml version="1.0"?> +<!DOCTYPE profile> +<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> + <partitioning config:type="list"> + <drive> + <device>/dev/rhel</device> + <disklabel>msdos</disklabel> + <enable_snapshots config:type="boolean">true</enable_snapshots> + <initialize config:type="boolean">true</initialize> + <partitions config:type="list"> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">ext4</filesystem> + <format config:type="boolean">true</format> + <loop_fs config:type="boolean">false</loop_fs> + <lv_name>home</lv_name> + <mountby config:type="symbol">device</mountby> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>224730808320</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">xfs</filesystem> + <format config:type="boolean">true</format> + <loop_fs config:type="boolean">false</loop_fs> + <lv_name>root</lv_name> + <mountby config:type="symbol">device</mountby> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>53687091200</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">swap</filesystem> + <format config:type="boolean">true</format> + <fstopt>defaults</fstopt> + <loop_fs config:type="boolean">false</loop_fs> + <lv_name>swap</lv_name> + <mount>swap</mount> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">130</partition_id> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>4294967296</size> + </partition> + </partitions> + <pesize>4M</pesize> + <type config:type="symbol">CT_LVM</type> + <use>all</use> + </drive> + <drive> + <device>/dev/rhel_ltc-tuleta12</device> + <disklabel>msdos</disklabel> + <enable_snapshots config:type="boolean">true</enable_snapshots> + <initialize config:type="boolean">true</initialize> + <partitions config:type="list"> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">ext4</filesystem> + <format config:type="boolean">true</format> + <loop_fs config:type="boolean">false</loop_fs> + <lv_name>home</lv_name> + <mountby config:type="symbol">device</mountby> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>81017176064</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">xfs</filesystem> + <format config:type="boolean">true</format> + <loop_fs config:type="boolean">false</loop_fs> + <lv_name>root</lv_name> + <mountby config:type="symbol">device</mountby> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>53687091200</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">swap</filesystem> + <format config:type="boolean">true</format> + <fstopt>defaults</fstopt> + <loop_fs config:type="boolean">false</loop_fs> + <lv_name>swap</lv_name> + <mount>swap</mount> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">130</partition_id> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>4294967296</size> + </partition> + </partitions> + <pesize>4M</pesize> + <type config:type="symbol">CT_LVM</type> + <use>all</use> + </drive> + <drive> + <device>/dev/sda</device> + <disklabel>msdos</disklabel> + <enable_snapshots config:type="boolean">true</enable_snapshots> + <initialize config:type="boolean">true</initialize> + <partitions config:type="list"> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <format config:type="boolean">false</format> + <loop_fs config:type="boolean">false</loop_fs> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">65</partition_id> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>8225280</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">xfs</filesystem> + <format config:type="boolean">true</format> + <loop_fs config:type="boolean">false</loop_fs> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">131</partition_id> + <partition_nr config:type="integer">2</partition_nr> + <resize config:type="boolean">false</resize> + <size>516062720</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <format config:type="boolean">false</format> + <loop_fs config:type="boolean">false</loop_fs> + <lvm_group>rhel_ltc-tuleta12</lvm_group> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">142</partition_id> + <partition_nr config:type="integer">3</partition_nr> + <resize config:type="boolean">false</resize> + <size>139057069568</size> + </partition> + </partitions> + <pesize/> + <type config:type="symbol">CT_DISK</type> + <use>all</use> + </drive> + <drive> + <device>/dev/sdb</device> + <disklabel>gpt</disklabel> + <enable_snapshots config:type="boolean">true</enable_snapshots> + <initialize config:type="boolean">true</initialize> + <partitions config:type="list"> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <format config:type="boolean">false</format> + <loop_fs config:type="boolean">false</loop_fs> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">264</partition_id> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>8225280</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">ext4</filesystem> + <format config:type="boolean">true</format> + <loop_fs config:type="boolean">false</loop_fs> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">264</partition_id> + <partition_nr config:type="integer">2</partition_nr> + <resize config:type="boolean">false</resize> + <size>8225280</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">swap</filesystem> + <format config:type="boolean">true</format> + <fstopt>defaults</fstopt> + <loop_fs config:type="boolean">false</loop_fs> + <mount>swap</mount> + <mountby config:type="symbol">uuid</mountby> + <partition_id config:type="integer">130</partition_id> + <partition_nr config:type="integer">3</partition_nr> + <resize config:type="boolean">false</resize> + <size>5687639552</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">ext4</filesystem> + <format config:type="boolean">true</format> + <loop_fs config:type="boolean">false</loop_fs> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">131</partition_id> + <partition_nr config:type="integer">4</partition_nr> + <resize config:type="boolean">false</resize> + <size>133872909824</size> + </partition> + </partitions> + <pesize/> + <type config:type="symbol">CT_DISK</type> + <use>all</use> + </drive> + <drive> + <device>/dev/sdc</device> + <disklabel>gpt</disklabel> + <enable_snapshots config:type="boolean">true</enable_snapshots> + <initialize config:type="boolean">true</initialize> + <partitions config:type="list"> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">btrfs</filesystem> + <format config:type="boolean">true</format> + <fstopt>defaults</fstopt> + <loop_fs config:type="boolean">false</loop_fs> + <mount>/</mount> + <mountby config:type="symbol">uuid</mountby> + <partition_id config:type="integer">131</partition_id> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>42943544832</size> + <subvolumes config:type="list"> + <listentry>opt</listentry> + <listentry>srv</listentry> + <listentry>tmp</listentry> + <listentry>usr/local</listentry> + <listentry>var/cache</listentry> + <listentry>var/crash</listentry> + <listentry>var/lib/libvirt/images</listentry> + <listentry>var/lib/machines</listentry> + <listentry>var/lib/mailman</listentry> + <listentry>var/lib/mariadb</listentry> + <listentry>var/lib/mysql</listentry> + <listentry>var/lib/named</listentry> + <listentry>var/lib/pgsql</listentry> + <listentry>var/log</listentry> + <listentry>var/opt</listentry> + <listentry>var/spool</listentry> + <listentry>var/tmp</listentry> + </subvolumes> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">xfs</filesystem> + <format config:type="boolean">true</format> + <fstopt>defaults</fstopt> + <loop_fs config:type="boolean">false</loop_fs> + <mount>/home</mount> + <mountby config:type="symbol">uuid</mountby> + <partition_id config:type="integer">131</partition_id> + <partition_nr config:type="integer">2</partition_nr> + <resize config:type="boolean">false</resize> + <size>240832904704</size> + </partition> + </partitions> + <pesize/> + <type config:type="symbol">CT_DISK</type> + <use>all</use> + </drive> + <drive> + <device>/dev/sdd</device> + <disklabel>msdos</disklabel> + <enable_snapshots config:type="boolean">true</enable_snapshots> + <initialize config:type="boolean">true</initialize> + <partitions config:type="list"> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <format config:type="boolean">false</format> + <loop_fs config:type="boolean">false</loop_fs> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">65</partition_id> + <partition_nr config:type="integer">1</partition_nr> + <resize config:type="boolean">false</resize> + <size>8225280</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <filesystem config:type="symbol">xfs</filesystem> + <format config:type="boolean">true</format> + <loop_fs config:type="boolean">false</loop_fs> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">131</partition_id> + <partition_nr config:type="integer">2</partition_nr> + <resize config:type="boolean">false</resize> + <size>1065516544</size> + </partition> + <partition> + <create config:type="boolean">true</create> + <crypt_fs config:type="boolean">false</crypt_fs> + <format config:type="boolean">false</format> + <loop_fs config:type="boolean">false</loop_fs> + <lvm_group>rhel</lvm_group> + <mountby config:type="symbol">device</mountby> + <partition_id config:type="integer">142</partition_id> + <partition_nr config:type="integer">3</partition_nr> + <resize config:type="boolean">false</resize> + <size>282707787264</size> + </partition> + </partitions> + <pesize/> + <type config:type="symbol">CT_DISK</type> + <use>all</use> + </drive> + </partitioning> +</profile> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.149/test/fixtures/storage/target_ppc.yml new/autoyast2-3.1.151/test/fixtures/storage/target_ppc.yml --- old/autoyast2-3.1.149/test/fixtures/storage/target_ppc.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/autoyast2-3.1.151/test/fixtures/storage/target_ppc.yml 2016-09-15 13:09:14.000000000 +0200 @@ -0,0 +1,117 @@ +--- +"/dev/btrfs": + device: "/dev/btrfs" + name: btrfs + partitions: [] + type: :CT_BTRFS + used_by_device: '' + used_by_type: :UB_NONE +"/dev/sda": + bus: SCSI + cyl_count: 16971 + cyl_size: 8225280 + dasd_format: 0 + dasd_type: 0 + device: "/dev/sda" + driver: ipr + driver_module: ipr + label: msdos + max_logical: 255 + max_primary: 4 + model: IPR-0 6AB10B00 + name: sda + partitions: [] + proposal_name: 1. SCSI Disk, 130.01 GiB, /dev/sda, IBM-IPR-0 6AB10B00 + sector_size: 512 + size_k: 136323072 + transport: :unknown + type: :CT_DISK + udev_id: + - scsi-1IBM_IPR-0_6AB10B0000000080 + udev_path: pci-0001=>04=>00.0-scsi-0=>2=>0=>0 + unique: R7kM.8Hl8kKEBU0D + used_by_device: '' + used_by_type: :UB_NONE + vendor: IBM +"/dev/sdb": + bus: SCSI + cyl_count: 16971 + cyl_size: 8225280 + dasd_format: 0 + dasd_type: 0 + device: "/dev/sdb" + driver: ipr + driver_module: ipr + label: gpt + max_logical: 0 + max_primary: 128 + model: IPR-0 6AB10B00 + name: sdb + partitions: [] + proposal_name: 2. SCSI Disk, 130.01 GiB, /dev/sdb, IBM-IPR-0 6AB10B00 + sector_size: 512 + size_k: 136323072 + transport: :unknown + type: :CT_DISK + udev_id: + - scsi-1IBM_IPR-0_6AB10B0000000060 + udev_path: pci-0001=>04=>00.0-scsi-0=>2=>1=>0 + unique: uI_Q.8Hl8kKEBU0D + used_by_device: '' + used_by_type: :UB_NONE + vendor: IBM +"/dev/sdc": + bus: SCSI + cyl_count: 34502 + cyl_size: 8225280 + dasd_format: 0 + dasd_type: 0 + device: "/dev/sdc" + driver: ipr + driver_module: ipr + label: gpt + max_logical: 0 + max_primary: 128 + model: IPR-0 6AB10B00 + name: sdc + partitions: [] + proposal_name: 3. SCSI Disk, 264.30 GiB, /dev/sdc, IBM-IPR-0 6AB10B00 + sector_size: 512 + size_k: 277143552 + transport: :unknown + type: :CT_DISK + udev_id: + - scsi-0IBM_IPR-0_6AB10B00_0 + - scsi-1IBM_IPR-0_6AB10B0000000040 + udev_path: pci-0001=>04=>00.0-scsi-0=>2=>2=>0 + unique: LUEV.8Hl8kKEBU0D + used_by_device: '' + used_by_type: :UB_NONE + vendor: IBM +"/dev/sdd": + bus: SCSI + cyl_count: 34502 + cyl_size: 8225280 + dasd_format: 0 + dasd_type: 0 + device: "/dev/sdd" + driver: ipr + driver_module: ipr + label: msdos + max_logical: 255 + max_primary: 4 + model: IPR-0 6AB10B00 + name: sdd + partitions: [] + proposal_name: 4. SCSI Disk, 264.30 GiB, /dev/sdd, IBM-IPR-0 6AB10B00 + sector_size: 512 + size_k: 277143552 + transport: :unknown + type: :CT_DISK + udev_id: + - scsi-1IBM_IPR-0_6AB10B0000000020 + udev_path: pci-0001=>04=>00.0-scsi-0=>2:3:0 + unique: ofUZ.8Hl8kKEBU0D + used_by_device: '' + used_by_type: :UB_NONE + vendor: IBM diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.149/test/include/autopart_test.rb new/autoyast2-3.1.151/test/include/autopart_test.rb --- old/autoyast2-3.1.149/test/include/autopart_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/autoyast2-3.1.151/test/include/autopart_test.rb 2016-09-15 13:09:14.000000000 +0200 @@ -0,0 +1,112 @@ +#!/usr/bin/env rspec + +require_relative "../test_helper" +require "yaml" +require "yast" + +Yast.import "Profile" +Yast.import "Arch" +Yast.import "Partitions" + +describe "Yast::AutoinstallAutopartInclude" do + FIXTURES_PATH = File.join(File.dirname(__FILE__), '../fixtures') + + module DummyYast + class AutoinstallAutopartClient < Yast::Client + def main + Yast.include self, "autoinstall/autopart.rb" + @planHasBoot=false + end + + def initialize + main + end + def plan_has_boot_or_prep_partition + @planHasBoot + end + def plan_has_boot_or_prep_partition=(v) + @planHasBoot = v + end + end + end + + subject(:client) { DummyYast::AutoinstallAutopartClient.new } + + describe "#autopart" do + + context "ppc partitioning" do + let(:target_map) { YAML.load_file(File.join(FIXTURES_PATH, 'storage', 'target_ppc.yml')) } + let(:ay_device) { Yast::Profile.current['partitioning'].find {|x| x["device"] == checked_device} } + before do + allow(Yast::Arch).to receive(:ppc).and_return(true) + allow(Yast::Partitions).to receive(:MinimalNeededBootsize).and_return(800000) + allow(Yast::Partitions).to receive(:DefaultBootFs).and_return(:ext4) + allow(Yast::Partitions).to receive(:FsidBoot).and_return(Yast::Partitions.fsid_gpt_prep) + Yast::Profile.ReadXML(File.join(FIXTURES_PATH, 'profiles', 'ppc_partitions.xml')) + end + + context "AY configuration file has no prep partition" do + before do + client.plan_has_boot_or_prep_partition=false + end + + context "checking device with root partition" do + let(:checked_device) { "/dev/sdc" } + + it "do not add an additional prep partition if it is a powernv system" do + # bnc#989392 + allow(Yast::Arch).to receive(:board_powernv).and_return(true) + ret = client.try_add_boot( ay_device, target_map[checked_device]) + expect(ret["partitions"].size).to eq(ay_device["partitions"].size) + end + + it "adds an additional prep partition if it is NOT a powernv system" do + allow(Yast::Arch).to receive(:board_powernv).and_return(false) + ret = client.try_add_boot( ay_device, target_map[checked_device]) + expect(ret["partitions"].size).to eq(ay_device["partitions"].size + 1) + # added disk has no mount point + expect((ret["partitions"] - ay_device["partitions"]).first.key?("mount")).to eq(false) + # added disk has no fsys + expect((ret["partitions"] - ay_device["partitions"]).first.key?("fsys")).to eq(false) + end + end + + context "checking device without root partition" do + let(:checked_device) { "/dev/sdb" } + + it "do not add an additional prep partition for ppc" do + allow(Yast::Arch).to receive(:board_powernv).and_return(false) + ret = client.try_add_boot( ay_device, target_map[checked_device]) + expect(ret["partitions"].size).to eq(ay_device["partitions"].size) + end + end + end + + context "AY configuration file has a prep partition" do + before do + client.plan_has_boot_or_prep_partition=true + end + + context "checking device with root partition" do + let(:checked_device) { "/dev/sdc" } + + it "do not add an additional prep partition if it is NOT a powernv system" do + allow(Yast::Arch).to receive(:board_powernv).and_return(false) + ret = client.try_add_boot( ay_device, target_map[checked_device]) + expect(ret["partitions"].size).to eq(ay_device["partitions"].size) + end + end + + context "checking device without root partition" do + let(:checked_device) { "/dev/sdb" } + + it "do not add an additional prep partition for ppc" do + allow(Yast::Arch).to receive(:board_powernv).and_return(false) + ret = client.try_add_boot( ay_device, target_map[checked_device]) + expect(ret["partitions"].size).to eq(ay_device["partitions"].size) + end + end + end + end + end +end