From d53f90e066e8afbccaa5f1d5ae8b2fab2db01d66 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Sun, 23 May 2010 23:40:32 +0200 Subject: [PATCH] the way tests was pushing the build to the vplc box was wrong, we were getting build/build/ --- system/TestPlc.py | 5 +++-- system/TestSsh.py | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/system/TestPlc.py b/system/TestPlc.py index 1bcfc86..eb5c9e3 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -455,6 +455,7 @@ class TestPlc: # so that the tests do not have to worry about extracting the build (svn, git, or whatever) def create_vs (self): "vserver creation (no install done)" + # push the local build/ dir to the testplc box if self.is_local(): # a full path for the local calls build_dir=os.path.dirname(sys.argv[0]) @@ -464,8 +465,8 @@ class TestPlc: else: # use a standard name - will be relative to remote buildname build_dir="build" - # push the local build/ dir to the testplc box - self.test_ssh.mkdir(build_dir) + # remove for safety; do *not* mkdir first, otherwise we end up with build/build/ + self.test_ssh.rmdir(build_dir) self.test_ssh.copy(build_dir,recursive=True) # the repo url is taken from arch-rpms-url # with the last step (i386) removed diff --git a/system/TestSsh.py b/system/TestSsh.py index d881cf8..6d721fa 100644 --- a/system/TestSsh.py +++ b/system/TestSsh.py @@ -17,6 +17,7 @@ import os.path import utils +import shutil class TestSsh: @@ -100,6 +101,17 @@ class TestSsh: dirname=self.buildname return self.run("mkdir -p %s"%dirname) + def rmdir (self,dirname=None): + if self.is_local(): + if dirname: + return shutil.rmtree(dirname) + return 0 + if dirname: + dirname="%s/%s"%(self.buildname,dirname) + else: + dirname=self.buildname + return self.run("rm -rf %s"%dirname) + def create_buildname_once (self): if self.is_local(): return -- 2.47.0