From c35366fc3823e182ad0003a72607d909104cfc5b Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Tue, 11 Oct 2016 11:28:51 -0700 Subject: [PATCH] t-runner: Move chdir into the earlier stages --- tools/test-runner.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index 82822424..ebe3f4d2 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -1437,6 +1437,12 @@ static void create_network_and_run_tests(const void *key, void *value, l_info("Configuring network..."); + if (chdir(config_dir_path) < 0) { + l_error("Failed to change to test directory: %s", + strerror(errno)); + goto exit_hwsim; + } + abs_path_dirs = l_settings_get_string_list(hw_settings, HW_CONFIG_GROUP_SETUP, HW_CONFIG_SETUP_ABS_PATH_DIRS, @@ -1470,11 +1476,6 @@ static void create_network_and_run_tests(const void *key, void *value, goto exit_hostapd; } - if (chdir(config_dir_path) < 0) { - l_error("Failed to change directory"); - goto exit_hostapd; - } - run_py_tests(hw_settings, test_queue, test_stats_queue); l_info("Destructing network...");