xci: Vagrantfile: Add openSUSE Leap 42.2 and 42.3 support 17/40117/1
authorMarkos Chandras <mchandras@suse.de>
Thu, 24 Aug 2017 11:58:29 +0000 (12:58 +0100)
committerMarkos Chandras <mchandras@suse.de>
Thu, 24 Aug 2017 15:16:34 +0000 (16:16 +0100)
Add support for testing the XCI in the latest openSUSE Leap releases.

Change-Id: I9b649b7076e031b162a10a976debf305299cf4f7
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/Vagrantfile

index cdcd705..d58ed62 100644 (file)
@@ -87,4 +87,54 @@ Vagrant.configure(2) do |config|
       }
     end
   end
+
+  config.vm.define "opensuse422" do |leap422|
+    leap422.disksize.size = disk_size
+    leap422.vm.box = "opensuse/openSUSE-42.2-x86_64"
+    leap422.vm.provision "shell" do |s|
+      # NOTE(hwoarang) The parted version in Leap 42.2 can't do an online
+      # partition resize so we must create a new one and attach it to the
+      # btrfs filesystem.
+      s.privileged = true,
+      s.inline = <<-SHELL
+        cd /vagrant
+        echo -e 'd\n2\nn\np\n\n\n\nn\nw' | fdisk /dev/sda
+        PART_END=$(fdisk -l /dev/sda | grep ^/dev/sda2 | awk '{print $4}')
+        resizepart /dev/sda 2 $PART_END
+        btrfs fi resize max /
+        export XCI_FLAVOR=${XCI_FLAVOR:-mini}
+        export VM_CPU=${VM_CPU:-2}
+        export VM_DISK=${VM_DISK:-40}
+        export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-2048}
+        export VM_DOMAIN_TYPE=qemu
+        [[ ! -e ${HOME}/.ssh/id_rsa ]] && ssh-keygen -q -P '' -f ${HOME}/.ssh/id_rsa
+        ./xci-deploy.sh
+      SHELL
+    end
+  end
+
+  config.vm.define "opensuse423" do |leap423|
+    leap423.disksize.size = disk_size
+    leap423.vm.box = "opensuse/openSUSE-42.3-x86_64"
+    leap423.vm.provision "shell" do |s|
+      # NOTE(hwoarang) The parted version in Leap 42.3 can't do an online
+      # partition resize so we must create a new one and attach it to the
+      # btrfs filesystem.
+      s.privileged = true,
+      s.inline = <<-SHELL
+        cd /vagrant
+        echo -e 'd\n2\nn\np\n\n\n\nn\nw' | fdisk /dev/sda
+        PART_END=$(fdisk -l /dev/sda | grep ^/dev/sda2 | awk '{print $4}')
+        resizepart /dev/sda 2 $PART_END
+        btrfs fi resize max /
+        export XCI_FLAVOR=${XCI_FLAVOR:-mini}
+        export VM_CPU=${VM_CPU:-2}
+        export VM_DISK=${VM_DISK:-40}
+        export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-2048}
+        export VM_DOMAIN_TYPE=qemu
+        [[ ! -e ${HOME}/.ssh/id_rsa ]] && ssh-keygen -q -P '' -f ${HOME}/.ssh/id_rsa
+        ./xci-deploy.sh
+      SHELL
+    end
+  end
 end