X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fintegration-tests%2Ftest_integration_clique.py.in;h=33a6da69391d0b92eeb9c1eca0d0c95d157432ea;hb=f0a8d26b26cda04518e3555373172f6b4940e489;hp=85da2f80396d41bb64d6d923cc4b7ba482fc605d;hpb=45ea78958b11d15d3909371b40c9ec10e135dbc5;p=oweals%2Fgnunet.git diff --git a/src/integration-tests/test_integration_clique.py.in b/src/integration-tests/test_integration_clique.py.in index 85da2f803..33a6da693 100755 --- a/src/integration-tests/test_integration_clique.py.in +++ b/src/integration-tests/test_integration_clique.py.in @@ -14,8 +14,8 @@ # # You should have received a copy of the GNU General Public License # along with GNUnet; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # # # @@ -49,13 +49,23 @@ testname = "test_integration_clique" verbose = True check_timeout = 180 +def cleanup_onerror (function, path, excinfo): + import stat + if not os.path.exists (path): + pass + elif not os.access(path, os.W_OK): + # Is the error an access error ? + os.chmod (path, stat.S_IWUSR) + function (path) + else: + raise def cleanup (): retries = 10 path = os.path.join (tmp, "c_bootstrap_server") test.p ("Removing " + path) while ((os.path.exists(path)) and (retries > 0)): - shutil.rmtree ((path), False) + shutil.rmtree ((path), False, cleanup_onerror) time.sleep (1) retries -= 1 if (os.path.exists(path)): @@ -64,7 +74,7 @@ def cleanup (): path = os.path.join (tmp, "c_no_nat_client") test.p ("Removing " + path) while ((os.path.exists(path)) and (retries > 0)): - shutil.rmtree ((path), False) + shutil.rmtree ((path), False, cleanup_onerror) time.sleep (1) retries -= 1 if (os.path.exists(path)): @@ -73,7 +83,7 @@ def cleanup (): path = os.path.join (tmp, "c_nat_client") test.p ("Removing " + path) while ((os.path.exists(path)) and (retries > 0)): - shutil.rmtree ((path), False) + shutil.rmtree ((path), False, cleanup_onerror) time.sleep (1) retries -= 1 if (os.path.exists(path)):