mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-12-20 22:47:51 +08:00
b9aee2defb
The volume TTL and file TTL are not necessarily the same. as long as file TTL is smaller than volume TTL, it'll be fine. volume TTL is used when assigning file id, e.g. http://.../dir/assign?ttl=3h file TTL is used when uploading
24 lines
403 B
Go
24 lines
403 B
Go
package storage
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestSuperBlockReadWrite(t *testing.T) {
|
|
rp, _ := NewReplicaPlacementFromByte(byte(001))
|
|
ttl, _ := ReadTTL("15d")
|
|
s := &SuperBlock{
|
|
version: CurrentVersion,
|
|
ReplicaPlacement: rp,
|
|
Ttl: ttl,
|
|
}
|
|
|
|
bytes := s.Bytes()
|
|
|
|
if !(bytes[2] == 15 && bytes[3] == Day) {
|
|
println("byte[2]:", bytes[2], "byte[3]:", bytes[3])
|
|
t.Fail()
|
|
}
|
|
|
|
}
|