Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
e22316a5
Commit
e22316a5
authored
Apr 13, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
3001040e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
software/proftpd/test/utils.py
software/proftpd/test/utils.py
+16
-11
No files found.
software/proftpd/test/utils.py
View file @
e22316a5
...
...
@@ -63,17 +63,22 @@ class SlapOSInstanceTestCase(unittest.TestCase):
"""
return
{}
# TODO: software type ?
# TODO: allow subclasses to request a specific software type ?
@
classmethod
def
setUpClass
(
cls
):
# XXX beware of Error: Cannot open an HTTP server: socket.error reported AF_UNIX path too long
# This `working_directory` should not be too deep.
working_directory
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'.slapos'
)
# TODO: allow using a specific directory from envionment variable, similar
# to --save/--load in erp5 tests.
# XXX beware of Error: Cannot open an HTTP server: socket.error reported AF_UNIX path too long
# This `working_directory` should not be too deep. Socket path is 108 char
# max on linux
# https://github.com/torvalds/linux/blob/3848ec5/net/unix/af_unix.c#L234-L238
# XXX for now use /tmp/ ( XXX without even taking care of changing its permissions )
working_directory
=
'/tmp/slapotest/'
if
not
os
.
path
.
exists
(
working_directory
):
os
.
mkdir
(
working_directory
)
...
...
@@ -84,16 +89,16 @@ class SlapOSInstanceTestCase(unittest.TestCase):
"computer_id"
:
'slapos.test'
,
# XXX
'proxy_database'
:
os
.
path
.
join
(
working_directory
,
'proxy.db'
),
'partition_reference'
:
cls
.
__name__
,
#
TODO
'slapos_binary'
:
'
/opt/slapgrid/b0bcd9831b23f334bc85e4a193c748a0/bin/
slapos'
,
#
"proper" slapos command must be in $PATH
'slapos_binary'
:
'slapos'
,
}
#
TODO: read from environment / guess ipv4 from buildout file
# note that by default we don't use 127.0.0.1, because some tests want to
# check that we don't mess with 127.0.0.1
ipv4_address
=
'127.0.1.1'
#
Some tests are expecting that local IP is not set to 127.0.0.1
ipv4_address
=
os
.
environ
.
get
(
'LOCAL_IPV4'
,
'127.0.1.1'
)
ipv6_address
=
os
.
environ
[
'GLOBAL_IPV6'
]
config
[
'proxy_host'
]
=
config
[
'ipv4_address'
]
=
ipv4_address
config
[
'ipv6_address'
]
=
'2001:67c:1254:26::3318'
config
[
'ipv6_address'
]
=
ipv6_address
config
[
'proxy_port'
]
=
findFreeTCPPort
(
ipv4_address
)
config
[
'master_url'
]
=
'http://{proxy_host}:{proxy_port}'
.
format
(
**
config
)
...
...
@@ -137,7 +142,7 @@ class SlapOSInstanceTestCase(unittest.TestCase):
computer_partition_list
.
append
(
slapos_controler
.
slap
.
registerOpenOrder
().
request
(
software_url_list
[
i
],
#
XXX this is how testnode
name created partitions
#
This is how testnode's SlapOSControler
name created partitions
partition_reference
=
'testing partition {i}'
.
format
(
i
=
i
,
**
config
),
partition_parameter_kw
=
instance_parameter_dict
))
...
...
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