summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* quilt-gbp test: Set DGIT_TEST_TOLERATE_UNPATCHED_CLEANSean Whitton2018-01-07
| | | | | | | | | | | | | | | In quilt-gbp we want to test whether dgit detects that quilt fixups cannot be linear because the user has failed to pass an appropriate quilt option in a patches-unapplied tree. build_source() cleans before applying patches, and the package's clean target might error out because patches are not applied. This prevents dgit from attempting quilt linearisation and thus determining that the tree might be patches-unapplied. So set an environment variable telling the package's clean target not to do that. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name> Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* example_1.0 worktree: Accept DGIT_TEST_TOLERATE_UNPATCHED_CLEANSean Whitton2018-01-07
| | | | | | | | | | | | The clean target in the quilt-tip-2 branch in the example_1.0 worktree errors out if patches are not applied. With this change, if DGIT_TEST_TOLERATE_UNPATCHED_CLEAN is set to "true", it will not error out in this case. No users, so no functional change. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name> Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: lib: t-git-fsck: put dgit-test-fsck.errs in git dirIan Jackson2018-01-07
| | | | | | | | | | This needs to not be in the working tree; it causes trouble there. This was broken in 090071ae8e31c8f81283af477c1114835ed8fd02 "test suite: Tolerate worktrees when trying to git-fsck" Reported-by: Sean Whitton <spwhitton@spwhitton.name> Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: t-git-fsck: Introduce fsckerrs variableIan Jackson2018-01-07
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gnupg: Do not fail if we have no tty when we failIan Jackson2018-01-07
| | | | | | | Tolerate failure of the error log reporting arrangement. That way the retry loop is effective even if we don't have a tty. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gnupg: Fix sleep length in apt-get gpg --import caseIan Jackson2018-01-07
| | | | | | | This was supposed to sleep for 5 seconds _instead_. This is a kind-of-expected error and it's best to carry on a bit quicker. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: In ad-hoc runs, honour DGIT_TEST_RETRY_COUNTIan Jackson2018-01-07
| | | | | | | | | | | | | | This lets us retry each failed test. This is beneficial because the gnupg race is sort-of independent. When we want to test every commit, the success probability before is ( 1 - P(gnupg causes test fail)) ) ^ (number of tests) for each commit. With this change it's ( 1 - P(gnupg causes test fail)^retries ) ^ (number of tests) which is much much better. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gnupg: Do not count as "trouble" a 0-byte input file failureIan Jackson2018-01-07
| | | | | | | apt-key seems to feed gpg --import an empty pipe. This makes gpg exit with status 2. We think this is trouble, but it isn't. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gnupg: Save stdin on apt-key's import invocationsIan Jackson2018-01-07
| | | | | | | | | | | | Recognise these with an ad-hoc pattern on the command line arguments. When they occur, save stdin to a temporary file. We can't do this generally, because stdin might be some thing that gpg's caller doesn't expect gpg to eat. When we do this saving, print the size in bytes of the input file. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gnupg: Run with a lock heldIan Jackson2018-01-07
| | | | | | This is also an attempt to reduce the impact of the gnupg races. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: Export troot as an environment variableIan Jackson2018-01-07
| | | | | | This will be useful in a moment. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gnupg: Have three goes, rather than twoIan Jackson2018-01-07
| | | | | | | | | The retry strategy is, empirically, fairly successful. But the failure probability is still high enough to be a real nuisance. Let's try running it a 3rd time if the second fails. Maybe this will reduce the overall impact. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gnupg setup: give each individual test its own AGENT.logIan Jackson2018-01-07
| | | | | | | | | | This was always the intent. However, the structure here arranged to put the actual value of GNUPGHOME into the import script. Instead, move the GNUGPHOME setting into the setup fragment, which is evaluated by the importer. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: dpkgsourceignores-docs: Correct restrictionIan Jackson2018-01-06
| | | | | | | | | | Restrictions need to be invoked in test suites with t-restrict NAME-OF-RESTRICTION not by calling t-restrction-something. Only the former gets translated to the format used in debian/tests/control. Reported-by: Sean Whitton <spwhitton@spwhitton.name> Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gitworktree: Test quiltificationIan Jackson2017-08-04
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gitworktree: Add some more operationsIan Jackson2017-08-04
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: dpkgsourceignores-correct: Test that the rune DTRTIan Jackson2017-08-04
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: dpkgsourceignores-docs: Use print-dpkg-source-ignoresIan Jackson2017-08-04
| | | | | | Rather than fishing the value out of the in-tree dgit source code. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: dpkgsourceignores-docs: Check dgit-maint-merge(7) -i -I runeIan Jackson2017-08-04
| | | | | | Check that the rune we document is the same as dgit actually uses. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: Break out t-dgit-manpageIan Jackson2017-08-04
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: stunt gnupg: Much better logging of race errorsIan Jackson2017-08-04
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: stunt gnupg runs gpg again if it exits status 2Ian Jackson2017-08-04
| | | | | | | | | Work around gnupg agent connection races by having our stunt gpg wrapper simply try running gpg again, once, if it exits 2. This does not fully suppress the bug but it does significantly reduce the probability. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: Make t-dgit print pwd to stderr, not stdoutIan Jackson2017-08-03
| | | | | | | This means that tests can capture the output from t-dgit without going wrong. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: gitworktree: New testIan Jackson2017-08-03
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: Tolerate worktrees when trying to git-fsckIan Jackson2017-08-03
| | | | | | | | | A `git worktree' has a file for .git. We still want to fsck them. We can simply run the fsck in the directory containing .git, instead. That works for ordinary trees with a .git directory, and for worktrees. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: sbuild-gitish: Insist on using "build" chrootIan Jackson2017-08-03
| | | | | | | | | | In "test suite: sbuild-gitish: Find sbuild rune in the manpage" aka f5c0d33ede8a we accidentally switched from "build" to "jessie". Randomly messing about with the user's "jessie" chroot is not very nice. (And it would break in a hypothetical formal test providing the x-dgit-schroot-build capability.) Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: sbuild-gitish: Find sbuild rune in the manpageIan Jackson2017-07-18
| | | | | | | This avoids duplicating this rune (so the manpage can't get out of date). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* sbuild-gitish: New test case to check running sbuild from gitIan Jackson2017-07-18
| | | | | | | This involves creating a new "gitish-only" branch in the example worktree. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* quilt fixup: Check that funny changes are represented properlyIan Jackson2017-07-16
| | | | | | | | Specifically, do dgit push --dry-run. This will check that the source package and git tree agree - ie, that what we have produced can round-trip through dpkg-source. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* quilt fixup: Check we can delete files with funny modesIan Jackson2017-07-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: unrepres. changes: Tolerate creation of symlinksIan Jackson2017-07-16
| | | | | | | | | | | | | | | | Experimentally, dpkg-source on stretch will create patches to create new symlinks. (It will fail on attempts to modify existing symlinks and it ignores attempts to change plain file executability.) Implementation: add an alternative which tolerates the git symlink mode. This replaces the check on $oldmode, which in this context we know is all 0s and can therefore never match. While we're here, change the error message. Closes:#857382. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: unrepres. changes: Tolerate deletion of executable filesIan Jackson2017-07-16
| | | | | | | | | | | | | | | We don't care what the old mode was; if we tell dpkg-source to record the deletion it can do so. But we do care that it was a file. Experimentally, dpkg-source on stretch ignores attempts to delete symlinks. The removal of the check for $newmode has no functional change, because in this context we know that $newmode is all 0s. If it wasn't, we would have been in "both old and new files exist", above. So that limb of the test will never match and should be removed. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: unrepres. changes: Prepare to tolerate symlinksIan Jackson2017-07-16
| | | | | | | | | | | | | | | | | | | | | | Permit symlinks (which have mode 120000 in git) to make their way through for more detailed checks. No functional change except to error messages, because: * If neither thing was a symlink, then the existing regexps still match and the new "modified symlink" clause will not, so the flow is unchanged. * Otherwise, if both $oldmode and $newmode match [^0], ie, this is a modification rather than deletion or removal, we insist that $oldmode=$newmode, and then, fail the new "modified symlink" check. * Otherwise, we fail the check for default mode. So in the case we are allowing to proceed further, we fail as before. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: Test symlink modification and deletion, not creationIan Jackson2017-07-16
| | | | | | | | We are going to tolerate symlink creation, because dpkg-source can consume patches to create symlinks (even though it cannot create them). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: run git gc on tests/worktrees/example_1.0.tarIan Jackson2017-07-16
| | | | | | | | Specifically, git-gc --aggressive --prune=all This shrinks it quite a lot. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: Introduce example 1.1 orig containg some interesting objectsIan Jackson2017-07-16
| | | | | | | | | | | We are going to want to test alternation/deletion of symlinks and non-644 files. To test this we need to switch to using example_1.1.orig.tar.gz (and the corresponding git branch in the worktree), so that we have such existing objects. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: import-dsc: Test missing files, particularly in ..Ian Jackson2017-07-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: t-report-fail: print $PWD as part of failure messageIan Jackson2017-07-16
| | | | | | This is really helpful when debugging. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Regularise patch filenames, and defend against funny commit subjectsIan Jackson2017-07-09
| | | | | | | * Do not specified patch names which look like series filenames * When we invent a filename based on a commit message, add ".patch". Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: Test multisuite clone without --rm-on-error.Ian Jackson2017-07-08
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: badcommit-fixup: Check core.sharedRepository worksIan Jackson2017-07-08
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: Cope with git restricting ext:: protocols.Ian Jackson2017-07-08
| | | | | | | buster's git rejects ext:: by default. See #XXXX and man git-config |less +/'protocol.*allow' Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* import-maintmangle: New test for changelog Maintainer mangling.Ian Jackson2017-02-05
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* lib-import-chk: New import_chk_changelog_massage hookIan Jackson2017-02-05
| | | | | | Nothing sets this yet, so no functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: lib-import-chk: Test commit authorshipIan Jackson2017-02-05
| | | | | | | Check that commits have smae authorship as appears in the changelog. (Or, at least, the same authorship set.) Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: quilt-useremail: New test for user config copyingIan Jackson2017-02-05
| | | | | | Test for #853085. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: overwrite-chkclog: test UNRELEASED handling.Ian Jackson2017-01-25
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: defdistro-setup: Test that setup-* functions distro selection works.Ian Jackson2017-01-23
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: t-defdistro: Set distro='' tooIan Jackson2017-01-23
| | | | | | | This means that t-defdistro works without t-chain-test and reinvocation. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* test suite: defdistro-dsd-clone-drs: New testIan Jackson2017-01-21
| | | | | | Would have detected #851906 (and hopefully #850521). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>