We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c930116 commit 3641fd6Copy full SHA for 3641fd6
1 file changed
test/test_subsystem.py
@@ -0,0 +1,20 @@
1
+import os
2
+from scorep import subsystem
3
+
4
5
+def test_reset_preload(monkeypatch):
6
+ monkeypatch.setenv('LD_PRELOAD', '/some/value')
7
+ # Nothing changes if the var is not present
8
+ monkeypatch.delenv('SCOREP_LD_PRELOAD_BACKUP', raising=False)
9
+ subsystem.reset_preload()
10
+ assert os.environ['LD_PRELOAD'] == '/some/value'
11
12
+ # Variable set -> Update
13
+ monkeypatch.setenv('SCOREP_LD_PRELOAD_BACKUP', '/new/value')
14
15
+ assert os.environ['LD_PRELOAD'] == '/new/value'
16
17
+ # Variable empty -> remove
18
+ monkeypatch.setenv('SCOREP_LD_PRELOAD_BACKUP', '')
19
20
+ assert 'LD_PRELOAD' not in os.environ
0 commit comments