Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
zhifan huang
re6stnet
Commits
8df72681
Commit
8df72681
authored
May 19, 2022
by
zhifan huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: fix client_count too large
parent
4ea707df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
re6st/tests/test_network/re6st_wrap.py
re6st/tests/test_network/re6st_wrap.py
+7
-4
re6st/tests/test_network/test_net.py
re6st/tests/test_network/test_net.py
+2
-1
No files found.
re6st/tests/test_network/re6st_wrap.py
View file @
8df72681
...
@@ -19,9 +19,11 @@ WORK_DIR = Path(__file__).parent / "temp_net_test"
...
@@ -19,9 +19,11 @@ WORK_DIR = Path(__file__).parent / "temp_net_test"
DH_FILE
=
WORK_DIR
/
"dh2048.pem"
DH_FILE
=
WORK_DIR
/
"dh2048.pem"
RE6STNET
=
"re6stnet"
RE6STNET
=
"re6stnet"
RE6STNET
=
"python -m re6st.cli.node"
RE6ST_REGISTRY
=
"re6st-registry"
RE6ST_REGISTRY
=
"re6st-registry"
#
RE6ST_REGISTRY = "python -m re6st.cli.registry"
RE6ST_REGISTRY
=
"python -m re6st.cli.registry"
RE6ST_CONF
=
"re6st-conf"
RE6ST_CONF
=
"re6st-conf"
RE6ST_CONF
=
"python -m re6st.cli.conf"
def
initial
():
def
initial
():
"""create the workplace and dh file"""
"""create the workplace and dh file"""
...
@@ -42,11 +44,12 @@ class Re6stRegistry(object):
...
@@ -42,11 +44,12 @@ class Re6stRegistry(object):
"""class run a re6st-registry service on a namespace"""
"""class run a re6st-registry service on a namespace"""
registry_seq
=
0
registry_seq
=
0
def
__init__
(
self
,
node
,
ip6
,
recreate
=
False
):
def
__init__
(
self
,
node
,
ip6
,
client_number
,
recreate
=
False
):
self
.
node
=
node
self
.
node
=
node
# TODO need set once
# TODO need set once
self
.
ip
=
node
.
ip
self
.
ip
=
node
.
ip
self
.
ip6
=
ip6
self
.
ip6
=
ip6
self
.
client_number
=
client_number
self
.
name
=
self
.
generate_name
()
self
.
name
=
self
.
generate_name
()
self
.
path
=
WORK_DIR
/
self
.
name
self
.
path
=
WORK_DIR
/
self
.
name
...
@@ -116,10 +119,10 @@ class Re6stRegistry(object):
...
@@ -116,10 +119,10 @@ class Re6stRegistry(object):
def
run
(
self
):
def
run
(
self
):
cmd
=
(
"{script} --ca {ca} --key {key} --dh {dh} --ipv4 10.42.0.0/16 8 "
cmd
=
(
"{script} --ca {ca} --key {key} --dh {dh} --ipv4 10.42.0.0/16 8 "
" --logfile {log} --db {db} --run {run} --hello 4 --mailhost s "
" --logfile {log} --db {db} --run {run} --hello 4 --mailhost s "
"-v4"
)
"-v4
--client-count {nb}
"
)
cmd
=
cmd
.
format
(
script
=
RE6ST_REGISTRY
,
ca
=
self
.
ca_crt
,
cmd
=
cmd
.
format
(
script
=
RE6ST_REGISTRY
,
ca
=
self
.
ca_crt
,
key
=
self
.
ca_key
,
dh
=
DH_FILE
,
log
=
self
.
log
,
db
=
self
.
db
,
key
=
self
.
ca_key
,
dh
=
DH_FILE
,
log
=
self
.
log
,
db
=
self
.
db
,
run
=
self
.
run_path
).
split
()
run
=
self
.
run_path
,
nb
=
(
self
.
client_number
+
1
)
//
2
).
split
()
logging
.
debug
(
"run registry %s at ns: %s with cmd: %s"
,
logging
.
debug
(
"run registry %s at ns: %s with cmd: %s"
,
self
.
name
,
self
.
node
.
pid
,
" "
.
join
(
cmd
))
self
.
name
,
self
.
node
.
pid
,
" "
.
join
(
cmd
))
self
.
proc
=
self
.
node
.
Popen
(
cmd
,
stdout
=
PIPE
,
stderr
=
PIPE
)
self
.
proc
=
self
.
node
.
Popen
(
cmd
,
stdout
=
PIPE
,
stderr
=
PIPE
)
...
...
re6st/tests/test_network/test_net.py
View file @
8df72681
...
@@ -21,7 +21,8 @@ def deploy_re6st(nm, recreate=False):
...
@@ -21,7 +21,8 @@ def deploy_re6st(nm, recreate=False):
re6st_wrap
.
Re6stRegistry
.
registry_seq
=
0
re6st_wrap
.
Re6stRegistry
.
registry_seq
=
0
re6st_wrap
.
Re6stNode
.
node_seq
=
0
re6st_wrap
.
Re6stNode
.
node_seq
=
0
for
registry
in
net
:
for
registry
in
net
:
reg
=
re6st_wrap
.
Re6stRegistry
(
registry
,
"2001:db8:42::"
,
recreate
=
recreate
)
reg
=
re6st_wrap
.
Re6stRegistry
(
registry
,
"2001:db8:42::"
,
len
(
net
[
registry
]),
recreate
=
recreate
)
reg_node
=
re6st_wrap
.
Re6stNode
(
registry
,
reg
,
name
=
reg
.
name
)
reg_node
=
re6st_wrap
.
Re6stNode
(
registry
,
reg
,
name
=
reg
.
name
)
registrys
.
append
(
reg
)
registrys
.
append
(
reg
)
reg_node
.
run
(
"--gateway"
,
"--disable-proto"
,
"none"
,
"--ip"
,
registry
.
ip
)
reg_node
.
run
(
"--gateway"
,
"--disable-proto"
,
"none"
,
"--ip"
,
registry
.
ip
)
...
...
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