From e4f4556ff6623496d95a834aed00f0e2dc12b83e Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 9 Jan 2019 15:36:41 -0800 Subject: [PATCH] - Run the CI tests using rpmbuild - t6000-dm: Stop using private lvm root --- ...t6000-dm-Stop-using-private-lvm-root.patch | 40 +++++++++++++++++++ parted.spec | 7 +++- tests/.fmf/version | 1 + tests/provision.fmf | 5 +++ tests/simple/run_tests.sh | 29 ++++++++++++++ tests/tests.yml | 33 +++++++++++++++ 6 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 0109-t6000-dm-Stop-using-private-lvm-root.patch create mode 100644 tests/.fmf/version create mode 100644 tests/provision.fmf create mode 100755 tests/simple/run_tests.sh create mode 100644 tests/tests.yml diff --git a/0109-t6000-dm-Stop-using-private-lvm-root.patch b/0109-t6000-dm-Stop-using-private-lvm-root.patch new file mode 100644 index 0000000..82a8f5a --- /dev/null +++ b/0109-t6000-dm-Stop-using-private-lvm-root.patch @@ -0,0 +1,40 @@ +From 23458a9d41c18f5f28766462b9b86165ad0752d0 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Fri, 11 Jan 2019 12:13:46 -0800 +Subject: [PATCH] t6000-dm: Stop using private lvm root + +On Fedora 30 it has stopped working, and really isn't necessary as long +as our device names are unique. + +Related: rhbz#1653912 +--- + tests/t6000-dm.sh | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/tests/t6000-dm.sh b/tests/t6000-dm.sh +index 5b29660..c260b96 100755 +--- a/tests/t6000-dm.sh ++++ b/tests/t6000-dm.sh +@@ -19,10 +19,6 @@ + . "${srcdir=.}/init.sh"; path_prepend_ ../parted + + require_root_ +-lvm_init_root_dir_ +- +-test "x$ENABLE_DEVICE_MAPPER" = xyes \ +- || skip_ "no device-mapper support" + + # Device maps names - should be random to not conflict with existing ones on + # the system +@@ -71,7 +67,7 @@ for type in linear ; do + + # setup: create a mapping + echo "$dmsetup_cmd" | dmsetup create "$type_kwd" || fail=1 +- dev="$DM_DEV_DIR/mapper/$type_kwd" ++ dev="/dev/mapper/$type_kwd" + + # Create msdos partition table + parted -s $dev mklabel msdos > out 2>&1 || fail=1 +-- +2.20.1 + diff --git a/parted.spec b/parted.spec index 1d780f4..fe466cf 100644 --- a/parted.spec +++ b/parted.spec @@ -4,7 +4,7 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 3.2 -Release: 39%{?dist} +Release: 40%{?dist} License: GPLv3+ URL: http://www.gnu.org/software/parted @@ -128,6 +128,7 @@ Patch0106: 0106-clean-the-disk-information-when-commands-fail-in-int.patch Patch0107: 0107-parted-Remove-PED_ASSERT-from-ped_partition_set_name.patch Patch0108: 0108-Added-support-for-Windows-recovery-partition-WINRE-o.patch +Patch0109: 0109-t6000-dm-Stop-using-private-lvm-root.patch BuildRequires: gcc @@ -240,6 +241,10 @@ make check %changelog +* Fri Mar 01 2019 Brian C. Lane - 3.2-40 +- Run the CI tests using rpmbuild +- t6000-dm: Stop using private lvm root + * Sun Feb 17 2019 Igor Gnatenko - 3.2-39 - Rebuild for readline 8.0 diff --git a/tests/.fmf/version b/tests/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/provision.fmf b/tests/provision.fmf new file mode 100644 index 0000000..dd69f34 --- /dev/null +++ b/tests/provision.fmf @@ -0,0 +1,5 @@ +--- + +standard-inventory-qcow2: + qemu: + m: 4G diff --git a/tests/simple/run_tests.sh b/tests/simple/run_tests.sh new file mode 100755 index 0000000..9d40419 --- /dev/null +++ b/tests/simple/run_tests.sh @@ -0,0 +1,29 @@ +#!/bin/sh +set -eux + +: ${1?"Usage: $0 TESTSDIR"} + +TESTSDIR="$1" +SOURCEDIR="${TESTSDIR}/source/" +PACKAGE=parted + +cd "${TESTSDIR}" +if [ ! -e ${PACKAGE}.spec ]; then + echo "Missing ${PACKAGE}.spec" + pwd + ls + exit 1 +fi + +# This runs from the ./tests/ directory +# Install the dependencies from the spec which MUST be copied over by tests.yml +dnf -y build-dep ${PACKAGE}.spec + +# Flattened sources from standard-role-sources +cd "${SOURCEDIR}" || exit + +# Rebuild the package in place, also runs the %check +# skip %prep, it was already run on the source before it was copied over +rpmbuild --noprep --nodeps -bb --build-in-place "${TESTSDIR}/${PACKAGE}.spec" +RET=$? +exit ${RET} diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..46066eb --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,33 @@ +--- +# Run parted's tests by rebuilding the rpm and running the %check section +- hosts: localhost + vars: + package: parted + tenv_workdir: "/tmp/workdir" + tags: + - classic + tasks: + - name: Copy the spec file over to the workdir + copy: + src: "{{ playbook_dir }}/../{{ package }}.spec" + dest: "{{ tenv_workdir }}/" + +- hosts: localhost + vars: + tenv_workdir: "/tmp/workdir" + roles: + - role: standard-test-source + tags: + - always + + - role: standard-test-basic + tags: + - classic + + required_packages: + - dnf + - rpm-build + + tests: + - simple: + run: "./run_tests.sh {{ tenv_workdir }}"