From dd835aba2e122ce68f4827849bef8d4c47ca5e6d Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 5 Dec 2018 10:49:43 -0800 Subject: [PATCH] test-runner: fix removal of SIM/AKA/AKA' files If ofono/phonesim is not found on the system, any test requiring those will be skipped. In this case we would still try and remove symlinks that were never created. An error would be printed, but the actual source tree files were getting removed. This adds a new goto label where we can skip the tmpfs removal in this error case. --- tools/test-runner.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index e86513ab..cc7cc0c7 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -1782,14 +1782,14 @@ static void create_network_and_run_tests(const void *key, void *value, setenv("IWD_TEST_TIMEOUTS", "off", true); if (!create_tmpfs_extra_stuff(tmpfs_extra_stuff)) - goto exit_hwsim; + goto remove_abs_paths; if (!configure_hw_radios(hw_settings, wiphy_list)) - goto exit_hwsim; + goto remove_abs_paths; medium_pid = register_hwsim_as_trans_medium(); if (medium_pid < 0) - goto exit_hwsim; + goto remove_abs_paths; if (check_verbosity("hwsim")) { list_hwsim_radios(); @@ -1851,11 +1851,13 @@ exit_hostapd: terminate_medium(medium_pid); +remove_abs_paths: + remove_absolute_path_dirs(tmpfs_extra_stuff); + exit_hwsim: l_queue_destroy(wiphy_list, wiphy_free); l_settings_free(hw_settings); - remove_absolute_path_dirs(tmpfs_extra_stuff); l_strfreev(tmpfs_extra_stuff); }