TestDebugMode exercises the if-debug log branches across the main verbs.
(c *C)
| 454 | |
| 455 | // TestDebugMode exercises the if-debug log branches across the main verbs. |
| 456 | func (s *PublishedStorageSuite) TestDebugMode(c *C) { |
| 457 | st, err := NewPublishedStorage("test", "", "", "", "", "", "", "", "", false, true) |
| 458 | c.Assert(err, IsNil) |
| 459 | |
| 460 | dir := c.MkDir() |
| 461 | src := filepath.Join(dir, "f") |
| 462 | c.Assert(os.WriteFile(src, []byte("dbg"), 0644), IsNil) |
| 463 | |
| 464 | c.Check(st.PutFile("d/a", src), IsNil) |
| 465 | c.Check(st.RenameFile("d/a", "d/b"), IsNil) |
| 466 | c.Check(st.SymLink("d/b", "d/b.link"), IsNil) |
| 467 | c.Check(st.HardLink("d/b", "d/b.hard"), IsNil) |
| 468 | c.Check(st.Remove("d/b"), IsNil) |
| 469 | c.Check(st.RemoveDirs("d", nil), IsNil) |
| 470 | |
| 471 | pool := files.NewPackagePool(c.MkDir(), false) |
| 472 | cs := files.NewMockChecksumStorage() |
| 473 | tmp := filepath.Join(c.MkDir(), "x.deb") |
| 474 | c.Assert(os.WriteFile(tmp, []byte("Contents"), 0644), IsNil) |
| 475 | cksum := utils.ChecksumInfo{MD5: "c1df1da7a1ce305a3b60af9d5733ac1d"} |
| 476 | srcKey, err := pool.Import(tmp, "x.deb", &cksum, true, cs) |
| 477 | c.Assert(err, IsNil) |
| 478 | c.Check(st.LinkFromPool("", "pool/x", "x.deb", pool, srcKey, cksum, false), IsNil) |
| 479 | } |
| 480 | |
| 481 | // TestObjectHandleWithEncryptionKey covers the encryptionKey branch in |
| 482 | // objectHandle. fsouza doesn't enforce CSEK headers but we just need to walk |
nothing calls this directly
no test coverage detected