From 6a1bed53d9ef5e26e190868f05e2be03fd3333eb Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 25 May 2023 14:53:45 +0200 Subject: [PATCH] add test script and configuration --- pefile-tests.sh | 15 +++++++++++++++ python-pefile.spec | 9 ++++++++- tests/tests.yml | 11 +++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 pefile-tests.sh create mode 100644 tests/tests.yml diff --git a/pefile-tests.sh b/pefile-tests.sh new file mode 100755 index 0000000..acb1f2b --- /dev/null +++ b/pefile-tests.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# config +COMMIT="64524fa8a041" +REMOTE="https://github.com/erocarrera/pefile-tests" + +# clone repo and run tests +TESTDIR="$(mktemp --directory ${TMPDIR-/var/tmp}/test-XXXXXXXX)" +trap 'cd /; rm -rf "$TESTDIR"' EXIT +cd "$TESTDIR" +set -ex +git clone $REMOTE repo +cd repo +git checkout "$COMMIT" +pytest tests/pefile_test.py diff --git a/python-pefile.spec b/python-pefile.spec index c172086..e468192 100644 --- a/python-pefile.spec +++ b/python-pefile.spec @@ -4,12 +4,13 @@ Name: python-%{pypi_name} Version: %{pypi_version} -Release: 1%{?dist} +Release: 2%{?dist} Summary: Python PE parsing module License: MIT URL: https://github.com/erocarrera/pefile Source0: %{pypi_name}-%{pypi_version}.tar.gz +Source1: pefile-tests.sh BuildArch: noarch BuildRequires: python3-devel @@ -39,6 +40,8 @@ rm -rf %{pypi_name}.egg-info %install %py3_install +mkdir -p %{buildroot}%{_datadir}/%{name} +cp %{SOURCE1} %{buildroot}%{_datadir}/%{name} %files -n python3-%{pypi_name} %license LICENSE @@ -47,7 +50,11 @@ rm -rf %{pypi_name}.egg-info %{python3_sitelib}/ordlookup %{python3_sitelib}/__pycache__/* %{python3_sitelib}/%{pypi_name}-%{pypi_version}-py%{python3_version}.egg-info +%{_datadir}/%{name} %changelog +* Thu May 25 2023 Gerd Hoffmann - 2023.2.7-2 +- Added test script and configuration. + * Tue May 23 2023 Gerd Hoffmann - 2023.2.7-1 - Initial package. diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..cd09315 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,11 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - git-core + - pytest + tests: + - pefile-tests: + run: /usr/share/python-pefile/pefile-tests.sh