crash-reporter: Re-enable CollectBadDirectory unittest

The KernelCollectorTest.CollectBadDirectory unittest was first re-enabled by
sergiu@ in https://gerrit.chromium.org/gerrit/5433, but it broke the
buildbots and had to be re-disabled.  So I'm trying again, but this time I
have the power of trybots!  I also added code to output the log if it fails
again.

BUG=chromium-os:18622
TEST=Ran unittests.  Ran trybots on: alex-paladin, amd64-generic-paladin,
arm-tegra2-paladin, lumpy-paladin, stumpy-paladin.

Change-Id: Ib7fa1c1a32e9c198db9bdae8f933c9dd9fc3381a
Reviewed-on: https://gerrit.chromium.org/gerrit/20667
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
This commit is contained in:
Sergiu Iordache 2011-08-05 15:32:15 -07:00 committed by Gerrit
parent 1e09a84aaf
commit ee173fbe36

View file

@ -20,6 +20,7 @@ static const char kTestKCrash[] = "test/kcrash";
static const char kTestCrashDirectory[] = "test/crash_directory";
using chromeos::FindLog;
using chromeos::GetLog;
void CountCrash() {
++s_crashes;
@ -230,14 +231,14 @@ TEST_F(KernelCollectorTest, CollectNoCrash) {
ASSERT_EQ(0, s_crashes);
}
// Disabled for crosbug.com/18622
//TEST_F(KernelCollectorTest, CollectBadDirectory) {
// WriteStringToFile(test_kcrash_, "====1.1\nsomething");
// ASSERT_TRUE(collector_.Collect());
// ASSERT_TRUE(FindLog(
// "Unable to create appropriate crash directory"));
// ASSERT_EQ(1, s_crashes);
//}
TEST_F(KernelCollectorTest, CollectBadDirectory) {
WriteStringToFile(test_kcrash_, "====1.1\nsomething");
ASSERT_TRUE(collector_.Collect());
ASSERT_TRUE(FindLog("Unable to create appropriate crash directory"))
<< "Did not find expected error string in log: {\n"
<< GetLog() << "}";
ASSERT_EQ(1, s_crashes);
}
void KernelCollectorTest::SetUpSuccessfulCollect() {
collector_.ForceCrashDirectory(kTestCrashDirectory);