public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Document testcase, add empty stacktrace test Date: Mon, 19 Nov 2007 13:14:00 -0000 [thread overview] Message-ID: <20071119131436.19286.qmail@sourceware.org> (raw) The branch, master has been updated via e05a55a7ba2861173cb86e603b2e312f4c42b197 (commit) from bbf660ad5f803e000274503ad878040f4d604fef (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit e05a55a7ba2861173cb86e603b2e312f4c42b197 Author: Phil Muldoon <pmuldoon@redhat.com> Date: Mon Nov 19 13:14:25 2007 +0000 Document testcase, add empty stacktrace test 2007-11-19 Phil Muldoon <pmuldoon@redhat.com> * TestLinuxCore.java (testLinuxCoreFileStackTrace): Rename variables, document test case, check for empty stacktraces. frysk-core/frysk/proc/dead/.#TestLinuxCore.java ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/proc/dead/ChangeLog | 4 + frysk-core/frysk/proc/dead/TestLinuxCore.java | 89 +++++++++++++++++-------- 2 files changed, 65 insertions(+), 28 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog index 4d90ad6..191c1da 100644 --- a/frysk-core/frysk/proc/dead/ChangeLog +++ b/frysk-core/frysk/proc/dead/ChangeLog @@ -1,9 +1,13 @@ 2007-11-19 Phil Muldoon <pmuldoon@redhat.com> + * TestLinuxCore.java (testLinuxCoreFileStackTrace): Rename + variables, document test case, check for empty stacktraces. + * TestLinuxCore.java (testLinuxCoreFileStackTrace): Pass executable location to LinuxHost. Fix 5352. Remove unresolved. Fix 11-15 indention oops. + 2007-11-17 Andrew Cagney <cagney@redhat.com> * TestLinuxCore.java (testLinuxCoreFileStackTrace()): Mark as diff --git a/frysk-core/frysk/proc/dead/TestLinuxCore.java b/frysk-core/frysk/proc/dead/TestLinuxCore.java index 94f21ec..45eec06 100644 --- a/frysk-core/frysk/proc/dead/TestLinuxCore.java +++ b/frysk-core/frysk/proc/dead/TestLinuxCore.java @@ -134,19 +134,62 @@ public class TestLinuxCore return -1; } + /** + * Test that a corefile backtrace and a live process backtrace + * match on a blocked process + * + **/ public void testLinuxCoreFileStackTrace () { - final Proc ackProc; // = giveMeAProc(); + Proc testProc; + // Create a blocked process, blocked at a signal File exeFile = Config.getPkgLibFile("funit-stacks"); - ackProc = new DaemonBlockedAtSignal(exeFile).getMainTask().getProc(); + testProc = new DaemonBlockedAtSignal(exeFile).getMainTask().getProc(); + + StacktraceAction liveStacktrace; + StacktraceAction coreStacktrace; + StringWriter liveStackOutput = new StringWriter(); + StringWriter coreStackOutput = new StringWriter(); - StacktraceAction stacker; - StacktraceAction coreStack; + // Create a Stacktrace of the blocked live process + liveStacktrace = new StacktraceAction(new PrintWriter(liveStackOutput), + testProc, + new RequestStopEvent(Manager.eventLoop), + true, false, false, false, false, false) - StringWriter stringWriter1 = new StringWriter(); - stacker = new StacktraceAction(new PrintWriter(stringWriter1),ackProc, new RequestStopEvent(Manager.eventLoop), true, false,false, false, false, false) + { + + public void addFailed (Object observable, Throwable w) + { + fail("Proc add failed: " + w.getMessage()); + } + }; + + // And run .... + new ProcBlockAction (testProc, liveStacktrace); + assertRunUntilStop("Perform live process Backtrace"); + + // Check that the live process stacktrace acually produces + // something. If not there is a problem beyond this tests + // scope. + assertTrue("Live stack trace is not empty", + liveStackOutput.getBuffer().length() > 0); + + // Create a corefile from blocked process, and model. + String coreFileName = constructCore(testProc); + File testCore = new File(coreFileName); + Host coreHost = new LinuxHost(Manager.eventLoop, + testCore, exeFile); + Proc coreProc = coreHost.getProc(new ProcId(testProc.getPid())); + + // Create a stackktrace of a the corefile process + coreStacktrace = new StacktraceAction(new PrintWriter(coreStackOutput), + coreProc, + new PrintEvent(), + true, false, false, false , + false, false) { public void addFailed (Object observable, Throwable w) @@ -155,31 +198,21 @@ public class TestLinuxCore } }; - new ProcBlockAction (ackProc, stacker); - assertRunUntilStop("perform backtrace"); - - String coreFileName = constructCore(ackProc); - File xtestCore = new File(coreFileName); - - Host lcoreHost = new LinuxHost(Manager.eventLoop, - xtestCore, exeFile); - - Proc coreProc = lcoreHost.getProc(new ProcId(ackProc.getPid())); + // And run .... + new ProcCoreAction(coreProc, coreStacktrace); + assertRunUntilStop("Perform corefile Backtrace"); - StringWriter stringWriter2 = new StringWriter(); - coreStack = new StacktraceAction(new PrintWriter(stringWriter2),coreProc, new PrintEvent(),true,false,false,false,false, false) - { + // Check that the dead process stacktrace produces something. If + // not there isa problem beyond this tests scope. + assertTrue("Core stack trace is not empty", + coreStackOutput.getBuffer().length() > 0); - public void addFailed (Object observable, Throwable w) - { - fail("Proc add failed: " + w.getMessage()); - } - }; - new ProcCoreAction(coreProc, coreStack); - assertRunUntilStop("perform corebacktrace"); + // Finally, compare live and core stack traces. + assertEquals("Compare stack traces", + liveStackOutput.getBuffer().toString(), + coreStackOutput.getBuffer().toString()); - assertEquals("Compare stack traces",stringWriter1.getBuffer().toString(),stringWriter2.getBuffer().toString()); - xtestCore.delete(); + testCore.delete(); } private static class PrintEvent implements Event hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2007-11-19 13:14 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20071119131436.19286.qmail@sourceware.org \ --to=pmuldoon@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).