-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from AdamWill/fix-tests-py3
Fix oz with recent Python, fix a major bug with `useuefi` arg, fix up some issues in the tests, add support for running tests in containers, add a Github Action workflow for CI
- Loading branch information
Showing
21 changed files
with
298 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
name: Run CI checks | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
unittests-fedora: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install make and docker | ||
run: apt-get install make docker docker.io | ||
- name: Run the tests | ||
run: make container-unittests-fedora | ||
unittests-el7: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install make and docker | ||
run: apt-get install make docker | ||
- name: Run the tests | ||
run: make container-unittests-el7 | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install make, pylint and flake8 | ||
run: apt-get install make pylint flake8 | ||
- name: Run pylint | ||
run: make pylint | ||
- name: Run flake8 | ||
run: make flake8 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# this container definition is intended *only* for running the oz test suite, it is not | ||
# a general-purpose oz container definition! | ||
|
||
FROM quay.io/centos/centos:7 | ||
RUN set -exo pipefail \ | ||
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ | ||
&& yum install -y python-requests m2crypto libvirt-python python-lxml python-libguestfs pytest python-monotonic libvirt \ | ||
&& yum clean all \ | ||
&& rm -rf /var/cache/* /var/log/yum* | ||
|
||
COPY ./ /oz | ||
# the XML generation tests are inherently unreliable before Python 3.8, | ||
# as there was no consistent ordering of XML element attributes. See | ||
# https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.tostring | ||
RUN printf "#!/bin/sh\n/usr/sbin/libvirtd -d\ncd /oz\npy.test -vv -k 'not test_xml_generation and not modify_libvirt_xml_for_serial' tests/" > /usr/local/bin/runtests.sh && chmod ugo+x /usr/local/bin/runtests.sh | ||
CMD /usr/local/bin/runtests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# this container definition is intended *only* for running the oz test suite, it is not | ||
# a general-purpose oz container definition! | ||
|
||
FROM quay.io/fedora/fedora:latest | ||
RUN set -exo pipefail \ | ||
&& dnf install -y --setopt install_weak_deps=false --nodocs \ | ||
python3-requests python3-m2crypto python3-setuptools python3-libvirt python3-lxml python3-libguestfs python3-pytest python3-monotonic \ | ||
libvirt-daemon libvirt-daemon-kvm libvirt-daemon-qemu libvirt-daemon-config-network systemd \ | ||
&& dnf clean all \ | ||
&& rm -rf /var/cache/* /var/log/dnf* | ||
|
||
COPY ./ /oz | ||
RUN printf "#!/bin/sh\n/usr/sbin/libvirtd -d\ncd /oz\npy.test -vv tests/" > /usr/local/bin/runtests.sh && chmod ugo+x /usr/local/bin/runtests.sh | ||
CMD /usr/local/bin/runtests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,41 @@ | ||
Summary: Library and utilities for automated guest OS installs | ||
Name: oz | ||
Name: oz | ||
Version: @VERSION@ | ||
Release: @RELEASE@%{?dist} | ||
Summary: Library and utilities for automated guest OS installs | ||
License: LGPLv2 | ||
Group: Development/Libraries | ||
URL: http://github.com/clalancette/oz | ||
Source0: http://github.com/clalancette/%{name}/archive/%{name}-%{version}.tar.gz | ||
URL: http://github.com/clalancette/oz | ||
|
||
Source0: https://github.com/clalancette/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz | ||
|
||
BuildArch: noarch | ||
|
||
BuildRequires: python3 | ||
BuildRequires: python3-devel | ||
BuildRequires: python3-setuptools | ||
Requires: python3 | ||
Requires: python3-libguestfs >= 1.18 | ||
Requires: python3-lxml | ||
Requires: python3-libguestfs >= 1.18 | ||
Requires: python3-libvirt | ||
Requires: python3-m2crypto | ||
Requires: python3-monotonic | ||
Requires: python3-requests | ||
# in theory, oz doesn't really require libvirtd to be local to operate | ||
# properly. However, because of the libguestfs manipulations, in practice | ||
# it really does. Make it depend on libvirt (so we get libvirtd) for now, | ||
# unless/until we are able to make it really be remote. | ||
%if 0%{?fedora} >= 17 | ||
Requires: libvirt-daemon-kvm | ||
Requires: libvirt-daemon-qemu | ||
Requires: libvirt-daemon-config-network | ||
%else | ||
Requires: libvirt >= 0.9.7 | ||
%endif | ||
Requires: python3-requests | ||
Requires: genisoimage | ||
Requires: mtools | ||
%if 0%{?fedora} < 26 or 0%{?rhel} < 8 | ||
Requires: python-uuid | ||
%endif | ||
Requires: openssh-clients | ||
Requires: python3-m2crypto | ||
Requires: python3-monotonic | ||
|
||
BuildRequires: python3 | ||
|
||
%description | ||
Oz is a set of libraries and utilities for doing automated guest OS | ||
installations, with minimal input from the user. | ||
|
||
%prep | ||
%setup -q | ||
%autosetup -p1 | ||
|
||
%build | ||
%py3_build | ||
|
@@ -66,7 +62,8 @@ if [ ! -f %{_sysconfdir}/oz/id_rsa-icicle-gen ]; then | |
fi | ||
|
||
%files | ||
%doc README COPYING examples | ||
%license COPYING | ||
%doc README examples | ||
%dir %attr(0755, root, root) %{_sysconfdir}/oz/ | ||
%config(noreplace) %{_sysconfdir}/oz/oz.cfg | ||
%dir %attr(0755, root, root) %{_localstatedir}/lib/oz/ | ||
|
@@ -78,13 +75,13 @@ fi | |
%dir %attr(0755, root, root) %{_localstatedir}/lib/oz/jeos/ | ||
%dir %attr(0755, root, root) %{_localstatedir}/lib/oz/kernels/ | ||
%dir %attr(0755, root, root) %{_localstatedir}/lib/oz/screenshots/ | ||
%{python3_sitelib}/oz | ||
%{_bindir}/oz-install | ||
%{_bindir}/oz-generate-icicle | ||
%{_bindir}/oz-customize | ||
%{_bindir}/oz-cleanup-cache | ||
%{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info | ||
%{_mandir}/man1/* | ||
%{python3_sitelib}/oz | ||
%{python3_sitelib}/%{name}*.egg-info | ||
|
||
%changelog | ||
* Sat Feb 5 2022 Peter Robinson <[email protected]> - 0.18.0-1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.