Compare commits
15 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f00b886f17 | ||
|
|
d1e72e3677 | ||
|
|
df740093cc | ||
|
|
0ad0fbeef9 | ||
|
|
2e82ee90f0 | ||
|
|
bd307c7d69 | ||
|
|
d5724a4b25 | ||
|
|
e753df8da2 | ||
|
|
f5a2e7a5d4 | ||
|
|
f6172d0db0 | ||
|
|
a5d5cf52a2 | ||
|
|
7db2b45750 | ||
|
|
2164058f95 | ||
|
|
28afbe9415 | ||
|
|
b43cea136d |
6 changed files with 141 additions and 46 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
9
plans/run-tests.fmf
Normal file
9
plans/run-tests.fmf
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
summary: Run pyparted tests
|
||||
prepare:
|
||||
how: install
|
||||
package:
|
||||
- python3-pyparted
|
||||
execute:
|
||||
script: |
|
||||
fallocate -l 1G $PWD/disk.img
|
||||
./tests/scripts/pyparted-tests $PWD/disk.img
|
||||
|
|
@ -2,7 +2,7 @@ Summary: Python module for GNU parted
|
|||
Name: pyparted
|
||||
Epoch: 1
|
||||
Version: 3.13.0
|
||||
Release: 3%{?dist}
|
||||
Release: 17%{?dist}
|
||||
License: GPL-2.0-or-later
|
||||
URL: https://github.com/dcantrell/pyparted
|
||||
|
||||
|
|
@ -18,7 +18,6 @@ BuildRequires: pkgconfig
|
|||
BuildRequires: e2fsprogs
|
||||
BuildRequires: gnupg2
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-six
|
||||
BuildRequires: python3-setuptools
|
||||
|
||||
%description
|
||||
|
|
@ -55,6 +54,48 @@ make test
|
|||
%{python3_sitearch}/%{name}-%{version}-*.egg-info
|
||||
|
||||
%changelog
|
||||
* Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 1:3.13.0-17
|
||||
- Rebuilt for Python 3.15.0b4 ABI change
|
||||
|
||||
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-16
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||
|
||||
* Wed Jun 03 2026 Python Maint <python-maint@redhat.com> - 1:3.13.0-15
|
||||
- Rebuilt for Python 3.15
|
||||
|
||||
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||
|
||||
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 1:3.13.0-13
|
||||
- Rebuilt for Python 3.14.0rc3 bytecode
|
||||
|
||||
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 1:3.13.0-12
|
||||
- Rebuilt for Python 3.14.0rc2 bytecode
|
||||
|
||||
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Sun Jun 15 2025 Yaakov Selkowitz <yselkowi@redhat.com> - 1:3.13.0-10
|
||||
- Drop unused six dependency
|
||||
|
||||
* Mon Jun 02 2025 Python Maint <python-maint@redhat.com> - 1:3.13.0-9
|
||||
- Rebuilt for Python 3.14
|
||||
|
||||
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 1:3.13.0-6
|
||||
- Rebuilt for Python 3.13
|
||||
|
||||
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
|
|
|
|||
88
tests/scripts/pyparted-tests
Executable file
88
tests/scripts/pyparted-tests
Executable file
|
|
@ -0,0 +1,88 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import parted
|
||||
import sys
|
||||
|
||||
|
||||
def init_disk(disk_img):
|
||||
# Make a disklabel (failures here will raise an error)
|
||||
dev = parted.getDevice(disk_img)
|
||||
disk = parted.freshDisk(dev, "gpt")
|
||||
|
||||
# Make a partition
|
||||
geom = parted.Geometry(device=dev,
|
||||
start=2048,
|
||||
end=50*2048)
|
||||
fs = parted.FileSystem(type="ext4", geometry=geom)
|
||||
part = parted.Partition(disk=disk,
|
||||
type=parted.PARTITION_NORMAL,
|
||||
fs=fs,
|
||||
geometry=geom)
|
||||
disk.addPartition(partition=part,
|
||||
constraint=dev.optimalAlignedConstraint)
|
||||
part.setFlag(parted.PARTITION_BOOT)
|
||||
disk.commit()
|
||||
|
||||
def read_disk(disk_img):
|
||||
# Read the disk and check the partitions
|
||||
dev = parted.getDevice(disk_img)
|
||||
disk = parted.newDisk(dev)
|
||||
|
||||
if dev.length == 0:
|
||||
print("ERROR: Disk has no length", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if len(disk.partitions) != 1:
|
||||
print("ERROR: Wrong number of partitions", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
part = disk.partitions[0]
|
||||
if part.geometry.end != 50*2048:
|
||||
print("ERROR: Partition is wrong length", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if part.geometry.start != 2048:
|
||||
print("ERROR: Parition doesn't start at sector 2048", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def remove_partition(disk_img):
|
||||
# Remove partition and check disk
|
||||
dev = parted.getDevice(disk_img)
|
||||
disk = parted.newDisk(dev)
|
||||
|
||||
if len(disk.partitions) != 1:
|
||||
print("ERROR: Wrong number of partitions", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
disk.removePartition(partition=disk.partitions[0])
|
||||
disk.commit()
|
||||
|
||||
dev = parted.getDevice(disk_img)
|
||||
disk = parted.newDisk(dev)
|
||||
|
||||
if len(disk.partitions) != 0:
|
||||
print("ERROR: Failed to delete partition", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def main(disk_img):
|
||||
print(f"Running tests on {disk_img}")
|
||||
|
||||
try:
|
||||
init_disk(disk_img)
|
||||
read_disk(disk_img)
|
||||
remove_partition(disk_img)
|
||||
except Exception as e:
|
||||
print(f"ERROR: {str(e)}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
print("PASS", file=sys.stderr)
|
||||
sys.exit(0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: %s <disk.img>" % sys.argv[0], file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
main(sys.argv[1])
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
PATH=/usr/bin
|
||||
TMPDIR="$(mktemp -d)"
|
||||
CWD="$(pwd)"
|
||||
|
||||
PACKAGE=pyparted
|
||||
BRANCH=
|
||||
|
||||
# clone the dist-git tree for this package
|
||||
cd ${TMPDIR}
|
||||
fedpkg co ${PACKAGE}
|
||||
cd ${PACKAGE}
|
||||
[ -z "${BRANCH}" ] || fedpkg switch-branch ${BRANCH}
|
||||
fedpkg prep
|
||||
|
||||
# scramble together the extracted source tree name
|
||||
SRCDIR="${PACKAGE}-$(grep Version: ${PACKAGE}.spec | cut -d ' ' -f 2)"
|
||||
|
||||
# run the tests
|
||||
cd ${SRCDIR}
|
||||
#make check # this runs pylint, which is sometimes wrong/noisy
|
||||
make test
|
||||
RET=$?
|
||||
|
||||
# clean up and exit
|
||||
cd ${CWD}
|
||||
rm -rf ${TMPDIR}
|
||||
exit ${RET}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tags:
|
||||
- classic
|
||||
|
||||
required_packages:
|
||||
- fedpkg
|
||||
|
||||
tests:
|
||||
- simple:
|
||||
dir: scripts/
|
||||
run: ./run_tests.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue