[reprotest] 03/03: Test the extra variations we added recently and ensure they don't get missed in the future
Ximin Luo
infinity0 at debian.org
Tue Jan 24 21:17:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository reprotest.
commit c164fb5cf479f72c376e131003e65ca438d005c0
Author: Ximin Luo <infinity0 at debian.org>
Date: Tue Jan 24 22:17:20 2017 +0100
Test the extra variations we added recently and ensure they don't get missed in the future
---
TODO | 1 -
tests/mock_build.py | 6 ++++++
tests/tests.py | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/TODO b/TODO
deleted file mode 100644
index 7c52022..0000000
--- a/TODO
+++ /dev/null
@@ -1 +0,0 @@
-- make mock_build capture more stuff and test it in tests.py:test_variations
diff --git a/tests/mock_build.py b/tests/mock_build.py
index 68ebbd9..35977d6 100755
--- a/tests/mock_build.py
+++ b/tests/mock_build.py
@@ -26,6 +26,10 @@ if __name__ == '__main__':
# Like the above test, this test can theoretically fail by
# producing the same file order, but this is unlikely, if not
# as unlikely as in the above test.
+ if 'environment' in captures:
+ output.append("\n".join(os.environ.keys()).encode("ascii"))
+ if 'build_path' in captures:
+ output.append(os.getcwd().encode("ascii"))
if 'fileordering' in captures:
# Ensure this temporary directory is created in the disorders
# mount point by passing the dir argument.
@@ -43,6 +47,8 @@ if __name__ == '__main__':
output.append(subprocess.check_output(['locale']))
if 'exec_path' in captures:
output.extend(p.encode('ascii') for p in os.get_exec_path())
+ if 'time' in captures:
+ output.append(str(time.time()).encode('ascii'))
if 'timezone' in captures:
output.append(str(time.timezone).encode('ascii'))
if 'umask' in captures:
diff --git a/tests/tests.py b/tests/tests.py
index e0f4070..28dcdd7 100755
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -45,7 +45,7 @@ def test_simple_builds(virtual_server):
check_return_code('python3 mock_build.py irreproducible', virtual_server, 1)
# TODO: test all variations that we support
- at pytest.mark.parametrize('captures', ['fileordering', 'home', 'kernel', 'locales', 'exec_path', 'timezone', 'umask'])
+ at pytest.mark.parametrize('captures', list(reprotest.VARIATIONS.keys()))
def test_variations(virtual_server, captures):
expected = 1 if captures in TEST_VARIATIONS else 0
check_return_code('python3 mock_build.py ' + captures, virtual_server, expected)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git
More information about the Reproducible-commits
mailing list