Commit 4872cf67 authored by Jérome Perrin's avatar Jérome Perrin

fixup! runUnitTest: expand ~ in bt5_path and warn user about invalid bt5 path passed to test runner

Suppport ~ also in VCS tab. Not working in current slapos instance that set $HOME to something completely different
parent 634c7c22
...@@ -5410,6 +5410,7 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5410,6 +5410,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
from App.config import getConfiguration from App.config import getConfiguration
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
for path in (preferences.getPreferredWorkingCopyList() or ['bt5']): for path in (preferences.getPreferredWorkingCopyList() or ['bt5']):
path = os.path.expanduser(path)
if not os.path.isabs(path): if not os.path.isabs(path):
path = os.path.join(instance_home, path) path = os.path.join(instance_home, path)
bt_path = os.path.join(path, bt_name) bt_path = os.path.join(path, bt_name)
......
...@@ -469,7 +469,7 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase): ...@@ -469,7 +469,7 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
if errcode == 200: if errcode == 200:
return urltype + ':' + url return urltype + ':' + url
else: else:
path_list = glob(os.path.join(path, template)) path_list = glob(os.path.join(os.path.expanduser(path), template))
if path_list: if path_list:
return path_list[0] return path_list[0]
......
...@@ -123,7 +123,7 @@ class WorkingCopy(Implicit): ...@@ -123,7 +123,7 @@ class WorkingCopy(Implicit):
except ValueError: except ValueError:
pass pass
# Allow symlinks inside instance home. # Allow symlinks inside instance home.
path = os.path.normpath(path) path = os.path.normpath(os.path.expanduser(path))
real_path = os.path.realpath(path) real_path = os.path.realpath(path)
if restricted and not any( if restricted and not any(
issubdir(allowed, path) or issubdir(allowed, real_path) issubdir(allowed, path) or issubdir(allowed, real_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment