X-Git-Url: http://git.efficios.com/?p=deliverable%2Flttng-ivc.git;a=blobdiff_plain;f=lttng_ivc%2Futils%2Fruntime.py;h=f272d6571481c90f9d7ced410420a84392fd6015;hp=0103dbf1b9e64848ab5dfbe2115d92a0eff6d320;hb=ab63b97eec802c720e70d7430dd892957e7f3f18;hpb=29cf55b3540b1c31f1718035f36cc7a5a3dc671a diff --git a/lttng_ivc/utils/runtime.py b/lttng_ivc/utils/runtime.py index 0103dbf..f272d65 100644 --- a/lttng_ivc/utils/runtime.py +++ b/lttng_ivc/utils/runtime.py @@ -232,6 +232,14 @@ class Runtime(object): env[var] = value return env + def load_test_module(self): + # Base directory is provided by env + self.run("modprobe lttng-test") + + def unload_test_module(self, check_return=True): + # Base directory is provided by env + self.run("modprobe -r lttng-test", check_return=check_return) + def close(self): for key, subp in self.__subprocess.items(): subp.terminate() @@ -242,6 +250,10 @@ class Runtime(object): stdout.close() stderr.close() + # 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)