Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
fb095f94
Commit
fb095f94
authored
Dec 30, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bae69488
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
go/neo/neo_test.go
go/neo/neo_test.go
+11
-3
go/neo/t_cluster_test.go
go/neo/t_cluster_test.go
+24
-0
No files found.
go/neo/neo_test.go
View file @
fb095f94
...
@@ -39,12 +39,20 @@ import (
...
@@ -39,12 +39,20 @@ import (
"lab.nexedi.com/kirr/go123/xsync"
"lab.nexedi.com/kirr/go123/xsync"
)
)
// Verify basic M+S recovery.
func
TestClusterRecoveryBasic
(
t
*
testing
.
T
)
{
Verify
(
t
,
func
(
t0
*
tracetest
.
T
,
opt
tClusterOptions
)
{
zback
:=
xfs1back
(
"../zodb/storage/fs1/testdata/1.fs"
)
t
:=
tNewCluster_MS
(
t0
,
"abc1"
,
zback
,
opt
)
defer
t
.
Stop
()
})
}
// M drives cluster with 1 S & C through recovery -> verification -> service -> shutdown
// M drives cluster with 1 S & C through recovery -> verification -> service -> shutdown
func
TestMasterStorage
(
t
*
testing
.
T
)
{
func
TestMasterStorage
(
t
*
testing
.
T
)
{
tracetest
.
Verify
(
t
,
tracetestMasterStorage
)
Verify
(
t
,
tracetestMasterStorage
)
}
}
func
tracetestMasterStorage
(
t0
*
tracetest
.
T
)
{
func
tracetestMasterStorage
(
t0
*
tracetest
.
T
,
opt
tClusterOptions
)
{
X
:=
exc
.
Raiseif
X
:=
exc
.
Raiseif
zback
:=
xfs1back
(
"../zodb/storage/fs1/testdata/1.fs"
)
zback
:=
xfs1back
(
"../zodb/storage/fs1/testdata/1.fs"
)
...
@@ -52,7 +60,7 @@ func tracetestMasterStorage(t0 *tracetest.T) {
...
@@ -52,7 +60,7 @@ func tracetestMasterStorage(t0 *tracetest.T) {
lastTid
,
err
:=
zstor
.
Sync
(
bg
);
X
(
err
)
lastTid
,
err
:=
zstor
.
Sync
(
bg
);
X
(
err
)
// create the cluster
// create the cluster
t
:=
tNewCluster_MS
(
t0
,
"abc1"
,
zback
,
tClusterOptions
{}
)
t
:=
tNewCluster_MS
(
t0
,
"abc1"
,
zback
,
opt
)
defer
t
.
Stop
()
defer
t
.
Stop
()
M
:=
t
.
Master
(
"m"
)
M
:=
t
.
Master
(
"m"
)
C
:=
t
.
NewClient
(
"c"
,
"m:1"
)
C
:=
t
.
NewClient
(
"c"
,
"m:1"
)
...
...
go/neo/t_cluster_test.go
View file @
fb095f94
...
@@ -24,6 +24,7 @@ import (
...
@@ -24,6 +24,7 @@ import (
"context"
"context"
"fmt"
"fmt"
"sync"
"sync"
"testing"
"lab.nexedi.com/kirr/go123/xnet"
"lab.nexedi.com/kirr/go123/xnet"
"lab.nexedi.com/kirr/go123/xnet/lonet"
"lab.nexedi.com/kirr/go123/xnet/lonet"
...
@@ -385,6 +386,29 @@ func (m *tMaster) Run(ctx context.Context) error {
...
@@ -385,6 +386,29 @@ func (m *tMaster) Run(ctx context.Context) error {
return
m
.
Master
.
Run
(
ctx
,
l
)
return
m
.
Master
.
Run
(
ctx
,
l
)
}
}
// -------
// Verify verifies f for all combinations of node kinds.
// XXX place
func
Verify
(
t
*
testing
.
T
,
f
func
(
*
tracetest
.
T
,
tClusterOptions
))
{
// TODO verify M=(go|py) x S=(go|py) x ...
// for now we only verify for all combinations of network
// for all networks
for
_
,
network
:=
range
[]
string
{
"pipenet"
,
"lonet"
}
{
opt
:=
tClusterOptions
{
Network
:
network
,
}
// TODO don't pass in opt -> instead pass in T which will have .NewCluster() and use T.opt for it.
t
.
Run
(
"net="
+
network
,
func
(
t
*
testing
.
T
)
{
tracetest
.
Verify
(
t
,
func
(
t
*
tracetest
.
T
)
{
f
(
t
,
opt
)
})
})
}
}
// --------
// --------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment