From 4e940c091ed989ac8ab1e3024a49e02592eb1050 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 14 Mar 2023 14:59:35 -0700 Subject: [PATCH] tests: Restore missing pykickstart tests --- tests/.fmf/version | 1 + tests/provision.fmf | 5 +++++ tests/scripts/run_tests.sh | 26 ++++++++++++++++++++++++++ tests/tests.yml | 25 +++++++++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 tests/.fmf/version create mode 100644 tests/provision.fmf create mode 100755 tests/scripts/run_tests.sh create mode 100644 tests/tests.yml 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..62a6eba --- /dev/null +++ b/tests/provision.fmf @@ -0,0 +1,5 @@ +--- + +standard-inventory-qcow2: + qemu: + m: 2G diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100755 index 0000000..124698d --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +PATH=/usr/bin:/usr/local/bin +SRC="$1" + +cd "${SRC}" || exit 1 + +# Install test suite dependencies that are only available in +# certain package repos. Since this is throw-away, just install +# using pip. +pip-3 install pocketlint +pip-3 install ordered_set +pip-3 install nose==1.3.6 + +# Install required packages +dnf install -y git + +# We need the translation canary in place too +[ -d translation-canary ] || git clone https://github.com/rhinstaller/translation-canary + +# Run the test suite +make check || exit $? + +make coverage COVERAGE=coverage-3 NOSE_PROCESSES=0 NOSE_PROCESS_TIMEOUT=60 || exit $? + +exit 0 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..975cc31 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,25 @@ +--- +# Run pykickstart's test suite +# +# playbook based on pyparted. +# +- hosts: localhost + roles: + # Fetch package source + - role: standard-test-source + tags: + - classic + + - role: standard-test-basic + tags: + - classic + required_packages: + - make + - git + - python3-coverage + - python3-devel + - redhat-rpm-config + tests: + - simple: + dir: scripts/ + run: ./run_tests.sh ../source