commit cbac10742cc44d66c82ee9776157273a5cce7a59
Author: Martin Pitt <email address hidden>
Date: Tue May 31 23:42:47 2016 +0200
Fix ChrootRunner.test_setup_commands_string when ran recursively
Commit a94e5ac42 exported $ADT_NORMAL_USER to tests. So remove it from the
environment for the this test as it otherwise breaks it when we run our own
tests through autopkgtest.
This fixes it, going to upload.
commit cbac10742cc44d6 6c82ee977615727 3a5cce7a59
Author: Martin Pitt <email address hidden>
Date: Tue May 31 23:42:47 2016 +0200
Fix ChrootRunner. test_setup_ commands_ string when ran recursively
Commit a94e5ac42 exported $ADT_NORMAL_USER to tests. So remove it from the
environment for the this test as it otherwise breaks it when we run our own
tests through autopkgtest.
diff --git a/tests/adt-run b/tests/adt-run src('Tests: pass\nDepends: \nRestrictions: needs-root\n',
{'pass' : '#!/bin/sh -e\n[ -x /bin/cp_cp ]; cat /setup.log\n'})
index fc7e7c0..1f870a0 100755
--- a/tests/adt-run
+++ b/tests/adt-run
@@ -1638,13 +1638,19 @@ Restrictions: needs-root
p = self.build_
- # not expecting a normal user for chroot NORMAL_ USER']
'--setup- commands' , '[ -z $ADT_NORMAL_USER ];'
'sleep 3; cp /bin/cp /bin/cp_cp; '
'echo setup_success > /setup.log',
'--setup- commands' , 'cp /bin/cp /bin/cp_cp', short=1' , '--timeout- copy=1' ]) short=1' , '--timeout- copy=1' ], env=env)
self. assertEqual( code, 0, err)
self. assertRegex( out, 'pass\s+PASS', out)
+ # not expecting a normal user for chroot; but filter out any
+ # $ADT_NORMAL_USER from *our* environment
+ env = os.environ.copy()
+ try:
+ del env['ADT_
+ except KeyError:
+ pass
(code, out, err) = self.runtest(['-B', '--unbuilt-tree=' + p,
- '--timeout-
+ '--timeout-
# test should succeed