[dconf: 2/3] tests: Sanitize additional environment variables used by dconf



commit 6ef3d0209dd6e78c1247c1dded0948e0cadf2ffb
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date:   Mon Dec 10 00:00:00 2018 +0000

    tests: Sanitize additional environment variables used by dconf

 tests/test-dconf.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/tests/test-dconf.py b/tests/test-dconf.py
index b5b511d..88f6769 100755
--- a/tests/test-dconf.py
+++ b/tests/test-dconf.py
@@ -749,8 +749,12 @@ if __name__ == '__main__':
     mandatory_profile = '/run/dconf/user/{}'.format(os.getuid())
     assert not os.path.isfile(mandatory_profile)
 
-    # Avoid profile sourced from environment
+    # Avoid profile sourced from environment or system data dirs.
     os.environ.pop('DCONF_PROFILE', None)
+    os.environ.pop('XDG_DATA_DIRS', None)
+    # Avoid interfering with external message buses.
+    os.environ.pop('DBUS_SYSTEM_BUS_ADDRESS', None)
+    os.environ.pop('DBUS_SESSION_BUS_ADDRESS', None)
 
     if len(sys.argv) < 3:
         message = 'Usage: {} path-to-dconf path-to-dconf-service'.format(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]