Blob Blame History Raw
From 0c86369274c23e6e5145bad7a5986d159ae99a27 Mon Sep 17 00:00:00 2001
From: Matus Marhefka <mmarhefk@redhat.com>
Date: Wed, 12 May 2021 08:45:07 +0200
Subject: [PATCH 1/3] install_vm.py: add possibility to install GUI system

---
 tests/install_vm.py             | 18 +++++++++++++++++-
 tests/kickstarts/test_suite.cfg | 18 ++++++++----------
 2 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/tests/install_vm.py b/tests/install_vm.py
index 3aea5fc4b69..22a1814dfd8 100755
--- a/tests/install_vm.py
+++ b/tests/install_vm.py
@@ -94,6 +94,12 @@ def parse_args():
         choices=['secureboot', 'normal'],
         help="Perform UEFI based installation, optionally with secure boot support."
     )
+    parser.add_argument(
+        "--install-gui",
+        dest="install_gui",
+        action='store_true',
+        help="Perform a GUI installation (default is installation without GUI)."
+    )
 
     return parser.parse_args()
 
@@ -156,6 +162,16 @@ def main():
                 "part /boot --fstype=xfs --size=512",
                 "part /boot --fstype=xfs --size=312\npart /boot/efi --fstype=efi --size=200"
             )
+        if data.install_gui:
+            gui_group="\n%packages\n@^graphical-server-environment\n"
+            if data.distro == "fedora":
+                gui_group="\n%packages\n@^Fedora Workstation\n"
+            content = content.replace("\n%packages\n", gui_group)
+            data.graphics_opt = "vnc"
+            data.inst_opt = "inst.graphical"
+        else:
+            data.graphics_opt = "none"
+            data.inst_opt = "inst.cmdline"
         outfile.write(content)
     data.kickstart = tmp_kickstart
     print("Using kickstart file: {0}".format(data.kickstart))
@@ -169,7 +185,7 @@ def main():
     # The kernel option 'net.ifnames=0' is used to disable predictable network
     # interface names, for more details see:
     # https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
-    command = 'virt-install --connect={libvirt} --name={domain} --memory={ram} --vcpus={cpu} --network {network} --disk {disk_spec} --initrd-inject={kickstart} --extra-args="inst.ks=file:/{ks_basename} ksdevice=eth0 net.ifnames=0 console=ttyS0,115200" --serial pty --graphics=none --noautoconsole --rng /dev/random --wait=-1 --location={url}'.format(**data.__dict__)
+    command = 'virt-install --connect={libvirt} --name={domain} --memory={ram} --vcpus={cpu} --network {network} --disk {disk_spec} --initrd-inject={kickstart} --extra-args="inst.ks=file:/{ks_basename} {inst_opt} ksdevice=eth0 net.ifnames=0 console=ttyS0,115200" --serial pty --graphics={graphics_opt} --noautoconsole --rng /dev/random --wait=-1 --location={url}'.format(**data.__dict__)
     if data.uefi == "normal":
         command = command+" --boot uefi"
     if data.uefi == "secureboot":
diff --git a/tests/kickstarts/test_suite.cfg b/tests/kickstarts/test_suite.cfg
index 2ee59cee073..d8a2344633b 100644
--- a/tests/kickstarts/test_suite.cfg
+++ b/tests/kickstarts/test_suite.cfg
@@ -12,8 +12,6 @@
 
 # Install a fresh new system (optional)
 install
-skipx
-text
 
 # To enable custom repositories for the machine after installation use:
 #repo --name=myrepo --baseurl=http://...
@@ -86,21 +84,21 @@ part pv.01 --grow --size=1
 volgroup VolGroup --pesize=4096 pv.01
 
 # Create particular logical volumes (optional)
-logvol / --fstype=xfs --name=root --vgname=VolGroup --size=8192 --grow
+logvol / --fstype=xfs --name=LogVol06 --vgname=VolGroup --size=3192 --grow
+# Ensure /usr Located On Separate Partition
+logvol /usr --fstype=xfs --name=LogVol08 --vgname=VolGroup --size=5000 --fsoptions="nodev"
+# Ensure /opt Located On Separate Partition
+logvol /opt --fstype=xfs --name=LogVol09 --vgname=VolGroup --size=1024 --fsoptions="nodev,nosuid"
+# Ensure /srv Located On Separate Partition
+logvol /srv --fstype=xfs --name=LogVol10 --vgname=VolGroup --size=1024 --fsoptions="nodev,nosuid"
 # Ensure /home Located On Separate Partition
 logvol /home --fstype=xfs --name=home --vgname=VolGroup --size=1024 --fsoptions="nodev"
-# Ensure /usr Located On Separate Partition
-logvol /usr --fstype=xfs --name=usr --vgname=VolGroup --size=2048 --fsoptions="nodev"
 # Ensure /tmp Located On Separate Partition
 logvol /tmp --fstype=xfs --name=tmp --vgname=VolGroup --size=1024 --fsoptions="nodev,nosuid,noexec"
-# Ensure /opt Located On Separate Partition
-logvol /opt --fstype=xfs --name=opt --vgname=VolGroup --size=512 --fsoptions="nodev,nosuid"
-# Ensure /srv Located On Separate Partition
-logvol /srv --fstype=xfs --name=srv --vgname=VolGroup --size=512 --fsoptions="nodev,nosuid"
 # Ensure /var/tmp Located On Separate Partition
 logvol /var/tmp --fstype=xfs --name=vartmp --vgname=VolGroup --size=1024 --fsoptions="nodev,nosuid,noexec"
 # Ensure /var Located On Separate Partition
-logvol /var --fstype=xfs --name=var --vgname=VolGroup --size=2048 --fsoptions="nodev"
+logvol /var --fstype=xfs --name=var --vgname=VolGroup --size=3072 --fsoptions="nodev"
 # Ensure /var/log Located On Separate Partition
 logvol /var/log --fstype=xfs --name=log --vgname=VolGroup --size=1024 --fsoptions="nodev,nosuid,noexec"
 # Ensure /var/log/audit Located On Separate Partition

From cb825b2a47ad83ca556389e48d3f30b3cb6ed086 Mon Sep 17 00:00:00 2001
From: Matus Marhefka <mmarhefk@redhat.com>
Date: Wed, 12 May 2021 09:49:38 +0200
Subject: [PATCH 2/3] install_vm.py: switch to Fedora 34 by default

Also updated kickstart file as `install` command
has been deprecated in Fedora 34:
https://docs.fedoraproject.org/my/fedora/f34/release-notes/sysadmin/Installation/#sect-kickstart-deprecated-removed
---
 tests/install_vm.py             | 2 +-
 tests/kickstarts/test_suite.cfg | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/tests/install_vm.py b/tests/install_vm.py
index 22a1814dfd8..ac15260b862 100755
--- a/tests/install_vm.py
+++ b/tests/install_vm.py
@@ -115,7 +115,7 @@ def main():
 
     if not data.url:
         if data.distro == "fedora":
-            data.url = "https://download.fedoraproject.org/pub/fedora/linux/releases/31/Everything/x86_64/os"
+            data.url = "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Everything/x86_64/os"
         elif data.distro == "centos7":
             data.url = "http://mirror.centos.org/centos/7/os/x86_64"
     if not data.url:
diff --git a/tests/kickstarts/test_suite.cfg b/tests/kickstarts/test_suite.cfg
index d8a2344633b..13b2f629ed6 100644
--- a/tests/kickstarts/test_suite.cfg
+++ b/tests/kickstarts/test_suite.cfg
@@ -10,9 +10,6 @@
 # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html
 # http://usgcb.nist.gov/usgcb/content/configuration/workstation-ks.cfg
 
-# Install a fresh new system (optional)
-install
-
 # To enable custom repositories for the machine after installation use:
 #repo --name=myrepo --baseurl=http://...
 &&YUM_EXTRA_REPO&&

From 8e85dd8c2c7cbcd36a68c8f1d0c4fe2eee43b541 Mon Sep 17 00:00:00 2001
From: Matus Marhefka <mmarhefk@redhat.com>
Date: Wed, 12 May 2021 11:09:29 +0200
Subject: [PATCH 3/3] Increase /usr size in SSGTS kickstart to be able to
 install F34 with GUI

---
 tests/kickstarts/test_suite.cfg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/kickstarts/test_suite.cfg b/tests/kickstarts/test_suite.cfg
index 13b2f629ed6..3c3300ef46d 100644
--- a/tests/kickstarts/test_suite.cfg
+++ b/tests/kickstarts/test_suite.cfg
@@ -83,11 +83,11 @@ volgroup VolGroup --pesize=4096 pv.01
 # Create particular logical volumes (optional)
 logvol / --fstype=xfs --name=LogVol06 --vgname=VolGroup --size=3192 --grow
 # Ensure /usr Located On Separate Partition
-logvol /usr --fstype=xfs --name=LogVol08 --vgname=VolGroup --size=5000 --fsoptions="nodev"
+logvol /usr --fstype=xfs --name=LogVol08 --vgname=VolGroup --size=5512 --fsoptions="nodev"
 # Ensure /opt Located On Separate Partition
 logvol /opt --fstype=xfs --name=LogVol09 --vgname=VolGroup --size=1024 --fsoptions="nodev,nosuid"
 # Ensure /srv Located On Separate Partition
-logvol /srv --fstype=xfs --name=LogVol10 --vgname=VolGroup --size=1024 --fsoptions="nodev,nosuid"
+logvol /srv --fstype=xfs --name=LogVol10 --vgname=VolGroup --size=512 --fsoptions="nodev,nosuid"
 # Ensure /home Located On Separate Partition
 logvol /home --fstype=xfs --name=home --vgname=VolGroup --size=1024 --fsoptions="nodev"
 # Ensure /tmp Located On Separate Partition