Commit e22316a5 authored by Jérome Perrin's avatar Jérome Perrin

test

parent 3001040e
......@@ -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))
......
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