From e6b4cacd1f888316a0c360e86105d2ca855fdc24 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 19 Sep 2008 10:49:06 +0000 Subject: [PATCH] capture pgsql logs --- system/TestPlc.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/system/TestPlc.py b/system/TestPlc.py index ede174e..0e2dc28 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -749,13 +749,17 @@ class TestPlc: return ( self.run_in_guest(command) == 0) def gather_logs (self): - # (1) get the plc's /var/log and store it locally in logs/myplc.var-log./* + # (1.a) get the plc's /var/log/ and store it locally in logs/myplc.var-log./* + # (1.b) get the plc's /var/lib/pgsql/data/pg_log/ -> logs/myplc.pgsql-log./* # (2) get all the nodes qemu log and store it as logs/node.qemu..log # (3) get the nodes /var/log and store is as logs/node.var-log./* # (4) as far as possible get the slice's /var/log as logs/sliver.var-log./* - # (1) + # (1.a) print "-------------------- TestPlc.gather_logs : PLC's /var/log" self.gather_var_logs () + # (1.b) + print "-------------------- TestPlc.gather_logs : PLC's /var/lib/psql/data/pg_log/" + self.gather_pgsql_logs () # (2) print "-------------------- TestPlc.gather_logs : nodes's QEMU logs" for site_spec in self.plc_spec['sites']: @@ -787,6 +791,12 @@ class TestPlc: command = "chmod a+r,a+x logs/myplc.var-log.%s/httpd"%self.name() utils.system(command) + def gather_pgsql_logs (self): + utils.system("mkdir -p logs/myplc.pgsql-log.%s"%self.name()) + to_plc = self.actual_command_in_guest("tar -C /var/lib/pgsql/data/pg_log/ -cf - .") + command = to_plc + "| tar -C logs/myplc.pgsql-log.%s -xf -"%self.name() + utils.system(command) + def gather_nodes_var_logs (self): for site_spec in self.plc_spec['sites']: test_site = TestSite (self,site_spec) -- 2.47.0