summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2014-01-14tests: add more comprehensive tests for import-srpmMarkus Lehtonen3-0/+335
Basic tests for virtually all features of import-srpm. Adds a new python module to include all (upcoming) git-buildpackage rpm commandline tool tests. Also, adds a separate git submodule for the rpm test data. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14rpm: introduce new 'Gbp-Patch-Macros' special key in spec parsingMarkus Lehtonen3-0/+57
This can be used to mark location where to add new patch macros when updating the spec. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14rpm: rename the 'GbpIgnorePatch' special key in spec parsingMarkus Lehtonen3-3/+3
to 'Gbp-Ignore-Patches' for better readability. All the special keys (or "gbp-tags") now have to start with the "Gbp-" prefix. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14tests: add unittests for gbp.rpmMarkus Lehtonen23-0/+445
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14Introduce git-import-orig-rpm toolMarkus Lehtonen1-1/+2
Initial version of the git-import-orig-rpm: version of git-import-orig intended for maintaining rpm packages. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14Introduce git-buildpackage-rpm toolMarkus Lehtonen1-1/+2
Initial version of git-buildpackage-rpm: git-buildpackage tool for rpms. Also adds some new options to config.py that are exclusively used in this tool. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com>
2014-01-14Introduce gbp-pq-rpm toolMarkus Lehtonen1-1/+2
Initial version of gbp-pq-rpm: a tool for managing patch queues for rpm packages. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Olev Kartau <olev.kartau@intel.com>
2014-01-14Introduce git-import-srpm toolMarkus Lehtonen1-0/+9
Initial version of the git-import-srpm: a tool for importing source rpms. Unit tests: created a separate method in TestHelp for RPM-specific commands. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2014-01-14gbp-pq: readiness to configure the pq branch nameMarkus Lehtonen1-1/+2
All other gbp branches have configurable names. This commit adds the readiness for user to configure/change the name of the patch-queue branches, as well. Patch-queue is defined in options as a format string, where '%(branch)s' refers to the debian/packaging branch. If the pq-branch format string does not contain '%(branch)s', there is only one patch-queue branch and the debian/packaging branch is used as its base branch. That is, e.g. a 'gbp-pq switch' operation from the patch-queue branch always switches to the debian/packaging branch. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Olev Kartau <olev.kartau@intel.com>
2014-01-14Universal configurable base tmpdir for all gbp toolsMarkus Lehtonen1-4/+4
Adds support for a configurable tmpdir under which all gbp tools now create their temporary directories and files. NOTE: an exception is git-import-dscs which doesn't use the common configuration system. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14GitRepository/add_files: add new option 'untracked'Markus Lehtonen1-0/+6
With this option you can either only update already tracked files to index the (untracked=False) or add new files, too. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14config: read the right config if run from subdirMarkus Lehtonen1-7/+7
A step towards being able to run GBP tools from subdirectories. Now expands '%(top_dir)s' and '%(git_dir)s' in config file path to root of the working directory and git metadata directory, respectively. Also, adds a new method _read_config_file() in preparation for supporting per-tree config files. Fixes tests.test_Config: currently the only correct way to define the config file(s) to be parsed is by using the GBP_CONF_FILES environment variable. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14tests.testutils: add ls_zip() helperMarkus Lehtonen1-0/+11
For listing zip contents. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14import-orig: new function for filtering/re-packing sourcesMarkus Lehtonen2-0/+150
Introduces a new function prepare_sources() that prepares upstream sources for importing into upstream branch and pristine-tar. That includes unpacking, filtering and re-packing sources. What somewhat complicates the logic is that it tries to avoid excess unpacking/packing of the sources. Also fixes the unpacking / filtering / repacking logic which was broken with some parameter combinations. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14UpstreamSource: implement prefix guessingMarkus Lehtonen1-1/+5
Add a new attribure 'prefix', i.e. the "leading directory name" in an archive. For example, this usually is '<name>-<version>' in release tarballs. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-14tests: test find_source() with unittestMarkus Lehtonen1-0/+64
Change doctests to unittests in order to have more flexibility in testing. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09UpstreamSource: move version guessing logic to PkgPolicyMarkus Lehtonen1-0/+6
PkgPolicy is more logical context, for example if guessing version from a plain filename and not a real file. Also, changes guess_version() to always return a tuple to simplify checking its return value. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09UpstreamSource: introduce is_tarball() methodMarkus Lehtonen1-0/+4
New method for checking if the sources are a tarball (possibly for checking if the sources are committable by pristine-tar). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09UpstreamSource.pack: support prefix manglingMarkus Lehtonen1-0/+9
Add support for changing the prefix directory inside the tarball that is generated. Also, fixes a bug that caused a "prefix-less" tarball to get one, if unpacked and then repacked. Also, adds this support to repack_source() in common/import_orig. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09GitRepository: add diff_status methodMarkus Lehtonen1-0/+13
This is a method of getting the filename and status information of a diff. That is, a list of files that changed and their status, "added", "modified" etc. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09GitRepository: allow repo inititialization from subdirMarkus Lehtonen1-2/+2
This allows initialization of a GitRepository object, even if the current working directory (or path given to GitRepository) is not the top level directory of the git repository. Don't guess the git meta data dir, but, take it as reported by git itself. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09GitRepository: Implement status methodEd Bartosh1-0/+22
Simple wrapper to the git-status command. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09GitRepository: raise GitRepositoryError instead of GbpErrorMarkus Lehtonen1-1/+1
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09GitRepository.archive: support getting tar data as return valueMarkus Lehtonen1-1/+1
Return tar data as a generator object, if the 'output' option is not defined. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-09tests: more robust check for the default urgency level of dchMarkus Lehtonen1-9/+14
The dch tool might not report it's version if it is incorrectly compiled. Create a dummy changelog and parse it "manually" to determine the default urgency level. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-01-07tests: adapt dch tests for older devscriptsMarkus Lehtonen2-17/+39
Determine the default urgency level by determining the version number of the dch tool from command line. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-12-17Adjust test cases to newer devscriptsGuido Günther1-15/+15
Closes: #732384
2013-10-31pq: rewrite patch export functionalityMarkus Lehtonen1-9/+6
Use our own function for constructing the patch files instead of using the format-patch command of git. This way, we get the desired output format directly, without the need for the error-prone "format-patch, parse patch files, mangle and re-write patch files" cycle. Also, fix patch naming in patch generation when '--no-patch-numbers' is used. Previously, multiple commits with the same subject resulted in multiple patches having the same filename. This lead into broken series with missing patches as patch files were overwritten by the topmost commit. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10tests: remove unused import in submodule testsMarkus Lehtonen1-1/+0
Change-Id: Ida67f9640624a92ffc1afd90dc33efe01b38db5c Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10tests: upper case global variables in submodule testsMarkus Lehtonen1-38/+38
Prevent some confusing name clashes. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10tests: add some docstrings to git submodule testsMarkus Lehtonen1-0/+4
Change-Id: I0ba9e6b59e2a819b5cde1be6fbb53b8ecbb67025 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10tests: use eq_ and ok_ from nose tools in submodule testsMarkus Lehtonen1-12/+13
For consistency and better assert error messages. Change-Id: Ie6502daac6cee0176db5f099b91803292c17ceea Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10tests: add test for archiving without git submodulesMarkus Lehtonen1-15/+22
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10git: new class and method for remote repositoriesMarkus Lehtonen1-0/+22
Add a new GitRemote class for representing git remote repositories. The initial, very limited, version only contains information about the fetch and push URLs of the remote repository. Also, add a new GitRepository.get_remotes() method for getting remote repositories as instances of the new GitRemote class. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10GitRepository.pull: Add 'all_remotes' optionLingchaox Xin1-0/+2
Also changes the method to utilize the GitArgs class. Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10GitRepository.push: Add 'tags' optionLingchaox Xin1-0/+2
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10GitRepository.push: Add 'force' optionLingchaox Xin1-0/+1
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10GitRepository.list_tree: add 'paths' optionMarkus Lehtonen1-1/+4
Change-Id: I9331fec6fcd0e58dad7cb4a571a683e09ce08011 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-05ComponentTestBase: use eq_() ok_() from nose.toolsMarkus Lehtonen1-9/+9
For better assert messages. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-05GitRepository.diff: add 'text' optionMarkus Lehtonen1-0/+2
For generating textual diffs. Useful for Pq - for example, the 'patch' utility does not support git binary diffs. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04GitRepository: Add clean() methodMarkus Lehtonen1-0/+18
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04GitRepository.fetch: Add 'all_remotes' optionLingchaox Xin1-0/+1
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04GitRepository.fetch: Add 'refspec' optionLingchaox Xin1-0/+1
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04GitRepository.describe: add 'tags' and 'extra-match' optionsLingchaox Xin1-0/+6
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04ComponentTestBase: keep tmpdir if GBP_TESTS_NOCLEAN is in envMarkus Lehtonen1-1/+2
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04ComponentTestBase: fix env restore in teardownMarkus Lehtonen1-1/+2
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04ComponentTestBase: more verbose output in case of branch mismatchMarkus Lehtonen1-1/+4
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-08-28Use open() instead of file()Guido Günther8-10/+10
since the later doesn't exist in python3
2013-08-21dch: make automatic adding of new sections more robustGuido Günther1-0/+73
This code that determined if we found a snapshot header was obuscated by the code that determines the commits to add. Split those and better document their purpose. Also always return the commit to start from so we don't need to repeat the logic in the uper levels.
2013-08-21Move MockedChangelog to testutilsGuido Günther2-18/+15
and allow to specify the content so we can reuse it for other dch tests.