(m *testing.M)
| 51 | func (*discardRW) WriteHeader(int) {} |
| 52 | |
| 53 | func TestMain(m *testing.M) { |
| 54 | flag.Parse() |
| 55 | |
| 56 | // file system |
| 57 | cos.CreateDir(testMountpath) |
| 58 | defer os.RemoveAll(testMountpath) |
| 59 | fs.TestNew(nil) |
| 60 | fs.TestDisableValidation() |
| 61 | _ = fs.CSM.Reg(fs.ObjectType, &fs.ObjectContentResolver{}) |
| 62 | _ = fs.CSM.Reg(fs.WorkfileType, &fs.WorkfileContentResolver{}) |
| 63 | |
| 64 | // target |
| 65 | config := cmn.GCO.Get() |
| 66 | co := newConfigOwner(config) |
| 67 | t = newTarget(co) |
| 68 | t.name = apc.Target |
| 69 | t.initNetworks() |
| 70 | tid, _ := initTID(config) |
| 71 | t.si.Init(tid, apc.Target) |
| 72 | |
| 73 | fs.Add(testMountpath, t.si.ID()) |
| 74 | |
| 75 | t.htrun.init(config) |
| 76 | |
| 77 | t.statsT = mock.NewStatsTracker() |
| 78 | cluster.Init(t) |
| 79 | |
| 80 | bck := cluster.NewBck(testBucket, apc.ProviderAIS, cmn.NsGlobal) |
| 81 | bmd := newBucketMD() |
| 82 | bmd.add(bck, &cmn.BucketProps{ |
| 83 | Cksum: cmn.CksumConf{ |
| 84 | Type: cos.ChecksumNone, |
| 85 | }, |
| 86 | }) |
| 87 | t.owner.bmd.putPersist(bmd, nil) |
| 88 | fs.CreateBucket("test", bck.Bucket(), false /*nilbmd*/) |
| 89 | |
| 90 | m.Run() |
| 91 | } |
| 92 | |
| 93 | func BenchmarkObjPut(b *testing.B) { |
| 94 | benches := []struct { |
nothing calls this directly
no test coverage detected