MCPcopy
hub / github.com/NVIDIA/aistore / createTestFile

Function createTestFile

cluster/lom_test.go:1059–1072  ·  view source on GitHub ↗
(fqn string, size int)

Source from the content-addressed store, hash-verified

1057}
1058
1059func createTestFile(fqn string, size int) {
1060 _ = os.Remove(fqn)
1061 testFile, err := cos.CreateFile(fqn)
1062 Expect(err).ShouldNot(HaveOccurred())
1063
1064 if size > 0 {
1065 buff := make([]byte, size)
1066 _, _ = rand.Read(buff)
1067 _, err := testFile.Write(buff)
1068 _ = testFile.Close()
1069
1070 Expect(err).ShouldNot(HaveOccurred())
1071 }
1072}
1073
1074func getTestFileHash(fqn string) (hash string) {
1075 reader, _ := os.Open(fqn)

Callers 3

lom_xattr_test.goFile · 0.70
lom_test.goFile · 0.70
filePutFunction · 0.70

Calls 5

CreateFileFunction · 0.92
CloseMethod · 0.65
RemoveMethod · 0.45
ReadMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected