1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559
|
// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2017 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package errtracker_test
import (
"crypto/sha512"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"sort"
"strings"
"testing"
"time"
"gopkg.in/mgo.v2/bson"
. "gopkg.in/check.v1"
"github.com/snapcore/snapd/arch"
"github.com/snapcore/snapd/dirs"
"github.com/snapcore/snapd/errtracker"
"github.com/snapcore/snapd/osutil"
"github.com/snapcore/snapd/release"
"github.com/snapcore/snapd/snapdenv"
"github.com/snapcore/snapd/testutil"
)
// Hook up check.v1 into the "go test" runner
func Test(t *testing.T) { TestingT(t) }
type ErrtrackerTestSuite struct {
testutil.BaseTest
tmpdir string
hostBuildID string
coreBuildID string
distroRelease string
}
var _ = Suite(&ErrtrackerTestSuite{})
var truePath = osutil.LookPathDefault("true", "/bin/true")
var falsePath = osutil.LookPathDefault("false", "/bin/false")
const someJournalEntry = "Mar 29 22:08:00 localhost kernel: [81B blob data]"
func (s *ErrtrackerTestSuite) SetUpTest(c *C) {
s.BaseTest.SetUpTest(c)
s.tmpdir = c.MkDir()
dirs.SetRootDir(s.tmpdir)
p := filepath.Join(s.tmpdir, "machine-id")
err := ioutil.WriteFile(p, []byte("bbb1a6a5bcdb418380056a2d759c3f7c"), 0644)
c.Assert(err, IsNil)
s.AddCleanup(errtracker.MockMachineIDPaths([]string{p}))
s.AddCleanup(errtracker.MockHostSnapd(truePath))
s.AddCleanup(errtracker.MockCoreSnapd(falsePath))
s.AddCleanup(errtracker.MockReExec(func() string {
return "yes"
}))
mockDetectVirt := testutil.MockCommand(c, "systemd-detect-virt", "echo none")
s.AddCleanup(mockDetectVirt.Restore)
s.hostBuildID, err = osutil.ReadBuildID(truePath)
c.Assert(err, IsNil)
s.coreBuildID, err = osutil.ReadBuildID(falsePath)
c.Assert(err, IsNil)
if release.ReleaseInfo.ID == "ubuntu" {
s.distroRelease = fmt.Sprintf("%s %s", strings.Title(release.ReleaseInfo.ID), release.ReleaseInfo.VersionID)
} else {
s.distroRelease = fmt.Sprintf("%s %s", release.ReleaseInfo.ID, release.ReleaseInfo.VersionID)
}
mockCpuinfo := filepath.Join(s.tmpdir, "cpuinfo")
mockSelfCmdline := filepath.Join(s.tmpdir, "self.cmdline")
mockSelfExe := filepath.Join(s.tmpdir, "self.exe")
mockSelfCwd := filepath.Join(s.tmpdir, "self.cwd")
c.Assert(ioutil.WriteFile(mockCpuinfo, []byte(`
processor : 0
bugs : very yes
etc : ...
processor : 42
bugs : very yes
`[1:]), 0644), IsNil)
c.Assert(ioutil.WriteFile(mockSelfCmdline, []byte("foo\x00bar\x00baz"), 0644), IsNil)
c.Assert(os.Symlink("target of /proc/self/exe", mockSelfExe), IsNil)
c.Assert(os.Symlink("target of /proc/self/cwd", mockSelfCwd), IsNil)
s.AddCleanup(errtracker.MockOsGetenv(func(s string) string {
switch s {
case "SHELL":
return "/bin/sh"
case "XDG_CURRENT_DESKTOP":
return "Unity"
}
return ""
}))
s.AddCleanup(errtracker.MockProcCpuinfo(mockCpuinfo))
s.AddCleanup(errtracker.MockProcSelfCmdline(mockSelfCmdline))
s.AddCleanup(errtracker.MockProcSelfExe(mockSelfExe))
s.AddCleanup(errtracker.MockProcSelfCwd(mockSelfCwd))
s.AddCleanup(testutil.MockCommand(c, "journalctl", "echo "+someJournalEntry).Restore)
mockCmd := testutil.MockCommand(c, "systemctl", "echo enabled; exit 0")
s.AddCleanup(mockCmd.Restore)
}
func (s *ErrtrackerTestSuite) TestReport(c *C) {
n := 0
identifier := ""
snapConfineProfile := filepath.Join(s.tmpdir, "/etc/apparmor.d/usr.lib.snapd.snap-confine")
err := os.MkdirAll(filepath.Dir(snapConfineProfile), 0755)
c.Assert(err, IsNil)
err = ioutil.WriteFile(snapConfineProfile, []byte("# fake profile of snap-confine"), 0644)
c.Assert(err, IsNil)
err = ioutil.WriteFile(snapConfineProfile+".dpkg-new", []byte{0}, 0644)
c.Assert(err, IsNil)
err = ioutil.WriteFile(snapConfineProfile+".real", []byte{0}, 0644)
c.Assert(err, IsNil)
err = ioutil.WriteFile(snapConfineProfile+".real.dpkg-new", []byte{0}, 0644)
c.Assert(err, IsNil)
prev := errtracker.SnapdVersion
defer func() { errtracker.SnapdVersion = prev }()
errtracker.SnapdVersion = "some-snapd-version"
handler := func(w http.ResponseWriter, r *http.Request) {
switch n {
case 0:
c.Check(r.Method, Equals, "POST")
c.Check(r.URL.Path, Matches, "/[a-z0-9]+")
identifier = r.URL.Path
b, err := ioutil.ReadAll(r.Body)
c.Assert(err, IsNil)
var data map[string]string
err = bson.Unmarshal(b, &data)
c.Assert(err, IsNil)
c.Check(data, DeepEquals, map[string]string{
"DistroRelease": s.distroRelease,
"HostSnapdBuildID": s.hostBuildID,
"CoreSnapdBuildID": s.coreBuildID,
"SnapdVersion": "some-snapd-version",
"Date": "Fri Feb 17 09:51:00 2017",
"KernelVersion": osutil.KernelVersion(),
"ErrorMessage": "failed to do stuff",
"DuplicateSignature": "[failed to do stuff]",
"Architecture": arch.DpkgArchitecture(),
"DidSnapdReExec": "yes",
"ProblemType": "Snap",
"Snap": "some-snap",
"Channel": "beta",
"ProcCpuinfoMinimal": "processor\t: 42\nbugs\t\t: very yes\n",
"ExecutablePath": "target of /proc/self/exe",
"ProcCwd": "target of /proc/self/cwd",
"ProcCmdline": "foo\x00bar\x00baz",
"ProcEnviron": "SHELL=/bin/sh",
"JournalError": someJournalEntry + "\n",
"SourcePackage": "snapd",
"CurrentDesktop": "Unity",
"DetectedVirt": "none",
"MD5SumSnapConfineAppArmorProfile": "7a7aa5f21063170c1991b84eb8d86de1",
"MD5SumSnapConfineAppArmorProfileDpkgNew": "93b885adfe0da089cdf634904fd59f71",
"MD5SumSnapConfineAppArmorProfileReal": "93b885adfe0da089cdf634904fd59f71",
"MD5SumSnapConfineAppArmorProfileRealDpkgNew": "93b885adfe0da089cdf634904fd59f71",
})
fmt.Fprintf(w, "c14388aa-f78d-11e6-8df0-fa163eaf9b83 OOPSID")
case 1:
c.Check(r.Method, Equals, "POST")
c.Check(r.URL.Path, Matches, identifier)
fmt.Fprintf(w, "xxxxx-f78d-11e6-8df0-fa163eaf9b83 OOPSID")
default:
c.Fatalf("expected one request, got %d", n+1)
}
n++
}
server := httptest.NewServer(http.HandlerFunc(handler))
defer server.Close()
restorer := errtracker.MockCrashDbURL(server.URL)
defer restorer()
restorer = errtracker.MockTimeNow(func() time.Time { return time.Date(2017, 2, 17, 9, 51, 0, 0, time.UTC) })
defer restorer()
id, err := errtracker.Report("some-snap", "failed to do stuff", "[failed to do stuff]", map[string]string{
"Channel": "beta",
})
c.Check(err, IsNil)
c.Check(id, Equals, "c14388aa-f78d-11e6-8df0-fa163eaf9b83 OOPSID")
c.Check(n, Equals, 1)
// run again with the *same* dupSig and verify that it won't send
// that again
id, err = errtracker.Report("some-snap", "failed to do stuff", "[failed to do stuff]", map[string]string{
"Channel": "beta",
})
c.Check(err, IsNil)
c.Check(id, Equals, "already-reported")
c.Check(n, Equals, 1)
// run again with different data, verify identifier is unchanged
id, err = errtracker.Report("some-other-snap", "failed to do more stuff", "[failed to do more stuff]", nil)
c.Check(err, IsNil)
c.Check(id, Equals, "xxxxx-f78d-11e6-8df0-fa163eaf9b83 OOPSID")
c.Check(n, Equals, 2)
}
func (s *ErrtrackerTestSuite) TestReportUnderTesting(c *C) {
defer snapdenv.MockTesting(true)()
n := 0
prev := errtracker.SnapdVersion
defer func() { errtracker.SnapdVersion = prev }()
errtracker.SnapdVersion = "some-snapd-version"
handler := func(w http.ResponseWriter, r *http.Request) {
n++
}
server := httptest.NewServer(http.HandlerFunc(handler))
defer server.Close()
restorer := errtracker.MockCrashDbURL(server.URL)
defer restorer()
restorer = errtracker.MockTimeNow(func() time.Time { return time.Date(2017, 2, 17, 9, 51, 0, 0, time.UTC) })
defer restorer()
id, err := errtracker.Report("some-snap", "failed to do stuff", "[failed to do stuff]", map[string]string{
"Channel": "beta",
})
c.Check(err, IsNil)
c.Check(id, Equals, "oops-not-sent")
c.Check(n, Equals, 0)
}
func (s *ErrtrackerTestSuite) TestTriesAllKnownMachineIDs(c *C) {
p := filepath.Join(c.MkDir(), "machine-id")
machineID := []byte("bbb1a6a5bcdb418380056a2d759c3f7c")
err := ioutil.WriteFile(p, machineID, 0644)
c.Assert(err, IsNil)
s.AddCleanup(errtracker.MockMachineIDPaths([]string{"/does/not/exist", p}))
n := 0
var identifiers []string
handler := func(w http.ResponseWriter, r *http.Request) {
identifiers = append(identifiers, r.URL.Path)
n++
}
server := httptest.NewServer(http.HandlerFunc(handler))
defer server.Close()
restorer := errtracker.MockCrashDbURL(server.URL)
defer restorer()
restorer = errtracker.MockTimeNow(func() time.Time { return time.Date(2017, 2, 17, 9, 51, 0, 0, time.UTC) })
defer restorer()
_, err = errtracker.Report("some-snap", "failed to do stuff", "[failed to do stuff]", map[string]string{
"Channel": "beta",
})
c.Check(err, IsNil)
c.Check(n, Equals, 1)
c.Check(identifiers, DeepEquals, []string{fmt.Sprintf("/%x", sha512.Sum512(machineID))})
}
func (s *ErrtrackerTestSuite) TestReportRepair(c *C) {
n := 0
prev := errtracker.SnapdVersion
defer func() { errtracker.SnapdVersion = prev }()
errtracker.SnapdVersion = "some-snapd-version"
handler := func(w http.ResponseWriter, r *http.Request) {
switch n {
case 0:
c.Check(r.Method, Equals, "POST")
c.Check(r.URL.Path, Matches, "/[a-z0-9]+")
b, err := ioutil.ReadAll(r.Body)
c.Assert(err, IsNil)
var data map[string]string
err = bson.Unmarshal(b, &data)
c.Assert(err, IsNil)
c.Check(data, DeepEquals, map[string]string{
"DistroRelease": s.distroRelease,
"HostSnapdBuildID": s.hostBuildID,
"CoreSnapdBuildID": s.coreBuildID,
"SnapdVersion": "some-snapd-version",
"Date": "Fri Feb 17 09:51:00 2017",
"KernelVersion": osutil.KernelVersion(),
"Architecture": arch.DpkgArchitecture(),
"DidSnapdReExec": "yes",
"ProblemType": "Repair",
"Repair": `"repair (1; brand-id:canonical)"`,
"ErrorMessage": "failure in script",
"DuplicateSignature": "[dupSig]",
"BrandID": "canonical",
"ProcCpuinfoMinimal": "processor\t: 42\nbugs\t\t: very yes\n",
"ExecutablePath": "target of /proc/self/exe",
"ProcCwd": "target of /proc/self/cwd",
"ProcCmdline": "foo\x00bar\x00baz",
"ProcEnviron": "SHELL=/bin/sh",
"JournalError": someJournalEntry + "\n",
"SourcePackage": "snapd",
"CurrentDesktop": "Unity",
"DetectedVirt": "none",
})
fmt.Fprintf(w, "c14388aa-f78d-11e6-8df0-fa163eaf9b83 OOPSID")
default:
c.Fatalf("expected one request, got %d", n+1)
}
n++
}
server := httptest.NewServer(http.HandlerFunc(handler))
defer server.Close()
restorer := errtracker.MockCrashDbURL(server.URL)
defer restorer()
restorer = errtracker.MockTimeNow(func() time.Time { return time.Date(2017, 2, 17, 9, 51, 0, 0, time.UTC) })
defer restorer()
id, err := errtracker.ReportRepair(`"repair (1; brand-id:canonical)"`, "failure in script", "[dupSig]", map[string]string{
"BrandID": "canonical",
})
c.Check(err, IsNil)
c.Check(id, Equals, "c14388aa-f78d-11e6-8df0-fa163eaf9b83 OOPSID")
c.Check(n, Equals, 1)
}
func (s *ErrtrackerTestSuite) TestReportWithWhoopsieDisabled(c *C) {
mockCmd := testutil.MockCommand(c, "systemctl", "echo disabled; exit 1")
defer mockCmd.Restore()
handler := func(w http.ResponseWriter, r *http.Request) {
c.Fatalf("The server should not be hit from here")
}
server := httptest.NewServer(http.HandlerFunc(handler))
defer server.Close()
restorer := errtracker.MockCrashDbURL(server.URL)
defer restorer()
id, err := errtracker.Report("some-snap", "failed to do stuff", "[failed to do stuff]", nil)
c.Check(err, IsNil)
c.Check(id, Equals, "")
}
func (s *ErrtrackerTestSuite) TestReportWithNoWhoopsieInstalled(c *C) {
mockCmd := testutil.MockCommand(c, "systemctl", "echo Failed to get unit file state for whoopsie.service; exit 1")
defer mockCmd.Restore()
n := 0
handler := func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "1234-oopsid")
n++
}
server := httptest.NewServer(http.HandlerFunc(handler))
defer server.Close()
restorer := errtracker.MockCrashDbURL(server.URL)
defer restorer()
id, err := errtracker.Report("some-snap", "failed to do stuff", "[failed to do stuff]", nil)
c.Check(err, IsNil)
c.Check(id, Equals, "1234-oopsid")
c.Check(n, Equals, 1)
}
func (s *ErrtrackerTestSuite) TestProcCpuinfo(c *C) {
fn := filepath.Join(s.tmpdir, "cpuinfo")
// sanity check
buf, err := ioutil.ReadFile(fn)
c.Assert(err, IsNil)
c.Check(string(buf), Equals, `
processor : 0
bugs : very yes
etc : ...
processor : 42
bugs : very yes
`[1:])
// just the last processor entry
c.Check(errtracker.ProcCpuinfoMinimal(), Equals, `
processor : 42
bugs : very yes
`[1:])
// if no processor line, just return the whole thing
c.Assert(ioutil.WriteFile(fn, []byte("yadda yadda\n"), 0644), IsNil)
c.Check(errtracker.ProcCpuinfoMinimal(), Equals, "yadda yadda\n")
c.Assert(os.Remove(fn), IsNil)
c.Check(errtracker.ProcCpuinfoMinimal(), Matches, "error: .* no such file or directory")
}
func (s *ErrtrackerTestSuite) TestProcExe(c *C) {
c.Check(errtracker.ProcExe(), Equals, "target of /proc/self/exe")
c.Assert(os.Remove(filepath.Join(s.tmpdir, "self.exe")), IsNil)
c.Check(errtracker.ProcExe(), Matches, "error: .* no such file or directory")
}
func (s *ErrtrackerTestSuite) TestProcCwd(c *C) {
c.Check(errtracker.ProcCwd(), Equals, "target of /proc/self/cwd")
c.Assert(os.Remove(filepath.Join(s.tmpdir, "self.cwd")), IsNil)
c.Check(errtracker.ProcCwd(), Matches, "error: .* no such file or directory")
}
func (s *ErrtrackerTestSuite) TestProcCmdline(c *C) {
c.Check(errtracker.ProcCmdline(), Equals, "foo\x00bar\x00baz")
c.Assert(os.Remove(filepath.Join(s.tmpdir, "self.cmdline")), IsNil)
c.Check(errtracker.ProcCmdline(), Matches, "error: .* no such file or directory")
}
func (s *ErrtrackerTestSuite) TestJournalError(c *C) {
jctl := testutil.MockCommand(c, "journalctl", "echo "+someJournalEntry)
defer jctl.Restore()
c.Check(errtracker.JournalError(), Equals, someJournalEntry+"\n")
c.Check(jctl.Calls(), DeepEquals, [][]string{
{"journalctl", "-b", "--priority=warning..err", "--lines=1000"},
})
}
func (s *ErrtrackerTestSuite) TestJournalErrorSilentError(c *C) {
jctl := testutil.MockCommand(c, "journalctl", "kill $$")
defer jctl.Restore()
c.Check(errtracker.JournalError(), Matches, "error: signal: [Tt]erminated")
c.Check(jctl.Calls(), DeepEquals, [][]string{
{"journalctl", "-b", "--priority=warning..err", "--lines=1000"},
})
}
func (s *ErrtrackerTestSuite) TestJournalErrorError(c *C) {
jctl := testutil.MockCommand(c, "journalctl", "echo OOPS; exit 1")
defer jctl.Restore()
c.Check(errtracker.JournalError(), Equals, "OOPS\n\nerror: exit status 1")
c.Check(jctl.Calls(), DeepEquals, [][]string{
{"journalctl", "-b", "--priority=warning..err", "--lines=1000"},
})
}
func (s *ErrtrackerTestSuite) TestEnviron(c *C) {
defer errtracker.MockOsGetenv(func(s string) string {
switch s {
case "SHELL":
// marked as safe
return "/bin/sh"
case "GPG_AGENT_INFO":
// not marked as safe
return ".gpg-agent:0:1"
case "TERM":
// not really set
return ""
case "PATH":
// special handling from here down
return "/something/random:/sbin/:/home/ubuntu/bin:/bin:/snap/bin"
case "XDG_RUNTIME_DIR":
return "/some/thing"
case "LD_PRELOAD":
return "foo"
case "LD_LIBRARY_PATH":
return "bar"
}
return ""
})()
env := strings.Split(errtracker.Environ(), "\n")
sort.Strings(env)
c.Check(env, DeepEquals, []string{
"LD_LIBRARY_PATH=<set>",
"LD_PRELOAD=<set>",
// note also /sbin/ -> /sbin
"PATH=(custom):/sbin:(user):/bin:/snap/bin",
"SHELL=/bin/sh",
"XDG_RUNTIME_DIR=<set>",
})
}
func (s *ErrtrackerTestSuite) TestReportsDB(c *C) {
db, err := errtracker.NewReportsDB(filepath.Join(s.tmpdir, "foo.db"))
c.Assert(err, IsNil)
c.Check(db.AlreadyReported("some-dup-sig"), Equals, false)
err = db.MarkReported("some-dup-sig")
c.Check(err, IsNil)
c.Check(db.AlreadyReported("some-dup-sig"), Equals, true)
c.Check(db.AlreadyReported("other-dup-sig"), Equals, false)
}
func (s *ErrtrackerTestSuite) TestReportsDBCleanup(c *C) {
db, err := errtracker.NewReportsDB(filepath.Join(s.tmpdir, "foo.db"))
c.Assert(err, IsNil)
errtracker.SetReportDBCleanupTime(db, 1*time.Millisecond)
err = db.MarkReported("some-dup-sig")
c.Check(err, IsNil)
time.Sleep(10 * time.Millisecond)
err = db.MarkReported("other-dup-sig")
c.Check(err, IsNil)
// this one got cleaned out
c.Check(db.AlreadyReported("some-dup-sig"), Equals, false)
// this one is still fresh
c.Check(db.AlreadyReported("other-dup-sig"), Equals, true)
}
func (s *ErrtrackerTestSuite) TestReportsDBnilDoesNotCrash(c *C) {
db, err := errtracker.NewReportsDB("/proc/1/environ")
c.Assert(err, NotNil)
c.Check(db, IsNil)
c.Check(db.AlreadyReported("dupSig"), Equals, false)
c.Check(db.MarkReported("dupSig"), ErrorMatches, "cannot mark error report as reported with an uninitialized reports database")
}
func (s *ErrtrackerTestSuite) TestReportsDBnilDoesNotCrashOnReport(c *C) {
oldDbDir := dirs.ErrtrackerDbDir
dirs.ErrtrackerDbDir = "/proc/1/environ"
defer func() {
dirs.ErrtrackerDbDir = oldDbDir
}()
id, err := errtracker.Report("some-snap", "failed to do stuff", "[failed to do stuff]", nil)
c.Assert(err, ErrorMatches, "cannot open error reports database: open /proc/1/environ:.*")
c.Assert(id, Equals, "")
}
|