diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2020-03-05 16:04:49 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2020-08-25 18:19:45 +0200 |
commit | 9fc3f1b3edc9def944854206ebcf7dd51fd05185 (patch) | |
tree | eae684d79bae8f8bf147918278994d5c66ef8745 /tests | |
parent | 4e5fc40a00557b5adeef944e01e755cf86ab9325 (diff) |
import-orig: expose unpacked sources dir to the postunpack hook
Use an $GBP_SOURCES_DIR to expose the post-unpack sources dir to the hook.
Include a test that checks that all the expected env variables are set.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/component/deb/test_import_orig.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/component/deb/test_import_orig.py b/tests/component/deb/test_import_orig.py index b95b874d..ef75919e 100644 --- a/tests/component/deb/test_import_orig.py +++ b/tests/component/deb/test_import_orig.py @@ -401,3 +401,18 @@ class TestImportOrig(ComponentTestBase): ("GBP_TAG", "upstream/2.8"), ("GBP_UPSTREAM_VERSION", "2.8"), ("GBP_DEBIAN_VERSION", "2.8-1")]) + + def test_postunpack_env_vars(self): + """ + Test that the expected environment variables are set during + postunpack hook. + """ + repo = ComponentTestGitRepository.create(self.pkg) + os.chdir(self.pkg) + orig = self._orig('2.8') + ok_(import_orig(['arg0', + '--postunpack=printenv > ../postunpack.out', + '--no-interactive', '--pristine-tar', orig]) == 0) + self.check_hook_vars('../postunpack', ["GBP_GIT_DIR", + "GBP_TMP_DIR", + "GBP_SOURCES_DIR"]) |