diff --git a/.gitignore b/.gitignore index 3d44922..e075104 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ +/install-*.img /tests/test-results/ /tests/trash directory.* + +# temporary files during image generation +/rootfs-* +/yum-*.conf diff --git a/installimg/8.2.testing b/installimg/8.2.testing new file mode 120000 index 0000000..8b17d29 --- /dev/null +++ b/installimg/8.2.testing @@ -0,0 +1 @@ +8.2.updates \ No newline at end of file diff --git a/installimg/8.2.updates/etc/systemd/system/getty@tty2.service b/installimg/8.2.updates/etc/systemd/system/getty@tty2.service new file mode 100644 index 0000000..3e0dcb2 --- /dev/null +++ b/installimg/8.2.updates/etc/systemd/system/getty@tty2.service @@ -0,0 +1,41 @@ +# This file is based on the service file from systemd. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/tty0 + +[Service] +# the VT is cleared by TTYVTDisallocate +ExecStart=-/sbin/agetty --autologin root --noclear %I +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= + +[Install] +WantedBy=getty.target diff --git a/installimg/8.2.updates/etc/systemd/system/installer.service b/installimg/8.2.updates/etc/systemd/system/installer.service new file mode 100644 index 0000000..a717b3b --- /dev/null +++ b/installimg/8.2.updates/etc/systemd/system/installer.service @@ -0,0 +1,12 @@ +[Unit] +Description=XCP-ng Installer +Requires=systemd-udev-settle.service interface-rename-sideway.service early-blacklist.service +After=systemd-udev-settle.service interface-rename-sideway.service early-blacklist.service getty@tty2.service + +[Service] +Type=forking +SendSIGHUP=yes +ExecStart=/opt/xensource/installer/preinit -- + +[Install] +WantedBy=multi-user.target diff --git a/installimg/8.3.0/etc/systemd/system/installer-getty@.service b/installimg/8.3.0/etc/systemd/system/installer-getty@.service new file mode 100644 index 0000000..3ebd3f4 --- /dev/null +++ b/installimg/8.3.0/etc/systemd/system/installer-getty@.service @@ -0,0 +1,41 @@ +# This file is based on the service file from systemd. + +[Unit] +Description=Installer Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/tty0 + +[Service] +# the VT is cleared by TTYVTDisallocate +ExecStart=-/sbin/agetty --autologin root --noclear %I +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= + +[Install] +WantedBy=getty.target diff --git a/installimg/8.3.0/etc/systemd/system/installer.service b/installimg/8.3.0/etc/systemd/system/installer.service new file mode 100644 index 0000000..a717b3b --- /dev/null +++ b/installimg/8.3.0/etc/systemd/system/installer.service @@ -0,0 +1,12 @@ +[Unit] +Description=XCP-ng Installer +Requires=systemd-udev-settle.service interface-rename-sideway.service early-blacklist.service +After=systemd-udev-settle.service interface-rename-sideway.service early-blacklist.service getty@tty2.service + +[Service] +Type=forking +SendSIGHUP=yes +ExecStart=/opt/xensource/installer/preinit -- + +[Install] +WantedBy=multi-user.target diff --git a/installimg/8.3.testing b/installimg/8.3.testing new file mode 120000 index 0000000..9f4a0fb --- /dev/null +++ b/installimg/8.3.testing @@ -0,0 +1 @@ +8.3.0 \ No newline at end of file diff --git a/installimg/8.3.updates b/installimg/8.3.updates new file mode 120000 index 0000000..9f4a0fb --- /dev/null +++ b/installimg/8.3.updates @@ -0,0 +1 @@ +8.3.0 \ No newline at end of file diff --git a/mock-configs/8.2.testing-x86_64.cfg b/mock-configs/8.2.testing-x86_64.cfg new file mode 100644 index 0000000..5861d0d --- /dev/null +++ b/mock-configs/8.2.testing-x86_64.cfg @@ -0,0 +1,321 @@ +## modified from centos-7-x86_64.cfg + +config_opts['root'] = '8.2.testing-x86_64' +config_opts['target_arch'] = 'x86_64' +config_opts['legal_host_arches'] = ('x86_64',) + +# This list is taken from 'epel-7-x86_64' @buildsys-build group, minus the +# 'epel-*' specific stuff. +#config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' + +# This list from: +# rpm --root $PWD/xcpng821-installimg/ --dbpath /var/lib/rpm -qa | sort | sed "s/\(.*\)-[^-]*-[^-]*$/\1/" +config_opts['chroot_setup_cmd'] = 'install \ +--disableplugin=* \ +GeoIP \ +acl \ +aic94xx-firmware \ +audit-libs \ +avago-megaraid-sas \ +avago-mpt3sas \ +basesystem \ +bash \ +bind-libs-lite \ +bind-license \ +biosdevname \ +boost-system \ +boost-thread \ +bridge-utils \ +broadcom-bnxt-en \ +bzip2 \ +bzip2-libs \ +ca-certificates \ +chelsio-cxgb4 \ +chkconfig \ +chrony \ +cisco-enic \ +cisco-fnic \ +coreutils \ +cpio \ +cracklib \ +cracklib-dicts \ +cryptsetup-libs \ +curl \ +cyrus-sasl-lib \ +dbus \ +dbus-libs \ +device-mapper \ +device-mapper-event \ +device-mapper-event-libs \ +device-mapper-libs \ +device-mapper-multipath \ +device-mapper-multipath-libs \ +device-mapper-persistent-data \ +dhclient \ +dhcp-common \ +dhcp-libs \ +diffutils \ +dmidecode \ +e2fsprogs \ +e2fsprogs-libs \ +edk2 \ +efibootmgr \ +efivar-libs \ +elfutils-default-yama-scope \ +elfutils-libelf \ +elfutils-libs \ +emulex-lpfc \ +ethtool \ +expat \ +fcoe-utils \ +file-libs \ +filesystem \ +findutils \ +fipscheck \ +fipscheck-lib \ +gawk \ +gdbm \ +gdisk \ +glib2 \ +glibc \ +glibc-common \ +gmp \ +gnupg2 \ +gpgme \ +grep \ +gssproxy \ +gzip \ +hardlink \ +host-installer-startup \ +hostname \ +hwdata \ +info \ +initscripts \ +intel-e1000e \ +intel-fm10k \ +intel-i40e \ +intel-ice \ +intel-igb \ +intel-ixgbe \ +iproute \ +iputils \ +ipxe \ +iscsi-initiator-utils \ +iscsi-initiator-utils-iscsiuio \ +json-c \ +kbd \ +kbd-legacy \ +kbd-misc \ +kernel \ +kernel-alt \ +keyutils \ +keyutils-libs \ +kmod \ +kmod-libs \ +kpartx \ +krb5-libs \ +libacl \ +libaio \ +libassuan \ +libattr \ +libbasicobjects \ +libblkid \ +libcap \ +libcap-ng \ +libcollection \ +libcom_err \ +libconfig \ +libcurl \ +libdb \ +libdb-utils \ +libedit \ +libempserver \ +libestr \ +libevent \ +libfastjson \ +libffi \ +libgcc \ +libgcrypt \ +libgpg-error \ +libicu \ +libidn \ +libini_config \ +libmnl \ +libmount \ +libnfsidmap \ +libnl3 \ +libpath_utils \ +libpciaccess \ +libpwquality \ +librados2 \ +libref_array \ +libreport-filesystem \ +libseccomp \ +libselinux \ +libsemanage \ +libsepol \ +libss \ +libssh2 \ +libstdc++ \ +libsysfs \ +libtasn1 \ +libtirpc \ +libuser \ +libutempter \ +libuuid \ +libverto \ +libverto-libevent \ +libxml2 \ +linux-firmware \ +lldpad \ +logrotate \ +lua \ +lvm2 \ +lvm2-libs \ +lz4 \ +lzo \ +mdadm \ +microsemi-smartpqi \ +ncurses \ +ncurses-base \ +ncurses-libs \ +net-tools \ +newt \ +newt-python \ +nfs-utils \ +nspr \ +nss \ +nss-pem \ +nss-softokn \ +nss-softokn-freebl \ +nss-sysinit \ +nss-tools \ +nss-util \ +openldap \ +openssh \ +openssh-clients \ +openssh-server \ +openssl-libs \ +p11-kit \ +p11-kit-trust \ +pam \ +pciutils \ +pciutils-libs \ +pcre \ +pinentry \ +popt \ +procps-ng \ +psmisc \ +pth \ +pygpgme \ +pyliblzma \ +python \ +python-iniparse \ +python-libs \ +python-pycurl \ +python-urlgrabber \ +pyxattr \ +qlogic-fastlinq \ +qlogic-netxtreme2-4.19.0+1-modules \ +qlogic-netxtreme2 \ +qlogic-qla2xxx \ +qlogic-qla2xxx-firmware \ +qrencode-libs \ +quota \ +quota-nls \ +readline \ +rootfiles \ +rpcbind \ +rpm \ +rpm-build-libs \ +rpm-libs \ +rpm-python \ +rsync \ +rsyslog \ +sed \ +setup \ +sg3_utils-libs \ +shadow-utils \ +shared-mime-info \ +slang \ +sqlite \ +systemd \ +systemd-libs \ +systemd-sysv \ +sysvinit-tools \ +tar \ +tcp_wrappers \ +tcp_wrappers-libs \ +tzdata \ +ustr \ +util-linux \ +vendor-drivers \ +vim-minimal \ +wget \ +xcp-python-libs \ +xen-dom0-libs \ +xen-dom0-tools \ +xen-installer-files \ +xen-libs \ +xen-tools \ +xcp-ng-release \ +xcp-ng-release-presets \ +xz \ +xz-libs \ +yajl \ +yum \ +yum-metadata-parser \ +yum-plugin-fastestmirror \ +zlib \ +' + +config_opts['dist'] = 'xcpng821' # only useful for --resultdir variable subst +config_opts['releasever'] = '8.2.testing' +config_opts['bootstrap_image'] = 'quay.io/centos/centos:7' +config_opts['package_manager'] = 'yum' +config_opts['description'] = 'XCP-ng 8.2.testing' + +config_opts['yum.conf'] = """ +[main] +keepcache=1 +debuglevel=2 +reposdir=/dev/null +logfile=/var/log/yum.log +retries=20 +obsoletes=1 +gpgcheck=1 +assumeyes=1 +syslog_ident=mock +syslog_device= +metadata_expire=0 +mdpolicy=group:primary +best=1 +protected_packages= +user_agent={{ user_agent }} +skip_missing_names_on_install=0 +tsflags=nodocs + +{% set centos_7_gpg_keys = 'file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7' %} + +# repos +[xcpng-base] +name=xcpng-$releasever - Base +baseurl={{ srcurl }}/base/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False + +[xcpng-updates] +name=xcpng-$releasever - Updates +baseurl={{ srcurl }}/updates/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False + +[xcpng-testing] +name=xcpng-$releasever - Testing +baseurl={{ srcurl }}/testing/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False +""" diff --git a/mock-configs/8.2.updates-x86_64.cfg b/mock-configs/8.2.updates-x86_64.cfg new file mode 100644 index 0000000..674bebc --- /dev/null +++ b/mock-configs/8.2.updates-x86_64.cfg @@ -0,0 +1,314 @@ +## modified from centos-7-x86_64.cfg + +config_opts['root'] = '8.2.updates-x86_64' +config_opts['target_arch'] = 'x86_64' +config_opts['legal_host_arches'] = ('x86_64',) + +# This list is taken from 'epel-7-x86_64' @buildsys-build group, minus the +# 'epel-*' specific stuff. +#config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' + +# This list from: +# rpm --root $PWD/xcpng821-installimg/ --dbpath /var/lib/rpm -qa | sort | sed "s/\(.*\)-[^-]*-[^-]*$/\1/" +config_opts['chroot_setup_cmd'] = 'install \ +--disableplugin=* \ +GeoIP \ +acl \ +aic94xx-firmware \ +audit-libs \ +avago-megaraid-sas \ +avago-mpt3sas \ +basesystem \ +bash \ +bind-libs-lite \ +bind-license \ +biosdevname \ +boost-system \ +boost-thread \ +bridge-utils \ +broadcom-bnxt-en \ +bzip2 \ +bzip2-libs \ +ca-certificates \ +chelsio-cxgb4 \ +chkconfig \ +chrony \ +cisco-enic \ +cisco-fnic \ +coreutils \ +cpio \ +cracklib \ +cracklib-dicts \ +cryptsetup-libs \ +curl \ +cyrus-sasl-lib \ +dbus \ +dbus-libs \ +device-mapper \ +device-mapper-event \ +device-mapper-event-libs \ +device-mapper-libs \ +device-mapper-multipath \ +device-mapper-multipath-libs \ +device-mapper-persistent-data \ +dhclient \ +dhcp-common \ +dhcp-libs \ +diffutils \ +dmidecode \ +e2fsprogs \ +e2fsprogs-libs \ +edk2 \ +efibootmgr \ +efivar-libs \ +elfutils-default-yama-scope \ +elfutils-libelf \ +elfutils-libs \ +emulex-lpfc \ +ethtool \ +expat \ +fcoe-utils \ +file-libs \ +filesystem \ +findutils \ +fipscheck \ +fipscheck-lib \ +gawk \ +gdbm \ +gdisk \ +glib2 \ +glibc \ +glibc-common \ +gmp \ +gnupg2 \ +gpgme \ +grep \ +gssproxy \ +gzip \ +hardlink \ +host-installer-startup \ +hostname \ +hwdata \ +info \ +initscripts \ +intel-e1000e \ +intel-fm10k \ +intel-i40e \ +intel-ice \ +intel-igb \ +intel-ixgbe \ +iproute \ +iputils \ +ipxe \ +iscsi-initiator-utils \ +iscsi-initiator-utils-iscsiuio \ +json-c \ +kbd \ +kbd-legacy \ +kbd-misc \ +kernel \ +kernel-alt \ +keyutils \ +keyutils-libs \ +kmod \ +kmod-libs \ +kpartx \ +krb5-libs \ +libacl \ +libaio \ +libassuan \ +libattr \ +libbasicobjects \ +libblkid \ +libcap \ +libcap-ng \ +libcollection \ +libcom_err \ +libconfig \ +libcurl \ +libdb \ +libdb-utils \ +libedit \ +libempserver \ +libestr \ +libevent \ +libfastjson \ +libffi \ +libgcc \ +libgcrypt \ +libgpg-error \ +libicu \ +libidn \ +libini_config \ +libmnl \ +libmount \ +libnfsidmap \ +libnl3 \ +libpath_utils \ +libpciaccess \ +libpwquality \ +librados2 \ +libref_array \ +libreport-filesystem \ +libseccomp \ +libselinux \ +libsemanage \ +libsepol \ +libss \ +libssh2 \ +libstdc++ \ +libsysfs \ +libtasn1 \ +libtirpc \ +libuser \ +libutempter \ +libuuid \ +libverto \ +libverto-libevent \ +libxml2 \ +linux-firmware \ +lldpad \ +logrotate \ +lua \ +lvm2 \ +lvm2-libs \ +lz4 \ +lzo \ +mdadm \ +microsemi-smartpqi \ +ncurses \ +ncurses-base \ +ncurses-libs \ +net-tools \ +newt \ +newt-python \ +nfs-utils \ +nspr \ +nss \ +nss-pem \ +nss-softokn \ +nss-softokn-freebl \ +nss-sysinit \ +nss-tools \ +nss-util \ +openldap \ +openssh \ +openssh-clients \ +openssh-server \ +openssl-libs \ +p11-kit \ +p11-kit-trust \ +pam \ +pciutils \ +pciutils-libs \ +pcre \ +pinentry \ +popt \ +procps-ng \ +psmisc \ +pth \ +pygpgme \ +pyliblzma \ +python \ +python-iniparse \ +python-libs \ +python-pycurl \ +python-urlgrabber \ +pyxattr \ +qlogic-fastlinq \ +qlogic-netxtreme2-4.19.0+1-modules \ +qlogic-netxtreme2 \ +qlogic-qla2xxx \ +qlogic-qla2xxx-firmware \ +qrencode-libs \ +quota \ +quota-nls \ +readline \ +rootfiles \ +rpcbind \ +rpm \ +rpm-build-libs \ +rpm-libs \ +rpm-python \ +rsync \ +rsyslog \ +sed \ +setup \ +sg3_utils-libs \ +shadow-utils \ +shared-mime-info \ +slang \ +sqlite \ +systemd \ +systemd-libs \ +systemd-sysv \ +sysvinit-tools \ +tar \ +tcp_wrappers \ +tcp_wrappers-libs \ +tzdata \ +ustr \ +util-linux \ +vendor-drivers \ +vim-minimal \ +wget \ +xcp-python-libs \ +xen-dom0-libs \ +xen-dom0-tools \ +xen-installer-files \ +xen-libs \ +xen-tools \ +xcp-ng-release \ +xcp-ng-release-presets \ +xz \ +xz-libs \ +yajl \ +yum \ +yum-metadata-parser \ +yum-plugin-fastestmirror \ +zlib \ +' + +config_opts['dist'] = 'xcpng821' # only useful for --resultdir variable subst +config_opts['releasever'] = '8.2.updates' +config_opts['bootstrap_image'] = 'quay.io/centos/centos:7' +config_opts['package_manager'] = 'yum' +config_opts['description'] = 'XCP-ng 8.2.updates' + +config_opts['yum.conf'] = """ +[main] +keepcache=1 +debuglevel=2 +reposdir=/dev/null +logfile=/var/log/yum.log +retries=20 +obsoletes=1 +gpgcheck=1 +assumeyes=1 +syslog_ident=mock +syslog_device= +metadata_expire=0 +mdpolicy=group:primary +best=1 +protected_packages= +user_agent={{ user_agent }} +skip_missing_names_on_install=0 +tsflags=nodocs + +{% set centos_7_gpg_keys = 'file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7' %} + +# repos +[xcpng-base] +name=xcpng-$releasever - Base +baseurl={{ srcurl }}/base/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False + +[xcpng-updates] +name=xcpng-$releasever - Updates +baseurl={{ srcurl }}/updates/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False +""" diff --git a/mock-configs/8.3.0-x86_64.cfg b/mock-configs/8.3.0-x86_64.cfg new file mode 100644 index 0000000..bcf05d2 --- /dev/null +++ b/mock-configs/8.3.0-x86_64.cfg @@ -0,0 +1,208 @@ +## modified from centos-7-x86_64.cfg + +config_opts['root'] = '8.3.0-x86_64' +config_opts['target_arch'] = 'x86_64' +config_opts['legal_host_arches'] = ('x86_64',) + +# This list is taken from 'epel-7-x86_64' @buildsys-build group, minus the +# 'epel-*' specific stuff. +#config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' + +# This list from: +# rpm --root $PWD/xcpng830-installimg/ --dbpath /var/lib/rpm -qa | sort | sed "s/\(.*\)-[^-]*-[^-]*$/\1/" +config_opts['chroot_setup_cmd'] = 'install \ +--disableplugin=* \ +GeoIP \ +acl \ +aic94xx-firmware \ +avago-megaraid-sas \ +avago-mpt3sas \ +basesystem \ +biosdevname \ +boost-system \ +boost-thread \ +bridge-utils \ +broadcom-bnxt-en \ +bzip2 \ +ca-certificates \ +chelsio-cxgb4 \ +chkconfig \ +chrony \ +cisco-enic \ +cisco-fnic \ +coreutils \ +cpio \ +cracklib \ +cracklib-dicts \ +curl \ +dbus \ +device-mapper \ +device-mapper-event \ +device-mapper-multipath \ +device-mapper-persistent-data \ +dhclient \ +diffutils \ +dmidecode \ +e2fsprogs \ +edk2 \ +efibootmgr \ +efivar-libs \ +elfutils-default-yama-scope \ +emulex-lpfc \ +expat \ +fcoe-utils \ +filesystem \ +findutils \ +fipscheck \ +gawk \ +gdbm \ +gdisk \ +gmp \ +gnupg2 \ +gpgme \ +grep \ +gssproxy \ +gzip \ +hardlink \ +host-installer-startup \ +hostname \ +hwdata \ +info \ +intel-e1000e \ +intel-fm10k \ +intel-i40e \ +intel-ice \ +intel-igb \ +intel-ixgbe \ +iproute \ +iputils \ +ipxe \ +iscsi-initiator-utils \ +iscsi-initiator-utils-iscsiuio \ +json-c \ +kbd \ +kbd-legacy \ +kbd-misc \ +kernel \ +kernel-alt \ +keyutils \ +kmod \ +kpartx \ +linux-firmware \ +lldpad \ +logrotate \ +lua \ +lvm2 \ +lz4 \ +lzo \ +mdadm \ +microsemi-smartpqi \ +ncurses \ +newt \ +newt-python \ +nfs-utils \ +nspr \ +nss \ +nss-pem \ +nss-softokn \ +nss-softokn-freebl \ +nss-sysinit \ +nss-tools \ +nss-util \ +openldap \ +openssh \ +openssh-clients \ +p11-kit \ +p11-kit-trust \ +pam \ +pcre \ +pinentry \ +popt \ +procps-ng \ +psmisc \ +pth \ +pygpgme \ +python \ +python-iniparse \ +python-pycurl \ +python-urlgrabber \ +pyxattr \ +qlogic-fastlinq \ +qlogic-netxtreme2-4.19.0+1-modules \ +qlogic-netxtreme2 \ +qlogic-qla2xxx \ +qlogic-qla2xxx-firmware \ +quota \ +quota-nls \ +readline \ +rootfiles \ +rpcbind \ +rpm \ +rpm-python \ +rsync \ +rsyslog \ +sed \ +setup \ +shadow-utils \ +shared-mime-info \ +slang \ +sqlite \ +systemd \ +systemd-sysv \ +sysvinit-tools \ +tar \ +tcp_wrappers \ +tzdata \ +ustr \ +util-linux \ +vendor-drivers \ +vim-minimal \ +wget \ +xen-dom0-tools \ +xen-installer-files \ +xen-tools \ +xcp-ng-release \ +xcp-ng-release-presets \ +xz \ +yajl \ +yum \ +yum-metadata-parser \ +yum-plugin-fastestmirror \ +' + +config_opts['dist'] = 'xcpng821' # only useful for --resultdir variable subst +config_opts['releasever'] = '8.3' +config_opts['bootstrap_image'] = 'quay.io/centos/centos:7' +config_opts['package_manager'] = 'yum' +config_opts['description'] = 'XCP-ng 8.3' + +config_opts['yum.conf'] = """ +[main] +keepcache=1 +debuglevel=2 +reposdir=/dev/null +logfile=/var/log/yum.log +retries=20 +obsoletes=1 +gpgcheck=1 +assumeyes=1 +syslog_ident=mock +syslog_device= +metadata_expire=0 +mdpolicy=group:primary +best=1 +protected_packages= +user_agent={{ user_agent }} +skip_missing_names_on_install=0 +tsflags=nodocs + +{% set centos_7_gpg_keys = 'file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7' %} + +# repos +[xcpng-base] +name=xcpng-$releasever - Base +baseurl={{ srcurl }}/base/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False +""" diff --git a/mock-configs/8.3.testing-x86_64.cfg b/mock-configs/8.3.testing-x86_64.cfg new file mode 100644 index 0000000..8b545a8 --- /dev/null +++ b/mock-configs/8.3.testing-x86_64.cfg @@ -0,0 +1,237 @@ +## modified from centos-7-x86_64.cfg + +config_opts['root'] = '8.3.testing-x86_64' +config_opts['target_arch'] = 'x86_64' +config_opts['legal_host_arches'] = ('x86_64',) + +# This list is taken from 'epel-7-x86_64' @buildsys-build group, minus the +# 'epel-*' specific stuff. +#config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' + +# This list from: +# rpm --root $PWD/xcpng830-installimg/ --dbpath /var/lib/rpm -qa | sort | sed "s/\(.*\)-[^-]*-[^-]*$/\1/" +config_opts['chroot_setup_cmd'] = 'install \ +--disableplugin=* \ +GeoIP \ +acl \ +aic94xx-firmware \ +avago-megaraid-sas \ +avago-mpt3sas \ +basesystem \ +biosdevname \ +boost-system \ +boost-thread \ +bridge-utils \ +broadcom-bnxt-en \ +bzip2 \ +ca-certificates \ +chelsio-cxgb4 \ +chkconfig \ +chrony \ +cisco-enic \ +cisco-fnic \ +coreutils \ +cpio \ +cracklib \ +cracklib-dicts \ +curl \ +dbus \ +device-mapper \ +device-mapper-event \ +device-mapper-multipath \ +device-mapper-persistent-data \ +dhclient \ +diffutils \ +dmidecode \ +e2fsprogs \ +edk2 \ +efibootmgr \ +efivar-libs \ +elfutils-default-yama-scope \ +emulex-lpfc \ +expat \ +fcoe-utils \ +filesystem \ +findutils \ +fipscheck \ +gawk \ +gdbm \ +gdisk \ +gmp \ +gnupg2 \ +gpgme \ +grep \ +gssproxy \ +gzip \ +hardlink \ +host-installer-startup \ +hostname \ +hwdata \ +info \ +intel-e1000e \ +intel-fm10k \ +intel-i40e \ +intel-ice \ +intel-igb \ +intel-ixgbe \ +iproute \ +iputils \ +ipxe \ +iscsi-initiator-utils \ +iscsi-initiator-utils-iscsiuio \ +json-c \ +kbd \ +kbd-legacy \ +kbd-misc \ +kernel \ +kernel-alt \ +keyutils \ +kmod \ +kpartx \ +linux-firmware \ +lldpad \ +logrotate \ +lua \ +lvm2 \ +lz4 \ +lzo \ +mdadm \ +microsemi-smartpqi \ +ncurses \ +newt \ +newt-python \ +nfs-utils \ +nspr \ +nss \ +nss-pem \ +nss-softokn \ +nss-softokn-freebl \ +nss-sysinit \ +nss-tools \ +nss-util \ +openldap \ +openssh \ +openssh-clients \ +p11-kit \ +p11-kit-trust \ +pam \ +pcre \ +pinentry \ +popt \ +procps-ng \ +psmisc \ +pth \ +pygpgme \ +python \ +python-iniparse \ +python-pycurl \ +python-urlgrabber \ +pyxattr \ +qlogic-fastlinq \ +qlogic-netxtreme2-4.19.0+1-modules \ +qlogic-netxtreme2 \ +qlogic-qla2xxx \ +qlogic-qla2xxx-firmware \ +quota \ +quota-nls \ +readline \ +rootfiles \ +rpcbind \ +rpm \ +rpm-python \ +rsync \ +rsyslog \ +sed \ +setup \ +shadow-utils \ +shared-mime-info \ +slang \ +sqlite \ +systemd \ +systemd-sysv \ +sysvinit-tools \ +tar \ +tcp_wrappers \ +tzdata \ +ustr \ +util-linux \ +vendor-drivers \ +vim-minimal \ +wget \ +xen-dom0-tools \ +xen-installer-files \ +xen-tools \ +xcp-ng-release \ +xcp-ng-release-presets \ +xz \ +yajl \ +yum \ +yum-metadata-parser \ +yum-plugin-fastestmirror \ +' + +config_opts['dist'] = 'xcpng821' # only useful for --resultdir variable subst +config_opts['releasever'] = '8.3' +config_opts['bootstrap_image'] = 'quay.io/centos/centos:7' +config_opts['package_manager'] = 'yum' +config_opts['description'] = 'XCP-ng 8.3' + +config_opts['yum.conf'] = """ +[main] +keepcache=1 +debuglevel=2 +reposdir=/dev/null +logfile=/var/log/yum.log +retries=20 +obsoletes=1 +gpgcheck=1 +assumeyes=1 +syslog_ident=mock +syslog_device= +metadata_expire=0 +mdpolicy=group:primary +best=1 +protected_packages= +user_agent={{ user_agent }} +skip_missing_names_on_install=0 +tsflags=nodocs + +{% set centos_7_gpg_keys = 'file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7' %} + +# repos +[xcpng-base] +name=xcpng-$releasever - Base +baseurl={{ srcurl }}/base/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False + +[xcpng-updates] +name=xcpng-$releasever - Updates +baseurl={{ srcurl }}/updates/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False + +[xcpng-testing] +name=xcpng-$releasever - Testing +baseurl={{ srcurl }}/testing/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False + +# [centos] +# name=CentOS-7 - Base +# mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=os +# failovermethod=priority +# gpgkey={{ centos_7_gpg_keys }} +# skip_if_unavailable=False +# +# [epel] +# name=Extra Packages for Enterprise Linux 7 - $basearch +# mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=$basearch +# failovermethod=priority +# gpgkey=file:///usr/share/distribution-gpg-keys/epel/RPM-GPG-KEY-EPEL-7 +# skip_if_unavailable=False + +""" diff --git a/mock-configs/8.3.updates-x86_64.cfg b/mock-configs/8.3.updates-x86_64.cfg new file mode 100644 index 0000000..9171ab6 --- /dev/null +++ b/mock-configs/8.3.updates-x86_64.cfg @@ -0,0 +1,216 @@ +## modified from centos-7-x86_64.cfg + +config_opts['root'] = '8.3.updates-x86_64' +config_opts['target_arch'] = 'x86_64' +config_opts['legal_host_arches'] = ('x86_64',) + +# This list is taken from 'epel-7-x86_64' @buildsys-build group, minus the +# 'epel-*' specific stuff. +#config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' + +# This list from: +# rpm --root $PWD/xcpng830-installimg/ --dbpath /var/lib/rpm -qa | sort | sed "s/\(.*\)-[^-]*-[^-]*$/\1/" +config_opts['chroot_setup_cmd'] = 'install \ +--disableplugin=* \ +GeoIP \ +acl \ +aic94xx-firmware \ +avago-megaraid-sas \ +avago-mpt3sas \ +basesystem \ +biosdevname \ +boost-system \ +boost-thread \ +bridge-utils \ +broadcom-bnxt-en \ +bzip2 \ +ca-certificates \ +chelsio-cxgb4 \ +chkconfig \ +chrony \ +cisco-enic \ +cisco-fnic \ +coreutils \ +cpio \ +cracklib \ +cracklib-dicts \ +curl \ +dbus \ +device-mapper \ +device-mapper-event \ +device-mapper-multipath \ +device-mapper-persistent-data \ +dhclient \ +diffutils \ +dmidecode \ +e2fsprogs \ +edk2 \ +efibootmgr \ +efivar-libs \ +elfutils-default-yama-scope \ +emulex-lpfc \ +expat \ +fcoe-utils \ +filesystem \ +findutils \ +fipscheck \ +gawk \ +gdbm \ +gdisk \ +gmp \ +gnupg2 \ +gpgme \ +grep \ +gssproxy \ +gzip \ +hardlink \ +host-installer-startup \ +hostname \ +hwdata \ +info \ +intel-e1000e \ +intel-fm10k \ +intel-i40e \ +intel-ice \ +intel-igb \ +intel-ixgbe \ +iproute \ +iputils \ +ipxe \ +iscsi-initiator-utils \ +iscsi-initiator-utils-iscsiuio \ +json-c \ +kbd \ +kbd-legacy \ +kbd-misc \ +kernel \ +kernel-alt \ +keyutils \ +kmod \ +kpartx \ +linux-firmware \ +lldpad \ +logrotate \ +lua \ +lvm2 \ +lz4 \ +lzo \ +mdadm \ +microsemi-smartpqi \ +ncurses \ +newt \ +newt-python \ +nfs-utils \ +nspr \ +nss \ +nss-pem \ +nss-softokn \ +nss-softokn-freebl \ +nss-sysinit \ +nss-tools \ +nss-util \ +openldap \ +openssh \ +openssh-clients \ +p11-kit \ +p11-kit-trust \ +pam \ +pcre \ +pinentry \ +popt \ +procps-ng \ +psmisc \ +pth \ +pygpgme \ +python \ +python-iniparse \ +python-pycurl \ +python-urlgrabber \ +pyxattr \ +qlogic-fastlinq \ +qlogic-netxtreme2-4.19.0+1-modules \ +qlogic-netxtreme2 \ +qlogic-qla2xxx \ +qlogic-qla2xxx-firmware \ +quota \ +quota-nls \ +readline \ +rootfiles \ +rpcbind \ +rpm \ +rpm-python \ +rsync \ +rsyslog \ +sed \ +setup \ +shadow-utils \ +shared-mime-info \ +slang \ +sqlite \ +systemd \ +systemd-sysv \ +sysvinit-tools \ +tar \ +tcp_wrappers \ +tzdata \ +ustr \ +util-linux \ +vendor-drivers \ +vim-minimal \ +wget \ +xen-dom0-tools \ +xen-installer-files \ +xen-tools \ +xcp-ng-release \ +xcp-ng-release-presets \ +xz \ +yajl \ +yum \ +yum-metadata-parser \ +yum-plugin-fastestmirror \ +' + +config_opts['dist'] = 'xcpng821' # only useful for --resultdir variable subst +config_opts['releasever'] = '8.3' +config_opts['bootstrap_image'] = 'quay.io/centos/centos:7' +config_opts['package_manager'] = 'yum' +config_opts['description'] = 'XCP-ng 8.3' + +config_opts['yum.conf'] = """ +[main] +keepcache=1 +debuglevel=2 +reposdir=/dev/null +logfile=/var/log/yum.log +retries=20 +obsoletes=1 +gpgcheck=1 +assumeyes=1 +syslog_ident=mock +syslog_device= +metadata_expire=0 +mdpolicy=group:primary +best=1 +protected_packages= +user_agent={{ user_agent }} +skip_missing_names_on_install=0 +tsflags=nodocs + +{% set centos_7_gpg_keys = 'file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7' %} + +# repos +[xcpng-base] +name=xcpng-$releasever - Base +baseurl={{ srcurl }}/base/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False + +[xcpng-updates] +name=xcpng-$releasever - Updates +baseurl={{ srcurl }}/updates/x86_64/ +gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng +failovermethod=priority +skip_if_unavailable=False + +""" diff --git a/mock-configs/logging.ini b/mock-configs/logging.ini new file mode 120000 index 0000000..49f7059 --- /dev/null +++ b/mock-configs/logging.ini @@ -0,0 +1 @@ +/etc/mock/logging.ini \ No newline at end of file diff --git a/scripts/create-installimg.sh b/scripts/create-installimg.sh new file mode 100755 index 0000000..09dd1ad --- /dev/null +++ b/scripts/create-installimg.sh @@ -0,0 +1,186 @@ +#! /bin/bash +set -eE +set -o pipefail + +mydir=$(dirname $0) +topdir=$mydir/.. + +. "$mydir/lib/misc.sh" + +usage() { + cat <] + +Options: + --srcurl get RPMs from repo at + -o choose a different output name + -v|--verbose be talkative +EOF +} + +mockdir=$topdir/mock-configs + +VERBOSE= +OUTPUT_IMG= +SRCURL= +RPMARCH="x86_64" +while [ $# -ge 1 ]; do + case "$1" in + --help|-h) + usage + exit 0 + ;; + --verbose|-v) + VERBOSE=-v + ;; + --srcurl) + [ $# -ge 2 ] || die_usage "$1 needs an argument" + SRCURL="$2" + shift + ;; + -o) + [ $# -ge 2 ] || die_usage "$1 needs an argument" + OUTPUT_IMG="$2" + shift + ;; + -*) + die_usage "unknown flag '$1'" + ;; + *) + break + ;; + esac + shift +done + +[ $# = 1 ] || die_usage "need exactly 1 non-option argument" + +[ -z "$VERBOSE" ] || set -x + +DIST="$1" +[ -r "$mockdir/$DIST-$RPMARCH.cfg" ] || die "cannot find config for '$DIST-$RPMARCH'" +maybe_set_srcurl "$DIST" +[ -n "$OUTPUT_IMG" ] || OUTPUT_IMG="install-$DIST-$RPMARCH.img" + +command -v mock >/dev/null || die "required tool not found: mock" +command -v fakeroot >/dev/null || die "required tool not found: fakeroot" + + +#### create base rootfs + +# FIXME should allow to select repos - use jinja tricks? +MOCK=( + mock + --configdir="$topdir/mock-configs" + --config-opts=srcurl="$SRCURL" + -r "$DIST-$RPMARCH" + # non-$VERBOSE is -q, $VERBOSE is default, mock's -v would be debug + $([ -n "$VERBOSE" ] || printf -- "-q") +) + +${MOCK[@]} --clean +${MOCK[@]} --scrub=root-cache +${MOCK[@]} --init + + +### removal of abusively-pulled packages (list manually extracted as +### packages not in 8.2.1 install.img) + +${MOCK[@]} --shell -- rpm --nodeps --erase binutils dracut gpg-pubkey pkgconfig xen-hypervisor + + +### removal of misc stuff + +# > 100KB +BINS="systemd-analyze systemd-nspawn journalctl machinectl dgawk loginctl ssh-keyscan pgawk busctl systemd-run" +BINS+=" ssh-agent timedatectl systemd-cgls localectl hostnamectl systemd-inhibit info oldfind coredumpctl" +SBINS="pdata_tools oxenstored ldconfig build-locale-archive glibc_post_upgrade.x86_64 sln install-info" +BINPATHS=$( + for i in $BINS; do echo /usr/bin/$i; done + for i in $SBINS; do echo /usr/sbin/$i; done + ) + + +# FIXME decide what to do with those +DOUBTFUL="" +# if we want to use craklib why remove this, if we don't why not remove the rest +DOUBTFUL+=" /usr/share/cracklib" +# similarly, there are other files - maybe those are just the source file? +DOUBTFUL+=" /usr/lib/udev/hwdb.d/" + +# WTF cannot use glob wildcards in mock commands, srsly... +MOCKROOT=$(${MOCK[@]} -p) +# ... /boot/* +MOREFILES=$(cd $MOCKROOT && ls boot/* | sed s,^,/,) + +${MOCK[@]} --shell -- find /usr -name "*.py[co]" -delete +${MOCK[@]} --shell -- rm -r $VERBOSE \ + /usr/share/locale /usr/lib/locale /usr/share/i18n/locales \ + /usr/libexec/xen/boot \ + /etc/dnf \ + $MOREFILES \ + $BINPATHS \ + $DOUBTFUL \ + /usr/share/bash-completion + + +### extra stuff + +# /init for initrd +${MOCK[@]} --shell -- ln -s /sbin/init /init + +# files specific to the install image +(cd "$topdir/installimg/$DIST" && find . | cpio -o) | ${MOCK[@]} --shell -- "cd / && cpio -idm ${VERBOSE}" + +# FIXME ignored +${MOCK[@]} --shell -- ": > /etc/yum/yum.conf" + +# installer branding - FIXME should be part of host-installer.rpm +${MOCK[@]} --shell -- ln -sr /EULA "/opt/xensource/installer/" +${MOCK[@]} --shell -- ln -sr /usr/lib/python2.7/site-packages/xcp/branding.py \ + "/opt/xensource/installer/version.py" + + +### services + +case "$DIST" in + 8.2.*) + # FIXME do we really want to stick to 8.2.1 here? + INSTALLERGETTY=getty@tty2.service + ;; + *) + INSTALLERGETTY=installer-getty@tty2.service + ;; +esac + +${MOCK[@]} --shell -- systemctl enable installer "$INSTALLERGETTY" + +${MOCK[@]} --shell -- systemctl disable \ + getty@tty1 fcoe lldpad xen-init-dom0 xenconsoled xenstored chronyd chrony-wait + +### final cleanups +rm -rf $ROOTFS/var/lib/yum/{yumdb,history} + +### repack cache into .img + +# send all our changes to cache (yes the bad doc says it is not necessary) +${MOCK[@]} --cache-alterations --shell -- true + +# note: no official mock interface +CACHE="/var/cache/mock/$DIST-$RPMARCH/root_cache/cache.tar.gz" + +# convert tarball into compressed-cpio +ROOTFS=$(mktemp -d) +CLEANUP_DIRS+=("$ROOTFS") +# make sure bzip2 doesn't leave an invalid output if its input command fails +trap "rm -f $OUTPUT_IMG" ERR +# FIXME replace bzip with better algo +# before repacking: +# - make sure we can read files with bogus perms (WTF RH, srsly...) +# - remove /builddir, which can't be removed from the mock rootfs itself without breaking mock +fakeroot bash -c "set -o pipefail && cd '$ROOTFS' && tar -xf '$CACHE' && \ + chmod u+r etc/{,g}shadow{,-} && rm -r builddir && \ + find . | cpio -o -H newc" | bzip2 > "$OUTPUT_IMG" + +# cleanup for disk space +${MOCK[@]} --clean diff --git a/scripts/lib/misc.sh b/scripts/lib/misc.sh new file mode 100644 index 0000000..65dc389 --- /dev/null +++ b/scripts/lib/misc.sh @@ -0,0 +1,53 @@ +# consistent erroring out + +die() { + echo >&2 + echo >&2 "ERROR: $*" + echo >&2 + exit 1 +} + +# usage() is script-specific, implement it yourself + +die_usage() { + usage >&2 + die "$*" +} + + +# default src URL depending on selected $DIST + +maybe_set_srcurl() { + [ $# = 1 ] || die "maybe_set_srcurl: need exactly 1 argument" + DIST="$1" + MINOR=${DIST%.*} + MAJOR=${MINOR%.*} + if [ "$MAJOR" = "$MINOR" ]; then + # DIST only has 2 components + MINOR="$DIST" + fi + SRCURL_DEFAULT="https://updates.xcp-ng.org/$MAJOR/$MINOR" + if [ -z "$SRCURL" ]; then + SRCURL="$SRCURL_DEFAULT" + [ -z "$VERBOSE" ] || echo "Defaulting to SRCURL '$SRCURL'" + fi +} + + +# cleanup tempfiles on exit + +CLEANUP_DIRS=() +CLEANUP_FILES=() +exitcleanup() { + rm -rf "${CLEANUP_DIRS[@]}" + rm -f "${CLEANUP_FILES[@]}" +} +trap 'exitcleanup' EXIT INT + + +# Avoid yum keeping a cache in /var/tmp with a temporary name but +# getting reused between runs, and confusing yum about which rpm +# versions should be available. Yeah that sucks hard. +# See https://unix.stackexchange.com/questions/92257/ +export TMPDIR=$(mktemp -d "$PWD/tmpdir-XXXXXX") +CLEANUP_DIRS+=("$TMPDIR") diff --git a/tests/0100-8.2-updates.t b/tests/0100-8.2-updates.t new file mode 100755 index 0000000..505cd88 --- /dev/null +++ b/tests/0100-8.2-updates.t @@ -0,0 +1,30 @@ +#!/bin/sh + +test_description="check build for 8.2:updates" + +DIR0="$(dirname "$0")" +TESTDIR="$(realpath "$DIR0")" +. $TESTDIR/sharness/sharness.sh + +TOPDIR="$TESTDIR/.." + +# yum cannot grok spaces in dir names +CLEANDIR=$(pwd | tr " " "_") +ln -s "$(basename "$PWD")" $CLEANDIR +cd $CLEANDIR +SHARNESS_TRASH_DIRECTORY="$CLEANDIR" +HOME="$CLEANDIR" +set|grep "trash dir" + +test_expect_success "build image for 8.2:updates" "sudo sh -c ' + set -x && + cd $SHARNESS_TRASH_DIRECTORY && \ + + $TOPDIR/scripts/create-installimg.sh \ + --srcurl $XCPTEST_REPOROOT/8.2 \ + 8.2.updates && + + test -r install-8.2.updates-x86_64.img +'" + +test_done diff --git a/tests/0101-8.2-testing.t b/tests/0101-8.2-testing.t new file mode 100755 index 0000000..7239af1 --- /dev/null +++ b/tests/0101-8.2-testing.t @@ -0,0 +1,30 @@ +#!/bin/sh + +test_description="check build for 8.2:testing" + +DIR0="$(dirname "$0")" +TESTDIR="$(realpath "$DIR0")" +. $TESTDIR/sharness/sharness.sh + +TOPDIR="$TESTDIR/.." + +# yum cannot grok spaces in dir names +CLEANDIR=$(pwd | tr " " "_") +ln -s "$(basename "$PWD")" $CLEANDIR +cd $CLEANDIR +SHARNESS_TRASH_DIRECTORY="$CLEANDIR" +HOME="$CLEANDIR" +set|grep "trash dir" + +test_expect_success "build image for 8.2:testing" "sudo sh -c ' + set -x && + cd $SHARNESS_TRASH_DIRECTORY && \ + + $TOPDIR/scripts/create-installimg.sh \ + --srcurl $XCPTEST_REPOROOT/8.2 \ + 8.2.testing && + + test -r install-8.2.testing-x86_64.img +'" + +test_done diff --git a/tests/0200-8.3-base.t b/tests/0200-8.3-base.t new file mode 100755 index 0000000..36f769e --- /dev/null +++ b/tests/0200-8.3-base.t @@ -0,0 +1,30 @@ +#!/bin/sh + +test_description="check build for 8.3:base" + +DIR0="$(dirname "$0")" +TESTDIR="$(realpath "$DIR0")" +. $TESTDIR/sharness/sharness.sh + +TOPDIR="$TESTDIR/.." + +# yum cannot grok spaces in dir names +CLEANDIR=$(pwd | tr " " "_") +ln -s "$(basename "$PWD")" $CLEANDIR +cd $CLEANDIR +SHARNESS_TRASH_DIRECTORY="$CLEANDIR" +HOME="$CLEANDIR" +set|grep "trash dir" + +test_expect_success "build image for 8.3:base" "sudo sh -c ' + set -x && + cd $SHARNESS_TRASH_DIRECTORY && \ + + $TOPDIR/scripts/create-installimg.sh \ + --srcurl $XCPTEST_REPOROOT/8.3 \ + 8.3.0 && + + test -r install-8.3.0-x86_64.img +'" + +test_done diff --git a/tests/0202-8.3-testing.t b/tests/0202-8.3-testing.t new file mode 100755 index 0000000..6cdf703 --- /dev/null +++ b/tests/0202-8.3-testing.t @@ -0,0 +1,30 @@ +#!/bin/sh + +test_description="check build for 8.3:testing" + +DIR0="$(dirname "$0")" +TESTDIR="$(realpath "$DIR0")" +. $TESTDIR/sharness/sharness.sh + +TOPDIR="$TESTDIR/.." + +# yum cannot grok spaces in dir names +CLEANDIR=$(pwd | tr " " "_") +ln -s "$(basename "$PWD")" $CLEANDIR +cd $CLEANDIR +SHARNESS_TRASH_DIRECTORY="$CLEANDIR" +HOME="$CLEANDIR" +set|grep "trash dir" + +test_expect_success "build image for 8.3:testing" "sudo sh -c ' + set -x && + cd $SHARNESS_TRASH_DIRECTORY && \ + + $TOPDIR/scripts/create-installimg.sh \ + --srcurl $XCPTEST_REPOROOT/8.3 \ + 8.3.testing && + + test -r install-8.3.testing-x86_64.img +'" + +test_done