Tests: fix: tmp dir can be a symlink
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 22 Oct 2019 16:05:28 +0000 (12:05 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 22 Oct 2019 19:01:29 +0000 (15:01 -0400)
Get the real path to perform valid comparison.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/working-directory/test_relayd_working_directory

index 8a261af213631662da28b1643e7c8b6eef305d77..956cb780a6e368c7239aa51cff73b03f757bce65 100755 (executable)
@@ -37,7 +37,7 @@ function test_relayd()
        local pid
        local cwd
 
        local pid
        local cwd
 
-       working_dir=$(mktemp -d)
+       working_dir=$(realpath "$(mktemp -d)")
 
        diag "Test lttng-relayd normal mode change working directory"
 
 
        diag "Test lttng-relayd normal mode change working directory"
 
@@ -72,7 +72,7 @@ function test_relayd_daemon()
        local cwd
        local pid
 
        local cwd
        local pid
 
-       working_dir=$(mktemp -d)
+       working_dir=$(realpath "$(mktemp -d)")
 
        diag "Test lttng-relayd daemon mode change working directory"
 
 
        diag "Test lttng-relayd daemon mode change working directory"
 
@@ -116,7 +116,7 @@ function test_relayd_background()
        local cwd
        local pid
 
        local cwd
        local pid
 
-       working_dir=$(mktemp -d)
+       working_dir=$(realpath "$(mktemp -d)")
 
        diag "Test lttng-relayd background mode change working directory"
 
 
        diag "Test lttng-relayd background mode change working directory"
 
@@ -161,7 +161,7 @@ function test_relayd_debug_permission()
        local cwd
        local pid
 
        local cwd
        local pid
 
-       working_dir=$(mktemp -d)
+       working_dir=$(realpath "$(mktemp -d)")
 
        diag "Test lttng-relayd change working directory on non writable directory"
 
 
        diag "Test lttng-relayd change working directory on non writable directory"
 
@@ -197,7 +197,7 @@ function test_relayd_failure()
        local output_dest
        local pid
 
        local output_dest
        local pid
 
-       working_dir="$(mktemp -d)"
+       working_dir=$(realpath "$(mktemp -d)")
        working_dir_imaginary="${working_dir}/imaginary_directory"
        output_dest=$(mktemp)
 
        working_dir_imaginary="${working_dir}/imaginary_directory"
        output_dest=$(mktemp)
 
@@ -229,6 +229,7 @@ function test_relayd_env()
        local pid
 
        working_dir=$(mktemp -d)
        local pid
 
        working_dir=$(mktemp -d)
+       working_dir=$(realpath "$(mktemp -d)")
 
        diag "Test lttng-relayd change working directory from env. variable"
 
 
        diag "Test lttng-relayd change working directory from env. variable"
 
@@ -254,8 +255,8 @@ function test_relayd_cmdline_overwrite_env()
        local cwd
        local pid
 
        local cwd
        local pid
 
-       working_dir_env=$(mktemp -d)
-       working_dir_cmdline=$(mktemp -d)
+       working_dir_env=$(realpath "$(mktemp -d)")
+       working_dir_cmdline=$(realpath "$(mktemp -d)")
 
        diag "Test lttng-relayd change working directory command line overwrite env variable"
 
 
        diag "Test lttng-relayd change working directory command line overwrite env variable"
 
This page took 0.02676 seconds and 4 git commands to generate.