Permalink
Browse files

CBQE-1090: implement measure-sched-delay script with testrunner

required parameter in testrunner to use script: get-delays=True ( False by default)

features:
copies measure-sched-delay archive on remote vms if it doesn't exist there
decompresses it, configures and makes a tool
launches script and record logs in sched-delay-{IP}.cpu{NUM} format on all servers
at the end of testrunner execution copies all logs delays on local host(can be attached as artifacts from jenkins jobs)

Change-Id: I059a3307a9f7fbe486f7ffa1079e566bfbe6ec66
Reviewed-on: http://review.couchbase.org/25110
Reviewed-by: Deepkaran Salooja <deepkaran.salooja@globallogic.com>
Tested-by: Andrei Baranouski <andrei.baranouski@gmail.com>
  • Loading branch information...
1 parent b6c2db6 commit 7df5457405a5e035f11d3c6472c7ee477e4ba4bb @andreibaranouski andreibaranouski committed with andreibaranouski Mar 12, 2013
Showing with 22 additions and 1 deletion.
  1. +11 −0 lib/remote/remote_util.py
  2. +11 −1 testrunner
@@ -433,6 +433,16 @@ def copy_file_local_to_remote(self, src_path, des_path):
finally:
sftp.close()
+ def copy_file_remote_to_local(self, rem_path, des_path):
+ sftp = self._ssh_client.open_sftp()
+ try:
+ sftp.get(rem_path, des_path)
+ except IOError:
+ log.error('Can not copy file')
+ finally:
+ sftp.close()
+
+
# copy multi files from local to remote server
def copy_files_local_to_remote(self, src_path, des_path):
files = os.listdir(src_path)
@@ -445,6 +455,7 @@ def copy_files_local_to_remote(self, src_path, des_path):
full_des_path = os.path.join(des_path, file)
self.copy_file_local_to_remote(full_src_path, full_des_path)
+
# create a remote file from input string
def create_file(self, remote_path, file_data):
output, error = self.execute_command("echo '{0}' > {1}".format(file_data, remote_path))
View
@@ -18,12 +18,12 @@ if sys.hexversion < 0x02060000:
import re
import time
import unittest
-import logger
import logging.config
from xunit import XUnitTestResult
from TestInput import TestInputParser, TestInputSingleton
from optparse import OptionParser, OptionGroup
from scripts.collect_server_info import cbcollectRunner
+from scripts.measure_sched_delays import SchedDelays
import signal
@@ -276,6 +276,12 @@ if __name__ == "__main__":
if "EXCLUDE_GROUP" in test_params:
print "Cases from GROUPs '{0}' will be excluded".format(test_params["EXCLUDE_GROUP"])
+
+ if TestInputSingleton.input.param("get-delays", False):
+ #start measure_sched_delays on all servers
+ sd = SchedDelays(TestInputSingleton.input.servers)
+ sd.start_measure_sched_delays()
+
for name in names:
start_time = time.time()
argument_split = [a.strip() for a in re.split("[,]?([^,=]+)=", name)[1:]]
@@ -379,3 +385,7 @@ if __name__ == "__main__":
print result["name"], " pass"
if fail_count > 0:
sys.exit(1)
+
+ if TestInputSingleton.input.param("get-delays", False):
+ sd.stop_measure_sched_delay()
+ sd.fetch_logs()

0 comments on commit 7df5457

Please sign in to comment.