Commit 63caf663 authored by Julien Muchembled's avatar Julien Muchembled

tests: always try to use relative symlinks in unit test instance folder

parent 589c7865
...@@ -175,8 +175,7 @@ def initializeInstanceHome(tests_framework_home, ...@@ -175,8 +175,7 @@ def initializeInstanceHome(tests_framework_home,
assert (os.path.isabs(tests_framework_home) assert (os.path.isabs(tests_framework_home)
and os.path.isabs(real_instance_home) and os.path.isabs(real_instance_home)
and os.path.isabs(instance_home)) and os.path.isabs(instance_home))
if not os.path.exists(instance_home): os.path.exists(instance_home) or os.mkdir(instance_home)
os.mkdir(instance_home)
if not WIN: if not WIN:
# Try to use relative symlinks # Try to use relative symlinks
if tests_framework_home.startswith(os.path.join(real_instance_home, if tests_framework_home.startswith(os.path.join(real_instance_home,
...@@ -184,7 +183,8 @@ def initializeInstanceHome(tests_framework_home, ...@@ -184,7 +183,8 @@ def initializeInstanceHome(tests_framework_home,
tests_framework_home = tests_framework_home[len(real_instance_home)+1:] tests_framework_home = tests_framework_home[len(real_instance_home)+1:]
if real_instance_home == os.path.dirname(instance_home): if real_instance_home == os.path.dirname(instance_home):
real_instance_home = 'real_instance' real_instance_home = 'real_instance'
os.symlink('..', os.path.join(instance_home, real_instance_home)) d = os.path.join(instance_home, real_instance_home)
os.path.exists(d) or os.symlink('..', d)
old_pwd = os.getcwd() old_pwd = os.getcwd()
try: try:
os.chdir(instance_home) os.chdir(instance_home)
......
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