Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
f78f7339
Commit
f78f7339
authored
May 02, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all trailing whitespaces
git-svn-id:
https://svn.erp5.org/repos/neo/trunk@2749
71dcc9de-d417-0410-9af5-da40c76e7ee4
parent
df900556
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
145 additions
and
145 deletions
+145
-145
README
README
+1
-1
buildout/INSTALL.txt
buildout/INSTALL.txt
+14
-14
buildout/software-profiles/neo.cfg
buildout/software-profiles/neo.cfg
+1
-1
eggs/makeeggs
eggs/makeeggs
+2
-2
neo.conf
neo.conf
+1
-1
neo/lib/connector.py
neo/lib/connector.py
+10
-10
neo/lib/util.py
neo/lib/util.py
+11
-11
neo/master/app.py
neo/master/app.py
+1
-1
neo/master/transactions.py
neo/master/transactions.py
+1
-1
neo/neoctl/neoctl.py
neo/neoctl/neoctl.py
+2
-2
neo/scripts/neoadmin.py
neo/scripts/neoadmin.py
+5
-5
neo/scripts/neoctl.py
neo/scripts/neoctl.py
+5
-5
neo/scripts/neomaster.py
neo/scripts/neomaster.py
+5
-5
neo/scripts/neomigrate.py
neo/scripts/neomigrate.py
+3
-3
neo/scripts/neostorage.py
neo/scripts/neostorage.py
+8
-8
neo/scripts/runner.py
neo/scripts/runner.py
+5
-5
neo/storage/app.py
neo/storage/app.py
+1
-1
neo/storage/database/mysqldb.py
neo/storage/database/mysqldb.py
+1
-1
neo/storage/transactions.py
neo/storage/transactions.py
+2
-2
neo/tests/benchmark.py
neo/tests/benchmark.py
+1
-1
neo/tests/client/testClientApp.py
neo/tests/client/testClientApp.py
+3
-3
neo/tests/client/testMasterHandler.py
neo/tests/client/testMasterHandler.py
+5
-5
neo/tests/client/testStorageHandler.py
neo/tests/client/testStorageHandler.py
+1
-1
neo/tests/functional/testClient.py
neo/tests/functional/testClient.py
+4
-4
neo/tests/master/testElectionHandler.py
neo/tests/master/testElectionHandler.py
+6
-6
neo/tests/storage/testClientHandler.py
neo/tests/storage/testClientHandler.py
+4
-4
neo/tests/storage/testStorageDBTests.py
neo/tests/storage/testStorageDBTests.py
+2
-2
neo/tests/testProtocol.py
neo/tests/testProtocol.py
+4
-4
neo/tests/testUtil.py
neo/tests/testUtil.py
+3
-3
neo/tests/zodb/testUndo.py
neo/tests/zodb/testUndo.py
+1
-1
neoadmin
neoadmin
+2
-2
neoctl
neoctl
+2
-2
neomaster
neomaster
+2
-2
neomigrate
neomigrate
+2
-2
neostorage
neostorage
+2
-2
setup_admin.py
setup_admin.py
+4
-4
setup_client.py
setup_client.py
+4
-4
setup_ctl.py
setup_ctl.py
+3
-3
setup_master.py
setup_master.py
+3
-3
setup_storage.py
setup_storage.py
+4
-4
setup_tests.py
setup_tests.py
+4
-4
No files found.
README
View file @
f78f7339
...
...
@@ -32,7 +32,7 @@ Overview
primary master, and monitors cluster state.
- "client" nodes
Well... Something needing to store/load data in a NEO cluster.
Well... Something needing to store/load data in a NEO cluster.
Disclaimer
...
...
buildout/INSTALL.txt
View file @
f78f7339
...
...
@@ -35,19 +35,19 @@ requirements :
- python2.4 or higher
- ctypes (http://python.net/crew/theller/ctypes/) (If you're using python2.5 or
higher, ctypes is directly included with python)
- mock (http://python-mock.sourceforge.net/) (Only if you plan to make the
- mock (http://python-mock.sourceforge.net/) (Only if you plan to make the
neo tests)
############################
### 1.Quick installation ###
############################
You're a neo-newbie ? You don't need neo sources ? You want a full version and
not just one or two modules ? Or, more commonly, you're in a hurry ? So type
You're a neo-newbie ? You don't need neo sources ? You want a full version and
not just one or two modules ? Or, more commonly, you're in a hurry ? So type
the following commands :
$ svn checkout https//svn.erp5.org/repos/neo/trunk/buildout/software-profiles/neo.cfg
When your bootstrap's done, check that you've got bin/buildout script. Then
When your bootstrap's done, check that you've got bin/buildout script. Then
Edit your buildout.cfg file, and delete all the neo-eggs which corresponds
to the parts you don't need. Then run :
...
...
@@ -80,25 +80,25 @@ Run neo tests :
$ bin/neotestrunner -fzu (functional, unit tests and zodb tests)
If this returns no errors or fails, it means that it's over for you ! Neo's
If this returns no errors or fails, it means that it's over for you ! Neo's
correctly installed on your machine, congratulations !
#############################
### 3. Building neo eggs ###
#############################
This part is recommended for experienced users, who wants to make a neo
This part is recommended for experienced users, who wants to make a neo
installation from beginning. It explains how to make eggs from a
precise neo part, instead of eggifying the whole project.
Each part of neo (lib, admin, master, storage, neoctl, client) has its own
setup.py file, which is located on <download_neo>/trunk/setup_files, ans which
allows to build the linked egg. See VI. Setup files to check which setup.py
Each part of neo (lib, admin, master, storage, neoctl, client) has its own
setup.py file, which is located on <download_neo>/trunk/setup_files, ans which
allows to build the linked egg. See VI. Setup files to check which setup.py
file you need. Then execute the following commands :
$ svn checkout https://svn.erp5.org/repos/neo/trunk
$ svn checkout https://svn.erp5.org/repos/neo/trunk
$ cd <download_neo>/trunk/neo
(setup_cmn.py is the main part of neo, needed by all other processes)
(setup_cmn.py is the main part of neo, needed by all other processes)
$ python setup.*.py bdist_egg
Check in your trunk/bdist folder that you have an egg for each part of neo you
...
...
@@ -111,13 +111,13 @@ want to install. If it's ok, then go on to part II.
Problem : The egg I need is not present in my trunk/bdist folder.
Solution : Select the correct setup_<part>.py in trunk/setup_files
Problem: bin/buildout is not present
Problem: bin/buildout is not present
Solution: Launch the bootstrap command
Problem : bootstrap command is not working
Solution : Try to use another python version
Tests errors :
Tests errors :
'neoadmin' not found
'neomaster' not found
'neostorage' not found
...
...
buildout/software-profiles/neo.cfg
View file @
f78f7339
...
...
@@ -2,7 +2,7 @@
[buildout]
# extends-cache = extends-cache
parts =
parts =
neoinstall
find-links =
../../eggs/
...
...
eggs/makeeggs
View file @
f78f7339
...
...
@@ -3,7 +3,7 @@ PYTHON=python2.6
INSTALL_DIR
=
eggs/
cd dirname
$0
/..
case
"
$1
"
in
case
"
$1
"
in
"develop"
)
MODE
=
develop
PYTHONPATH
=
$PYTHONPATH
:
$INSTALL_DIR
;;
...
...
@@ -17,4 +17,4 @@ $PYTHON setup_ctl.py $MODE --dist-dir=$INSTALL_DIR
$PYTHON
setup_tests.py
$MODE
--dist-dir
=
$INSTALL_DIR
$PYTHON
setup_storage.py
$MODE
--dist-dir
=
$INSTALL_DIR
$PYTHON
setup_master.py
$MODE
--dist-dir
=
$INSTALL_DIR
neo.conf
View file @
f78f7339
...
...
@@ -32,7 +32,7 @@ partitions: 20
# They are:
# bind: The ip:port the node will listen on.
# database: Storage nodes only. The MySQL database credentials to use
# (username:password@database).
# (username:password@database).
# Those database must be created manualy.
# Admin node
...
...
neo/lib/connector.py
View file @
f78f7339
...
...
@@ -52,7 +52,7 @@ class SocketConnector:
self
.
is_listening
=
False
self
.
is_closed
=
False
if
s
is
None
:
self
.
socket
=
socket
.
socket
(
self
.
af_type
,
socket
.
SOCK_STREAM
)
self
.
socket
=
socket
.
socket
(
self
.
af_type
,
socket
.
SOCK_STREAM
)
else
:
self
.
socket
=
s
self
.
socket_fd
=
self
.
socket
.
fileno
()
...
...
@@ -102,7 +102,7 @@ class SocketConnector:
try
:
(
new_s
,
addr
)
=
self
.
_accept
()
new_s
=
self
.
__class__
(
new_s
,
accepted_from
=
addr
)
return
(
new_s
,
addr
)
return
(
new_s
,
addr
)
except
socket
.
error
,
(
err
,
errmsg
):
if
err
==
errno
.
EAGAIN
:
raise
ConnectorTryAgainException
...
...
@@ -168,7 +168,7 @@ class SocketConnector:
def
_accept
(
self
):
raise
NotImplementedError
class
SocketConnectorIPv4
(
SocketConnector
):
" Wrapper for IPv4 sockets"
af_type
=
socket
.
AF_INET
...
...
@@ -178,21 +178,21 @@ class SocketConnectorIPv4(SocketConnector):
def
getAddress
(
self
):
return
self
.
socket
.
getsockname
()
class
SocketConnectorIPv6
(
SocketConnector
):
" Wrapper for IPv6 sockets"
af_type
=
socket
.
AF_INET6
" Wrapper for IPv6 sockets"
af_type
=
socket
.
AF_INET6
def
_accept
(
self
):
new_s
,
addr
=
self
.
socket
.
accept
()
new_s
,
addr
=
self
.
socket
.
accept
()
addr
=
(
addr
[
0
],
addr
[
1
])
return
(
new_s
,
addr
)
def
getAddress
(
self
):
addr
=
self
.
socket
.
getsockname
()
addr
=
(
addr
[
0
],
addr
[
1
])
return
addr
registerConnectorHandler
(
SocketConnectorIPv4
)
registerConnectorHandler
(
SocketConnectorIPv6
)
...
...
neo/lib/util.py
View file @
f78f7339
...
...
@@ -22,7 +22,7 @@ from zlib import adler32
from
Queue
import
deque
from
struct
import
pack
,
unpack
SOCKET_CONNECTORS_DICT
=
{
SOCKET_CONNECTORS_DICT
=
{
socket
.
AF_INET
:
'SocketConnectorIPv4'
,
socket
.
AF_INET6
:
'SocketConnectorIPv6'
,
}
...
...
@@ -77,10 +77,10 @@ def resolve(hostname):
return
None
return
address_list
[
0
]
def
getAddressType
(
address
):
def
getAddressType
(
address
):
"Return the type (IPv4 or IPv6) of an ip"
(
host
,
port
)
=
address
for
af_type
in
SOCKET_CONNECTORS_DICT
.
keys
():
try
:
socket
.
inet_pton
(
af_type
,
host
)
...
...
@@ -88,14 +88,14 @@ def getAddressType(address):
continue
else
:
break
else
:
raise
ValueError
(
"Unknown type of host"
,
host
)
else
:
raise
ValueError
(
"Unknown type of host"
,
host
)
return
af_type
def
getConnectorFromAddress
(
address
):
address_type
=
getAddressType
(
address
)
address_type
=
getAddressType
(
address
)
return
SOCKET_CONNECTORS_DICT
[
address_type
]
def
parseNodeAddress
(
address
,
port_opt
=
None
):
if
']'
in
address
:
(
ip
,
port
)
=
address
.
split
(
']'
)
...
...
@@ -109,11 +109,11 @@ def parseNodeAddress(address, port_opt=None):
else
:
ip
=
address
port
=
port_opt
if
port
is
None
:
raise
ValueError
return
(
ip
,
int
(
port
))
def
parseMasterList
(
masters
,
except_node
=
None
):
assert
masters
,
'At least one master must be defined'
socket_connector
=
''
...
...
@@ -131,11 +131,11 @@ def parseMasterList(masters, except_node=None):
if
socket_connector
==
''
:
socket_connector
=
socket_connector_temp
elif
socket_connector
==
socket_connector_temp
:
pass
pass
else
:
return
TypeError
,
(
" Wrong connector type : you're trying to use ipv6 and ipv4 simultaneously"
)
return
tuple
(
master_node_list
),
socket_connector
return
tuple
(
master_node_list
),
socket_connector
class
Enum
(
dict
):
"""
...
...
neo/master/app.py
View file @
f78f7339
...
...
@@ -58,7 +58,7 @@ class Application(object):
self
.
connector_handler
=
getConnectorHandler
(
connector_name
)
for
master_address
in
master_addresses
:
self
.
nm
.
createMaster
(
address
=
master_address
)
neo
.
lib
.
logging
.
debug
(
'IP address is %s, port is %d'
,
*
(
self
.
server
))
# Partition table
...
...
neo/master/transactions.py
View file @
f78f7339
...
...
@@ -272,7 +272,7 @@ class TransactionManager(object):
def
_nextTID
(
self
,
ttid
,
divisor
):
"""
Compute the next TID based on the current time and check collisions.
Also, adjust it so that
Also, adjust it so that
tid % divisor == ttid % divisor
while preserving
min_tid < tid
...
...
neo/neoctl/neoctl.py
View file @
f78f7339
...
...
@@ -40,7 +40,7 @@ class NeoCTL(object):
def
__getConnection
(
self
):
if
not
self
.
connected
:
self
.
connection
=
ClientConnection
(
self
.
em
,
self
.
handler
,
self
.
connection
=
ClientConnection
(
self
.
em
,
self
.
handler
,
addr
=
self
.
server
,
connector
=
self
.
connector_handler
())
while
self
.
connection
is
not
None
:
if
self
.
connected
:
...
...
@@ -140,7 +140,7 @@ class NeoCTL(object):
"""
Set node into "down" state and remove it from partition table.
"""
return
self
.
setNodeState
(
node
,
NodeStates
.
DOWN
,
return
self
.
setNodeState
(
node
,
NodeStates
.
DOWN
,
update_partition_table
=
1
)
def
getPrimary
(
self
):
...
...
neo/scripts/neoadmin.py
View file @
f78f7339
# neoadmin - run an administrator node of NEO
#
# Copyright (C) 2009 Nexedi SA
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -23,10 +23,10 @@ from neo.lib.config import ConfigurationManager
parser
=
OptionParser
()
parser
.
add_option
(
'-u'
,
'--uuid'
,
help
=
'specify an UUID to use for this '
\
'process'
)
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
help
=
'print verbose messages'
)
parser
.
add_option
(
'-f'
,
'--file'
,
help
=
'specify a configuration file'
)
parser
.
add_option
(
'-s'
,
'--section'
,
help
=
'specify a configuration section'
)
parser
.
add_option
(
'-f'
,
'--file'
,
help
=
'specify a configuration file'
)
parser
.
add_option
(
'-s'
,
'--section'
,
help
=
'specify a configuration section'
)
parser
.
add_option
(
'-l'
,
'--logfile'
,
help
=
'specify a logging file'
)
parser
.
add_option
(
'-c'
,
'--cluster'
,
help
=
'the cluster name'
)
parser
.
add_option
(
'-m'
,
'--masters'
,
help
=
'master node list'
)
...
...
neo/scripts/neoctl.py
View file @
f78f7339
# neoadmin - run an administrator node of NEO
#
# Copyright (C) 2009 Nexedi SA
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -22,7 +22,7 @@ from neo.lib import setupLog
from
neo.lib.util
import
parseNodeAddress
parser
=
OptionParser
()
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
help
=
'print verbose messages'
)
parser
.
add_option
(
'-a'
,
'--address'
,
help
=
'specify the address (ip:port) '
\
'of an admin node'
,
default
=
'127.0.0.1:9999'
)
...
...
@@ -31,10 +31,10 @@ parser.add_option('--handler', help = 'specify the connection handler')
def
main
(
args
=
None
):
(
options
,
args
)
=
parser
.
parse_args
(
args
=
args
)
if
options
.
address
is
not
None
:
address
=
parseNodeAddress
(
options
.
address
,
9999
)
address
=
parseNodeAddress
(
options
.
address
,
9999
)
else
:
address
=
(
'127.0.0.1'
,
9999
)
setupLog
(
'NEOCTL'
,
options
.
verbose
)
from
neo.neoctl.app
import
Application
...
...
neo/scripts/neomaster.py
View file @
f78f7339
# neomaster - run a master node of NEO
#
# Copyright (C) 2006 Nexedi SA
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -21,10 +21,10 @@ from neo.lib import setupLog
from
neo.lib.config
import
ConfigurationManager
parser
=
OptionParser
()
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
help
=
'print verbose messages'
)
parser
.
add_option
(
'-f'
,
'--file'
,
help
=
'specify a configuration file'
)
parser
.
add_option
(
'-s'
,
'--section'
,
help
=
'specify a configuration section'
)
parser
.
add_option
(
'-f'
,
'--file'
,
help
=
'specify a configuration file'
)
parser
.
add_option
(
'-s'
,
'--section'
,
help
=
'specify a configuration section'
)
parser
.
add_option
(
'-u'
,
'--uuid'
,
help
=
'the node UUID (testing purpose)'
)
parser
.
add_option
(
'-n'
,
'--name'
,
help
=
'the node name (impove logging)'
)
parser
.
add_option
(
'-b'
,
'--bind'
,
help
=
'the local address to bind to'
)
...
...
neo/scripts/neomigrate.py
View file @
f78f7339
...
...
@@ -3,12 +3,12 @@
# neomaster - run a master node of NEO
#
# Copyright (C) 2006 Nexedi SA
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -27,7 +27,7 @@ from neo.lib import setupLog
# register options
parser
=
OptionParser
()
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
help
=
'print verbose messages'
)
parser
.
add_option
(
'-s'
,
'--source'
,
help
=
'the source database'
)
parser
.
add_option
(
'-d'
,
'--destination'
,
help
=
'the destination database'
)
...
...
neo/scripts/neostorage.py
View file @
f78f7339
...
...
@@ -3,12 +3,12 @@
# neostorage - run a storage node of NEO
#
# Copyright (C) 2006 Nexedi SA
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -24,13 +24,13 @@ from neo.lib.config import ConfigurationManager
parser
=
OptionParser
()
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
parser
.
add_option
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
help
=
'print verbose messages'
)
parser
.
add_option
(
'-u'
,
'--uuid'
,
help
=
'specify an UUID to use for this '
\
'process. Previously assigned UUID takes precedence (ie '
\
'you should always use -R with this switch)'
)
parser
.
add_option
(
'-f'
,
'--file'
,
help
=
'specify a configuration file'
)
parser
.
add_option
(
'-s'
,
'--section'
,
help
=
'specify a configuration section'
)
parser
.
add_option
(
'-f'
,
'--file'
,
help
=
'specify a configuration file'
)
parser
.
add_option
(
'-s'
,
'--section'
,
help
=
'specify a configuration section'
)
parser
.
add_option
(
'-l'
,
'--logfile'
,
help
=
'specify a logging file'
)
parser
.
add_option
(
'-R'
,
'--reset'
,
action
=
'store_true'
,
help
=
'remove an existing database if any'
)
...
...
@@ -61,9 +61,9 @@ def main(args=None):
adapter
=
options
.
adapter
,
)
config
=
ConfigurationManager
(
defaults
,
options
.
file
,
options
.
section
or
'storage'
,
defaults
,
options
.
file
,
options
.
section
or
'storage'
,
arguments
,
)
...
...
neo/scripts/runner.py
View file @
f78f7339
#! /usr/bin/env python
#
# Copyright (C) 2009 Nexedi SA
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -29,7 +29,7 @@ from neo.tests.benchmark import BenchmarkRunner
# list of test modules
# each of them have to import its TestCase classes
UNIT_TEST_MODULES
=
[
UNIT_TEST_MODULES
=
[
# generic parts
'neo.tests.testBootstrap'
,
'neo.tests.testConnection'
,
...
...
@@ -138,7 +138,7 @@ class NeoTestRunner(unittest.TestResult):
module
=
test
.
__class__
.
__module__
module
=
tuple
(
module
.
split
(
'.'
))
try
:
return
self
.
modulesStats
[
module
]
return
self
.
modulesStats
[
module
]
except
KeyError
:
self
.
modulesStats
[
module
]
=
self
.
ModuleStats
()
return
self
.
modulesStats
[
module
]
...
...
@@ -186,7 +186,7 @@ class NeoTestRunner(unittest.TestResult):
header
=
"%25s | run | success | errors | fails | time
\
n
"
%
'Test Module'
separator
=
"%25s-+---------+---------+---------+---------+----------
\
n
"
%
(
'-'
*
25
)
format
=
"%25s | %3s | %3s | %3s | %3s | %6.2fs
\
n
"
group_f
=
"%25s | | | | |
\
n
"
group_f
=
"%25s | | | | |
\
n
"
# header
s
=
' '
*
30
+
' NEO TESTS REPORT'
s
+=
'
\
n
'
...
...
neo/storage/app.py
View file @
f78f7339
...
...
@@ -55,7 +55,7 @@ class Application(object):
self
.
connector_handler
=
getConnectorHandler
(
connector_name
)
for
master_address
in
master_addresses
:
self
.
nm
.
createMaster
(
address
=
master_address
)
# set the bind address
self
.
server
=
config
.
getBind
()
neo
.
lib
.
logging
.
debug
(
'IP address is %s, port is %d'
,
*
(
self
.
server
))
...
...
neo/storage/database/mysqldb.py
View file @
f78f7339
...
...
@@ -805,7 +805,7 @@ class MySQLDatabaseManager(DatabaseManager):
self
.
rollback
()
raise
self
.
commit
()
def
checkTIDRange
(
self
,
min_tid
,
max_tid
,
length
,
num_partitions
,
partition
):
# XXX: XOR is a lame checksum
count
,
tid_checksum
,
max_tid
=
self
.
query
(
'SELECT COUNT(*), '
...
...
neo/storage/transactions.py
View file @
f78f7339
...
...
@@ -193,7 +193,7 @@ class TransactionManager(object):
self
.
_load_lock_dict
.
get
(
oid
)
!=
ttid
:
raise
ValueError
,
'Some locks are not held'
object_list
=
transaction
.
getObjectList
()
# txn_info is None is the transaction information is not stored on
# txn_info is None is the transaction information is not stored on
# this storage.
txn_info
=
transaction
.
getTransactionInformations
()
# store data from memory to temporary table
...
...
@@ -263,7 +263,7 @@ class TransactionManager(object):
if
history_list
:
previous_serial
=
history_list
[
0
][
0
]
if
previous_serial
is
not
None
and
previous_serial
!=
serial
:
neo
.
lib
.
logging
.
info
(
'Resolvable conflict on %r:%r'
,
neo
.
lib
.
logging
.
info
(
'Resolvable conflict on %r:%r'
,
dump
(
oid
),
dump
(
ttid
))
raise
ConflictError
(
previous_serial
)
neo
.
lib
.
logging
.
debug
(
'Transaction %s storing %s'
,
...
...
neo/tests/benchmark.py
View file @
f78f7339
...
...
@@ -96,7 +96,7 @@ class BenchmarkRunner(object):
if
self
.
_config
.
mail_to
:
self
.
send_report
(
subject
,
report
)
print
subject
print
print
print
report
def
was_successful
(
self
):
...
...
neo/tests/client/testClientApp.py
View file @
f78f7339
...
...
@@ -307,7 +307,7 @@ class ClientApplicationTests(NeoUnitTestBase):
app
.
pt
=
Mock
({
'getCellListForOID'
:
(
cell
,
cell
)})
app
.
cp
=
self
.
getConnectionPool
([(
node
,
conn
)])
class
Dispatcher
(
object
):
def
pending
(
self
,
queue
):
def
pending
(
self
,
queue
):
return
not
queue
.
empty
()
app
.
dispatcher
=
Dispatcher
()
app
.
nm
.
createStorage
(
address
=
storage_address
)
...
...
@@ -338,7 +338,7 @@ class ClientApplicationTests(NeoUnitTestBase):
app
.
cp
=
self
.
getConnectionPool
([(
node
,
conn
)])
app
.
pt
=
Mock
({
'getCellListForOID'
:
(
cell
,
cell
,
)
})
class
Dispatcher
(
object
):
def
pending
(
self
,
queue
):
def
pending
(
self
,
queue
):
return
not
queue
.
empty
()
app
.
dispatcher
=
Dispatcher
()
app
.
nm
.
createStorage
(
address
=
storage_address
)
...
...
@@ -567,7 +567,7 @@ class ClientApplicationTests(NeoUnitTestBase):
'getConnForCell'
:
conn
,
})
class
Dispatcher
(
object
):
def
pending
(
self
,
queue
):
def
pending
(
self
,
queue
):
return
not
queue
.
empty
()
app
.
dispatcher
=
Dispatcher
()
def
load
(
oid
,
tid
,
before_tid
):
...
...
neo/tests/client/testMasterHandler.py
View file @
f78f7339
...
...
@@ -55,7 +55,7 @@ class MasterBootstrapHandlerTests(MasterHandlerTests):
""" Non-master node """
conn
=
self
.
getConnection
()
uuid
=
self
.
getNewUUID
()
self
.
handler
.
acceptIdentification
(
conn
,
NodeTypes
.
CLIENT
,
self
.
handler
.
acceptIdentification
(
conn
,
NodeTypes
.
CLIENT
,
uuid
,
100
,
0
,
None
)
self
.
checkClosed
(
conn
)
...
...
@@ -75,7 +75,7 @@ class MasterBootstrapHandlerTests(MasterHandlerTests):
partitions
=
100
replicas
=
2
self
.
app
.
nm
=
Mock
({
'getByAddress'
:
node
})
self
.
handler
.
acceptIdentification
(
conn
,
NodeTypes
.
MASTER
,
uuid
,
self
.
handler
.
acceptIdentification
(
conn
,
NodeTypes
.
MASTER
,
uuid
,
partitions
,
replicas
,
your_uuid
)
self
.
assertEqual
(
self
.
app
.
uuid
,
your_uuid
)
self
.
checkUUIDSet
(
conn
,
uuid
)
...
...
@@ -189,13 +189,13 @@ class MasterNotificationsHandlerTests(MasterHandlerTests):
conn1
=
self
.
getFakeConnection
()
conn2
=
self
.
getFakeConnection
()
node1
=
Mock
({
'getConnection'
:
conn1
,
'getConnection'
:
conn1
,
'__nonzero__'
:
1
,
'isConnected'
:
True
,
'__repr__'
:
'Fake Node'
,
})
node2
=
Mock
({
'getConnection'
:
conn2
,
'getConnection'
:
conn2
,
'__nonzero__'
:
1
,
'isConnected'
:
True
,
'__repr__'
:
'Fake Node'
,
...
...
@@ -258,7 +258,7 @@ class MasterAnswersHandlerTests(MasterHandlerTests):
calls
=
self
.
app
.
mockGetNamedCalls
(
'setHandlerData'
)
self
.
assertEqual
(
len
(
calls
),
1
)
calls
[
0
].
checkArgs
(
tid2
)
def
test_answerPack
(
self
):
self
.
assertRaises
(
NEOStorageError
,
self
.
handler
.
answerPack
,
None
,
False
)
# Check it doesn't raise
...
...
neo/tests/client/testStorageHandler.py
View file @
f78f7339
...
...
@@ -226,7 +226,7 @@ class StorageAnswerHandlerTests(NeoUnitTestBase):
conn
=
self
.
getConnection
()
self
.
assertRaises
(
NEOStorageDoesNotExistError
,
self
.
handler
.
oidDoesNotExist
,
conn
,
'message'
)
def
test_tidNotFound
(
self
):
conn
=
self
.
getConnection
()
self
.
assertRaises
(
NEOStorageNotFoundError
,
self
.
handler
.
tidNotFound
,
...
...
neo/tests/functional/testClient.py
View file @
f78f7339
...
...
@@ -269,13 +269,13 @@ class ClientTests(NEOFunctionalTest):
def
testIPv6Client
(
self
):
""" Test the connectivity of an IPv6 connection for neo client """
def
test
():
"""
"""
Implement the IPv6Client test
"""
self
.
neo
=
NEOCluster
([
'test_neo1'
],
replicas
=
0
,
temp_dir
=
self
.
getTempDirectory
(),
temp_dir
=
self
.
getTempDirectory
(),
address_type
=
socket
.
AF_INET6
)
neoctl
=
NeoCTL
((
'::1'
,
0
))
...
...
@@ -283,7 +283,7 @@ class ClientTests(NEOFunctionalTest):
db1
,
conn1
=
self
.
neo
.
getZODBConnection
()
db2
,
conn2
=
self
.
neo
.
getZODBConnection
()
self
.
runWithTimeout
(
40
,
test
)
def
testDelayedLocksCancelled
(
self
):
"""
Hold a lock on an object, try to get another lock on the same
...
...
neo/tests/master/testElectionHandler.py
View file @
f78f7339
...
...
@@ -123,7 +123,7 @@ class MasterClientElectionTests(NeoUnitTestBase):
""" A non-master node accept identification """
node
,
conn
=
self
.
identifyToMasterNode
()
args
=
(
node
.
getUUID
(),
0
,
10
,
self
.
app
.
uuid
)
self
.
election
.
acceptIdentification
(
conn
,
self
.
election
.
acceptIdentification
(
conn
,
NodeTypes
.
CLIENT
,
*
args
)
self
.
assertFalse
(
node
in
self
.
app
.
unconnected_master_node_set
)
self
.
assertFalse
(
node
in
self
.
app
.
negotiating_master_node_set
)
...
...
@@ -228,15 +228,15 @@ class MasterServerElectionTests(NeoUnitTestBase):
""" A non-master node request identification """
node
,
conn
=
self
.
identifyToMasterNode
()
args
=
(
node
.
getUUID
(),
node
.
getAddress
(),
self
.
app
.
name
)
self
.
assertRaises
(
protocol
.
NotReadyError
,
self
.
election
.
requestIdentification
,
self
.
assertRaises
(
protocol
.
NotReadyError
,
self
.
election
.
requestIdentification
,
conn
,
NodeTypes
.
CLIENT
,
*
args
)
def
test_requestIdentification2
(
self
):
""" A unknown master node request identification """
node
,
conn
=
self
.
identifyToMasterNode
()
args
=
(
node
.
getUUID
(),
(
'127.0.0.1'
,
1000
),
self
.
app
.
name
)
self
.
checkProtocolErrorRaised
(
self
.
election
.
requestIdentification
,
self
.
checkProtocolErrorRaised
(
self
.
election
.
requestIdentification
,
conn
,
NodeTypes
.
MASTER
,
*
args
)
def
test_requestIdentification3
(
self
):
...
...
@@ -244,8 +244,8 @@ class MasterServerElectionTests(NeoUnitTestBase):
node
,
conn
=
self
.
identifyToMasterNode
()
node
.
setBroken
()
args
=
(
node
.
getUUID
(),
node
.
getAddress
(),
self
.
app
.
name
)
self
.
assertRaises
(
protocol
.
BrokenNodeDisallowedError
,
self
.
election
.
requestIdentification
,
self
.
assertRaises
(
protocol
.
BrokenNodeDisallowedError
,
self
.
election
.
requestIdentification
,
conn
,
NodeTypes
.
MASTER
,
*
args
)
def
test_requestIdentification4
(
self
):
...
...
neo/tests/storage/testClientHandler.py
View file @
f78f7339
...
...
@@ -152,7 +152,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
cell
=
Mock
({
'getUUID'
:
self
.
app
.
uuid
})
self
.
app
.
dm
=
Mock
({
'getTIDList'
:
(
INVALID_TID
,
)})
self
.
app
.
pt
=
Mock
({
'getCellList'
:
(
cell
,
),
'getCellList'
:
(
cell
,
),
'getPartitions'
:
1
,
'getAssignedPartitionList'
:
[
0
],
})
...
...
@@ -215,7 +215,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
conn
=
self
.
_getConnection
(
uuid
=
uuid
)
tid
=
self
.
getNextTID
()
oid
,
serial
,
comp
,
checksum
,
data
=
self
.
_getObject
()
self
.
operation
.
askStoreObject
(
conn
,
oid
,
serial
,
comp
,
checksum
,
self
.
operation
.
askStoreObject
(
conn
,
oid
,
serial
,
comp
,
checksum
,
data
,
None
,
tid
,
False
)
self
.
_checkStoreObjectCalled
(
tid
,
serial
,
oid
,
comp
,
checksum
,
data
,
None
,
False
)
...
...
@@ -232,7 +232,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
tid
=
self
.
getNextTID
()
oid
,
serial
,
comp
,
checksum
,
data
=
self
.
_getObject
()
data_tid
=
self
.
getNextTID
()
self
.
operation
.
askStoreObject
(
conn
,
oid
,
serial
,
comp
,
checksum
,
self
.
operation
.
askStoreObject
(
conn
,
oid
,
serial
,
comp
,
checksum
,
''
,
data_tid
,
tid
,
False
)
self
.
_checkStoreObjectCalled
(
tid
,
serial
,
oid
,
comp
,
checksum
,
None
,
data_tid
,
False
)
...
...
@@ -252,7 +252,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
raise
ConflictError
(
locking_tid
)
self
.
app
.
tm
.
storeObject
=
fakeStoreObject
oid
,
serial
,
comp
,
checksum
,
data
=
self
.
_getObject
()
self
.
operation
.
askStoreObject
(
conn
,
oid
,
serial
,
comp
,
checksum
,
self
.
operation
.
askStoreObject
(
conn
,
oid
,
serial
,
comp
,
checksum
,
data
,
None
,
tid
,
False
)
pconflicting
,
poid
,
pserial
=
self
.
checkAnswerStoreObject
(
conn
,
decode
=
True
)
...
...
neo/tests/storage/testStorageDBTests.py
View file @
f78f7339
...
...
@@ -454,7 +454,7 @@ class StorageDBTests(NeoUnitTestBase):
txn4
,
objs4
=
self
.
getTransaction
([
oid2
])
txn5
,
objs5
=
self
.
getTransaction
([
oid3
])
self
.
db
.
storeTransaction
(
tid1
,
objs1
,
txn1
)