diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/component/rpm/test_import_srpm.py | 21 | ||||
-rw-r--r-- | tests/test_rpm.py (renamed from tests/20_test_rpm.py) | 4 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SOURCES/bar.tar.gz (renamed from tests/data/rpm/rpmbuild/SOURCES/bar.tar.gz) | bin | 177 -> 177 bytes | |||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SOURCES/foo.txt (renamed from tests/data/rpm/rpmbuild/SOURCES/foo.txt) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 (renamed from tests/data/rpm/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2) | bin | 383 -> 383 bytes | |||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SOURCES/gbp-test-native-1.0.zip (renamed from tests/data/rpm/rpmbuild/SOURCES/gbp-test-native-1.0.zip) | bin | 656 -> 656 bytes | |||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz (renamed from tests/data/rpm/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz) | bin | 328 -> 328 bytes | |||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SOURCES/my.patch (renamed from tests/data/rpm/rpmbuild/SOURCES/my.patch) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SOURCES/my2.patch (renamed from tests/data/rpm/rpmbuild/SOURCES/my2.patch) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SOURCES/my3.patch (renamed from tests/data/rpm/rpmbuild/SOURCES/my3.patch) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SPECS/gbp-test-native.spec (renamed from tests/data/rpm/rpmbuild/SPECS/gbp-test-native.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SPECS/gbp-test-native2.spec (renamed from tests/data/rpm/rpmbuild/SPECS/gbp-test-native2.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SPECS/gbp-test.spec (renamed from tests/data/rpm/rpmbuild/SPECS/gbp-test.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec (renamed from tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec.orig | 46 | ||||
l--------- | tests/test_rpm_data/specs/gbp-test-native.spec (renamed from tests/data/rpm/specs/gbp-test-native.spec) | 0 | ||||
l--------- | tests/test_rpm_data/specs/gbp-test-native2.spec (renamed from tests/data/rpm/specs/gbp-test-native2.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/specs/gbp-test-quirks.spec (renamed from tests/data/rpm/specs/gbp-test-quirks.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/specs/gbp-test-reference.spec (renamed from tests/data/rpm/specs/gbp-test-reference.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/specs/gbp-test-reference2.spec (renamed from tests/data/rpm/specs/gbp-test-reference2.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/specs/gbp-test-tags.spec (renamed from tests/data/rpm/specs/gbp-test-tags.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/specs/gbp-test-updates-reference.spec (renamed from tests/data/rpm/specs/gbp-test-updates-reference.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/specs/gbp-test-updates.spec (renamed from tests/data/rpm/specs/gbp-test-updates.spec) | 0 | ||||
l--------- | tests/test_rpm_data/specs/gbp-test.spec (renamed from tests/data/rpm/specs/gbp-test.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/specs/gbp-test2-reference.spec (renamed from tests/data/rpm/specs/gbp-test2-reference.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/specs/gbp-test2-reference2.spec (renamed from tests/data/rpm/specs/gbp-test2-reference2.spec) | 0 | ||||
l--------- | tests/test_rpm_data/specs/gbp-test2.spec (renamed from tests/data/rpm/specs/gbp-test2.spec) | 0 | ||||
-rw-r--r-- | tests/test_rpm_data/srpms/gbp-test-1.0-1.src.rpm (renamed from tests/data/rpm/srpms/gbp-test-1.0-1.src.rpm) | bin | 3427 -> 3427 bytes | |||
-rw-r--r-- | tests/test_rpm_data/srpms/gbp-test-native-1.0-1.src.rpm (renamed from tests/data/rpm/srpms/gbp-test-native-1.0-1.src.rpm) | bin | 2187 -> 2187 bytes | |||
-rw-r--r-- | tests/test_rpm_data/srpms/gbp-test-native2-2.0-0.src.rpm (renamed from tests/data/rpm/srpms/gbp-test-native2-2.0-0.src.rpm) | bin | 2008 -> 2008 bytes | |||
-rw-r--r-- | tests/test_rpm_data/srpms/gbp-test2-3.0-0.src.rpm (renamed from tests/data/rpm/srpms/gbp-test2-3.0-0.src.rpm) | bin | 3507 -> 3507 bytes |
31 files changed, 58 insertions, 13 deletions
diff --git a/tests/component/rpm/test_import_srpm.py b/tests/component/rpm/test_import_srpm.py index b35a5bd6..6635400b 100644 --- a/tests/component/rpm/test_import_srpm.py +++ b/tests/component/rpm/test_import_srpm.py @@ -72,8 +72,8 @@ class TestImportPacked(ComponentTestBase): # Check repository state repo = GitRepository('gbp-test2') files = set(['Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt', - 'gbp-test2.spec', 'gbp-test2-alt.spec', 'my.patch', - 'mydir/myfile.txt']) + 'gbp-test2.spec', 'gbp-test2-alt.spec', 'my.patch', + 'mydir/myfile.txt']) self._check_repo_state(repo, 'master', ['master', 'upstream'], files) # Four commits: upstream, packaging files, one patch and the removal @@ -101,7 +101,7 @@ class TestImportPacked(ComponentTestBase): eq_(mock_import(['--native', srpm]), 0) # Check repository state files = set(['.gbp.conf', 'Makefile', 'README', 'dummy.sh', - 'packaging/gbp-test-native.spec']) + 'packaging/gbp-test-native.spec']) repo = GitRepository('gbp-test-native') self._check_repo_state(repo, 'master', ['master'], files) # Only one commit: the imported source tarball @@ -120,7 +120,7 @@ class TestImportPacked(ComponentTestBase): def test_import_compressed_patches(self): """Test importing of non-native src.rpm with compressed patches""" srpm = os.path.join(DATA_DIR, 'gbp-test-1.1-2.src.rpm') - eq_(import_srpm(['arg0', srpm]), 0) + eq_(mock_import([srpm]), 0) # Check repository state repo = GitRepository('gbp-test') files = set(['Makefile', 'README', 'AUTHORS', 'NEWS', 'bar.tar.gz', @@ -144,13 +144,12 @@ class TestImportPacked(ComponentTestBase): eq_(mock_import([srpms[1]]), 0) eq_(len(repo.get_commits()), 4) eq_(len(repo.get_commits(until='upstream')), 1) - eq_(mock_import(['--no-pristine-tar', '--allow-same-version', - srpms[1]]), 0) + eq_(mock_import(['--allow-same-version', srpms[1]]), 0) # Added new versio packaging plus one patch eq_(len(repo.get_commits()), 7) eq_(len(repo.get_commits(until='upstream')), 1) # Import new version - eq_(mock_import(['--no-pristine-tar', srpms[2]]), 0) + eq_(mock_import([srpms[2]]), 0) files = set(['Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt', 'gbp-test.spec', 'my.patch', 'mydir/myfile.txt']) self._check_repo_state(repo, 'master', ['master', 'upstream'], files) @@ -207,7 +206,7 @@ class TestImportPacked(ComponentTestBase): """Test various options of git-import-srpm""" srpm = os.path.join(DATA_DIR, 'gbp-test2-2.0-0.src.rpm') - eq_(mock_import(['--no-pristine-tar', + eq_(mock_import([ '--no-patch-import', '--packaging-branch=pack', '--upstream-branch=orig', @@ -219,9 +218,9 @@ class TestImportPacked(ComponentTestBase): # Check repository state repo = GitRepository('gbp-test2') files = set(['Makefile', 'README', 'dummy.sh', 'packaging/bar.tar.gz', - 'packaging/foo.txt', 'packaging/gbp-test2.spec', - 'packaging/gbp-test2-alt.spec', 'packaging/my.patch', - 'packaging/my2.patch', 'packaging/my3.patch']) + 'packaging/foo.txt', 'packaging/gbp-test2.spec', + 'packaging/gbp-test2-alt.spec', 'packaging/my.patch', + 'packaging/my2.patch', 'packaging/my3.patch']) self._check_repo_state(repo, 'pack', ['pack', 'orig'], files) eq_(len(repo.get_commits()), 2) # Check packaging dir diff --git a/tests/20_test_rpm.py b/tests/test_rpm.py index 52a14ff1..97390465 100644 --- a/tests/20_test_rpm.py +++ b/tests/test_rpm.py @@ -27,7 +27,7 @@ from gbp.rpm import (SrcRpmFile, SpecFile, parse_srpm, NoSpecError, guess_spec, guess_spec_repo, spec_from_repo) from gbp.git.repository import GitRepository -DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data','rpm') +DATA_DIR = os.path.abspath(os.path.splitext(__file__)[0] + '_data') SRPM_DIR = os.path.join(DATA_DIR, 'srpms') SPEC_DIR = os.path.join(DATA_DIR, 'specs') @@ -390,7 +390,7 @@ class TestUtilityFunctions(object): def test_parse_srpm(self): """Test parse_srpm() function""" parse_srpm(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm')) - assert_raises(GbpError, parse_srpm, + assert_raises(GbpError, parse_srpm, os.path.join(DATA_DIR, 'notexists.src.rpm')) """ diff --git a/tests/data/rpm/rpmbuild/SOURCES/bar.tar.gz b/tests/test_rpm_data/rpmbuild/SOURCES/bar.tar.gz Binary files differindex f5dae803..f5dae803 100644 --- a/tests/data/rpm/rpmbuild/SOURCES/bar.tar.gz +++ b/tests/test_rpm_data/rpmbuild/SOURCES/bar.tar.gz diff --git a/tests/data/rpm/rpmbuild/SOURCES/foo.txt b/tests/test_rpm_data/rpmbuild/SOURCES/foo.txt index 25ed442f..25ed442f 100644 --- a/tests/data/rpm/rpmbuild/SOURCES/foo.txt +++ b/tests/test_rpm_data/rpmbuild/SOURCES/foo.txt diff --git a/tests/data/rpm/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 b/tests/test_rpm_data/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 Binary files differindex 7d0759fe..7d0759fe 100644 --- a/tests/data/rpm/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 +++ b/tests/test_rpm_data/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 diff --git a/tests/data/rpm/rpmbuild/SOURCES/gbp-test-native-1.0.zip b/tests/test_rpm_data/rpmbuild/SOURCES/gbp-test-native-1.0.zip Binary files differindex 22a273d1..22a273d1 100644 --- a/tests/data/rpm/rpmbuild/SOURCES/gbp-test-native-1.0.zip +++ b/tests/test_rpm_data/rpmbuild/SOURCES/gbp-test-native-1.0.zip diff --git a/tests/data/rpm/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz b/tests/test_rpm_data/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz Binary files differindex 7b3eaf3c..7b3eaf3c 100644 --- a/tests/data/rpm/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz +++ b/tests/test_rpm_data/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz diff --git a/tests/data/rpm/rpmbuild/SOURCES/my.patch b/tests/test_rpm_data/rpmbuild/SOURCES/my.patch index 50870df2..50870df2 100644 --- a/tests/data/rpm/rpmbuild/SOURCES/my.patch +++ b/tests/test_rpm_data/rpmbuild/SOURCES/my.patch diff --git a/tests/data/rpm/rpmbuild/SOURCES/my2.patch b/tests/test_rpm_data/rpmbuild/SOURCES/my2.patch index ad5ca2d2..ad5ca2d2 100644 --- a/tests/data/rpm/rpmbuild/SOURCES/my2.patch +++ b/tests/test_rpm_data/rpmbuild/SOURCES/my2.patch diff --git a/tests/data/rpm/rpmbuild/SOURCES/my3.patch b/tests/test_rpm_data/rpmbuild/SOURCES/my3.patch index 9fee859d..9fee859d 100644 --- a/tests/data/rpm/rpmbuild/SOURCES/my3.patch +++ b/tests/test_rpm_data/rpmbuild/SOURCES/my3.patch diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test-native.spec b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test-native.spec index 38b07e48..38b07e48 100644 --- a/tests/data/rpm/rpmbuild/SPECS/gbp-test-native.spec +++ b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test-native.spec diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test-native2.spec b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test-native2.spec index 34fd33dc..34fd33dc 100644 --- a/tests/data/rpm/rpmbuild/SPECS/gbp-test-native2.spec +++ b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test-native2.spec diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test.spec b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test.spec index c46a734e..c46a734e 100644 --- a/tests/data/rpm/rpmbuild/SPECS/gbp-test.spec +++ b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test.spec diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec index 8a92725d..8a92725d 100644 --- a/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec +++ b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec diff --git a/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec.orig b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec.orig new file mode 100644 index 00000000..ffae7e99 --- /dev/null +++ b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec.orig @@ -0,0 +1,46 @@ +Name: gbp-test2 +Summary: Test package 2 for git-buildpackage +Epoch: 2 +Version: 3.0 +Release: 0 +Group: Development/Libraries +License: GPLv2 +Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz +Source: foo.txt +Source20: bar.tar.gz +# Gbp-Ignore-Patches: 0 +Patch: my.patch +Patch10: my2.patch +Patch20: my3.patch +Packager: Markus Lehtonen <markus.lehtonen@linux.intel.com> + +%description +Package for testing the RPM functionality of git-buildpackage. + + +%prep +%setup -T -n %{name}-%{version} -c -a 10 + +%patch +%patch -P 10 -p1 + +echo "Do things" + +# Gbp-Patch-Macros + +%build +make + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} +install %{SOURCE0} %{buildroot}/%{_datadir}/%{name} + + + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} diff --git a/tests/data/rpm/specs/gbp-test-native.spec b/tests/test_rpm_data/specs/gbp-test-native.spec index 60de36f2..60de36f2 120000 --- a/tests/data/rpm/specs/gbp-test-native.spec +++ b/tests/test_rpm_data/specs/gbp-test-native.spec diff --git a/tests/data/rpm/specs/gbp-test-native2.spec b/tests/test_rpm_data/specs/gbp-test-native2.spec index ad13ad6a..ad13ad6a 120000 --- a/tests/data/rpm/specs/gbp-test-native2.spec +++ b/tests/test_rpm_data/specs/gbp-test-native2.spec diff --git a/tests/data/rpm/specs/gbp-test-quirks.spec b/tests/test_rpm_data/specs/gbp-test-quirks.spec index bb56b008..bb56b008 100644 --- a/tests/data/rpm/specs/gbp-test-quirks.spec +++ b/tests/test_rpm_data/specs/gbp-test-quirks.spec diff --git a/tests/data/rpm/specs/gbp-test-reference.spec b/tests/test_rpm_data/specs/gbp-test-reference.spec index 050d1398..050d1398 100644 --- a/tests/data/rpm/specs/gbp-test-reference.spec +++ b/tests/test_rpm_data/specs/gbp-test-reference.spec diff --git a/tests/data/rpm/specs/gbp-test-reference2.spec b/tests/test_rpm_data/specs/gbp-test-reference2.spec index 0fbe0260..0fbe0260 100644 --- a/tests/data/rpm/specs/gbp-test-reference2.spec +++ b/tests/test_rpm_data/specs/gbp-test-reference2.spec diff --git a/tests/data/rpm/specs/gbp-test-tags.spec b/tests/test_rpm_data/specs/gbp-test-tags.spec index ee4c2b94..ee4c2b94 100644 --- a/tests/data/rpm/specs/gbp-test-tags.spec +++ b/tests/test_rpm_data/specs/gbp-test-tags.spec diff --git a/tests/data/rpm/specs/gbp-test-updates-reference.spec b/tests/test_rpm_data/specs/gbp-test-updates-reference.spec index ff56f589..ff56f589 100644 --- a/tests/data/rpm/specs/gbp-test-updates-reference.spec +++ b/tests/test_rpm_data/specs/gbp-test-updates-reference.spec diff --git a/tests/data/rpm/specs/gbp-test-updates.spec b/tests/test_rpm_data/specs/gbp-test-updates.spec index dc8ffbf9..dc8ffbf9 100644 --- a/tests/data/rpm/specs/gbp-test-updates.spec +++ b/tests/test_rpm_data/specs/gbp-test-updates.spec diff --git a/tests/data/rpm/specs/gbp-test.spec b/tests/test_rpm_data/specs/gbp-test.spec index 30ae2845..30ae2845 120000 --- a/tests/data/rpm/specs/gbp-test.spec +++ b/tests/test_rpm_data/specs/gbp-test.spec diff --git a/tests/data/rpm/specs/gbp-test2-reference.spec b/tests/test_rpm_data/specs/gbp-test2-reference.spec index 1882131f..1882131f 100644 --- a/tests/data/rpm/specs/gbp-test2-reference.spec +++ b/tests/test_rpm_data/specs/gbp-test2-reference.spec diff --git a/tests/data/rpm/specs/gbp-test2-reference2.spec b/tests/test_rpm_data/specs/gbp-test2-reference2.spec index d41f4503..d41f4503 100644 --- a/tests/data/rpm/specs/gbp-test2-reference2.spec +++ b/tests/test_rpm_data/specs/gbp-test2-reference2.spec diff --git a/tests/data/rpm/specs/gbp-test2.spec b/tests/test_rpm_data/specs/gbp-test2.spec index af4080cb..af4080cb 120000 --- a/tests/data/rpm/specs/gbp-test2.spec +++ b/tests/test_rpm_data/specs/gbp-test2.spec diff --git a/tests/data/rpm/srpms/gbp-test-1.0-1.src.rpm b/tests/test_rpm_data/srpms/gbp-test-1.0-1.src.rpm Binary files differindex 74afbd6c..74afbd6c 100644 --- a/tests/data/rpm/srpms/gbp-test-1.0-1.src.rpm +++ b/tests/test_rpm_data/srpms/gbp-test-1.0-1.src.rpm diff --git a/tests/data/rpm/srpms/gbp-test-native-1.0-1.src.rpm b/tests/test_rpm_data/srpms/gbp-test-native-1.0-1.src.rpm Binary files differindex 1002aaea..1002aaea 100644 --- a/tests/data/rpm/srpms/gbp-test-native-1.0-1.src.rpm +++ b/tests/test_rpm_data/srpms/gbp-test-native-1.0-1.src.rpm diff --git a/tests/data/rpm/srpms/gbp-test-native2-2.0-0.src.rpm b/tests/test_rpm_data/srpms/gbp-test-native2-2.0-0.src.rpm Binary files differindex 880b3100..880b3100 100644 --- a/tests/data/rpm/srpms/gbp-test-native2-2.0-0.src.rpm +++ b/tests/test_rpm_data/srpms/gbp-test-native2-2.0-0.src.rpm diff --git a/tests/data/rpm/srpms/gbp-test2-3.0-0.src.rpm b/tests/test_rpm_data/srpms/gbp-test2-3.0-0.src.rpm Binary files differindex 1cf12c7a..1cf12c7a 100644 --- a/tests/data/rpm/srpms/gbp-test2-3.0-0.src.rpm +++ b/tests/test_rpm_data/srpms/gbp-test2-3.0-0.src.rpm |