mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-03 15:55:46 +00:00
utils: test: use sys.executable when launching aa-notify in tests
If the tests are running under a different Python, then the aa-notify bin should use the same Python Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import os
|
|||||||
import pwd
|
import pwd
|
||||||
import signal
|
import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
@@ -604,6 +605,9 @@ if __name__ == '__main__':
|
|||||||
if 'APPARMOR_NOTIFY' in os.environ:
|
if 'APPARMOR_NOTIFY' in os.environ:
|
||||||
aanotify_bin = [os.environ['APPARMOR_NOTIFY']]
|
aanotify_bin = [os.environ['APPARMOR_NOTIFY']]
|
||||||
|
|
||||||
|
if sys.executable:
|
||||||
|
aanotify_bin = [sys.executable] + aanotify_bin
|
||||||
|
|
||||||
if '__AA_CONFDIR' in os.environ:
|
if '__AA_CONFDIR' in os.environ:
|
||||||
aanotify_bin = aanotify_bin + ['--configdir', os.getenv('__AA_CONFDIR')]
|
aanotify_bin = aanotify_bin + ['--configdir', os.getenv('__AA_CONFDIR')]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user