tox: base test command and positional arguments
[deliverable/lttng-ivc.git] / lttng_ivc / utils / runtime.py
index d8a2de62018e52a8ccffba8b1a90358f392fc129..716617608c50879f98b6a9ea80146e7ed3a8f1e1 100644 (file)
@@ -1,3 +1,23 @@
+# Copyright (c) 2017 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
 import os
 import sys
 import shlex
@@ -7,6 +27,7 @@ import logging
 import shutil
 import contextlib
 import pprint
+import signal
 
 from tempfile import TemporaryDirectory
 
@@ -268,12 +289,13 @@ class Runtime(object):
 
     def close(self):
         for key, subp in self.__subprocess.items():
-            self.subprocess_terminate(key, check_return=False)
+            self.subprocess_kill(key)
 
         # Always try to remove test module but do not perform check on return
         # value.
         self.unload_test_module(False)
 
-        # Copy the lttng_home used at runtime using hardlink to prevent useless
-        # data duplication
-        shutil.copytree(self.lttng_home, self.__post_runtime_lttng_home_path, copy_function=os.link)
+        # Hard linking would be nice here but it could be a problem when we use
+        # a tmpdir on another device. Let's consider we have unlimited space.
+        shutil.copytree(self.lttng_home, self.__post_runtime_lttng_home_path,
+                ignore=shutil.ignore_patterns(".lttng"))
This page took 0.024081 seconds and 5 git commands to generate.