From 800437c1b1dd036661b834abd764433ef1cffc06 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 1 Jul 2015 10:45:47 +1200 Subject: [PATCH] autobuild: add some system information to the autobuild tarball When running multiple autobuilds on VMs with various parameters, you can easily get confused about which was which, and the tarball doesn't help much. This adds an extra file with information about the system. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher --- script/autobuild.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/script/autobuild.py b/script/autobuild.py index c91ff2c8237..209ad1f27cc 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -362,6 +362,16 @@ class buildlist(object): self.kill_kids() return (0, None, None, None, "All OK") + def write_system_info(self): + filename = 'system-info.txt' + f = open(filename, 'w') + for cmd in ['uname -a', 'free', 'cat /proc/cpuinfo']: + print >>f, '### %s' % cmd + print >>f, run_cmd(cmd, output=True, checkfail=False) + print >>f + f.close() + return filename + def tarlogs(self, fname): tar = tarfile.open(fname, "w:gz") for b in self.tlist: @@ -369,6 +379,8 @@ class buildlist(object): tar.add(b.stderr_path, arcname="%s.stderr" % b.tag) if os.path.exists("autobuild.log"): tar.add("autobuild.log") + sys_info = self.write_system_info() + tar.add(sys_info) tar.close() def remove_logs(self): -- 2.11.4.GIT