Commit 9984d2b6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ef7168fc
...@@ -39,6 +39,8 @@ import ( ...@@ -39,6 +39,8 @@ import (
type NEOSrv interface { type NEOSrv interface {
ClusterName() string // name of the cluster ClusterName() string // name of the cluster
MasterAddr() string // address of the master MasterAddr() string // address of the master
Bugs() []string // list of known server bugs
} }
// NEOPySrv represents running NEO/py server. // NEOPySrv represents running NEO/py server.
...@@ -56,7 +58,11 @@ type NEOPySrv struct { ...@@ -56,7 +58,11 @@ type NEOPySrv struct {
masterAddr string // address of master in spawned cluster masterAddr string // address of master in spawned cluster
} }
// NEOPySrv.Bugs func (_ *NEOPySrv) Bugs() []string {
return []string{
// XXX
}
}
type NEOPyOptions struct { type NEOPyOptions struct {
// nmaster // nmaster
...@@ -228,6 +234,9 @@ func withNEO(t *testing.T, f func(t *testing.T, nsrv NEOSrv, ndrv *Client), optv ...@@ -228,6 +234,9 @@ func withNEO(t *testing.T, f func(t *testing.T, nsrv NEOSrv, ndrv *Client), optv
}, optv...) }, optv...)
} }
// XXX TestHandshake ?
// XXX connect with wrong clusterName -> rejected // XXX connect with wrong clusterName -> rejected
func TestEmptyDB(t *testing.T) { func TestEmptyDB(t *testing.T) {
...@@ -236,6 +245,25 @@ func TestEmptyDB(t *testing.T) { ...@@ -236,6 +245,25 @@ func TestEmptyDB(t *testing.T) {
}) })
} }
func TestLoad(t *testing.T) {
X := xtesting.FatalIf(t)
data := "../fs1/testdata/1.fs"
txnvOk, err := xtesting.LoadDBHistory(data); X(err)
withNEO(t, func(t *testing.T, nsrv NEOSrv, n *Client) {
xtesting.DrvTestLoad(t, n, txnvOk, nsrv.Bugs()...)
}, tOptions{
Preload: data,
})
}
func TestWatch(t *testing.T) {
withNEOSrv(t, func(t *testing.T, nsrv NEOSrv) {
xtesting.DrvTestWatch(t, fmt.Sprintf("neo://%s@%s", nsrv.ClusterName(), nsrv.MasterAddr()), openClientByURL)
})
}
func neoOpen(zurl string, opt *zodb.DriverOptions) (_ *Client, at0 zodb.Tid, err error) { func neoOpen(zurl string, opt *zodb.DriverOptions) (_ *Client, at0 zodb.Tid, err error) {
defer xerr.Contextf(&err, "openneo %s", zurl) defer xerr.Contextf(&err, "openneo %s", zurl)
......
...@@ -253,7 +253,7 @@ func TestEmptyDB(t *testing.T) { ...@@ -253,7 +253,7 @@ func TestEmptyDB(t *testing.T) {
} }
func TestLoad(t *testing.T) { func TestLoad(t *testing.T) {
X := exc.Raiseif X := xtesting.FatalIf(t)
data := "../fs1/testdata/1.fs" data := "../fs1/testdata/1.fs"
txnvOk, err := xtesting.LoadDBHistory(data); X(err) txnvOk, err := xtesting.LoadDBHistory(data); X(err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment