QA: use relative path to script location for burnin
authorHelga Velroyen <helgav@google.com>
Wed, 29 Apr 2015 12:14:44 +0000 (14:14 +0200)
committerHelga Velroyen <helgav@google.com>
Thu, 30 Apr 2015 12:31:22 +0000 (14:31 +0200)
The QA had the annoying bug that if you run burnin, it
would try to upload the burnin file from the tools/
directory relative to the working directory and not
the location of the qa_cluster.py script. If you
accidentally start the QA from a differen directory
than qa/ it would run for a long while and only
crash when it comes to the burnin part. This patch
fixes the glitch by taking the location of the
QA scripts as a reference rather than the working
directory.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

qa/qa_cluster.py

index 166a5ee..c5d1f04 100644 (file)
@@ -1277,7 +1277,9 @@ def TestClusterBurnin():
     if len(instances) < 1:
       raise qa_error.Error("Burnin needs at least one instance")
 
-    script = qa_utils.UploadFile(master.primary, "../tools/burnin")
+    burnin_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                               "../tools/burnin")
+    script = qa_utils.UploadFile(master.primary, burnin_file)
     try:
       disks = qa_config.GetDiskOptions()
       # Run burnin