2022-10-25 13:41:56 +02:00
|
|
|
package netstorage
|
|
|
|
|
|
|
|
import (
|
2022-12-04 08:53:14 +01:00
|
|
|
"flag"
|
2022-10-25 13:41:56 +02:00
|
|
|
"runtime"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInitStopNodes(t *testing.T) {
|
2022-12-04 08:53:14 +01:00
|
|
|
if err := flag.Set("vmstorageDialTimeout", "1ms"); err != nil {
|
|
|
|
t.Fatalf("cannot set vmstorageDialTimeout flag: %s", err)
|
|
|
|
}
|
2022-10-25 13:41:56 +02:00
|
|
|
for i := 0; i < 3; i++ {
|
|
|
|
Init([]string{"host1", "host2"}, 0)
|
|
|
|
runtime.Gosched()
|
|
|
|
MustStop()
|
|
|
|
}
|
2022-11-09 10:48:34 +01:00
|
|
|
|
|
|
|
// Try initializing the netstorage with bigger number of nodes
|
|
|
|
for i := 0; i < 3; i++ {
|
|
|
|
Init([]string{"host1", "host2", "host3"}, 0)
|
|
|
|
runtime.Gosched()
|
|
|
|
MustStop()
|
|
|
|
}
|
|
|
|
|
|
|
|
// Try initializing the netstorage with smaller number of nodes
|
|
|
|
for i := 0; i < 3; i++ {
|
|
|
|
Init([]string{"host1"}, 0)
|
|
|
|
runtime.Gosched()
|
|
|
|
MustStop()
|
|
|
|
}
|
2022-10-25 13:41:56 +02:00
|
|
|
}
|