Commit 58d02eb6 authored by Ivan Tyagov's avatar Ivan Tyagov

Extend base class so that it can request SRs and

See merge request nexedi/slapos.core!589
parents de93cf62 a893b3cb
...@@ -30,6 +30,7 @@ class EndToEndTestCase(unittest.TestCase): ...@@ -30,6 +30,7 @@ class EndToEndTestCase(unittest.TestCase):
cls._request = staticmethod(local['request']) cls._request = staticmethod(local['request'])
cls.product = staticmethod(local['product']) cls.product = staticmethod(local['product'])
cls._requested = {} cls._requested = {}
cls._supplied = {}
@classmethod @classmethod
def createLogger(cls): def createLogger(cls):
...@@ -51,6 +52,12 @@ class EndToEndTestCase(unittest.TestCase): ...@@ -51,6 +52,12 @@ class EndToEndTestCase(unittest.TestCase):
kw['state'] = 'destroyed' kw['state'] = 'destroyed'
cls._request(*args, **kw) cls._request(*args, **kw)
# remove software releases
for k,v in cls._supplied.items():
print("Remove %s from %s" %(k, v))
cls._supply(k, v, 'destroyed')
@classmethod @classmethod
def request(cls, *args, **kw): def request(cls, *args, **kw):
instance_name = args[1] instance_name = args[1]
...@@ -58,6 +65,11 @@ class EndToEndTestCase(unittest.TestCase): ...@@ -58,6 +65,11 @@ class EndToEndTestCase(unittest.TestCase):
partition = cls._request(*args, **kw) partition = cls._request(*args, **kw)
return cls.unwrapConnectionDict(partition.getConnectionParameterDict()) return cls.unwrapConnectionDict(partition.getConnectionParameterDict())
@classmethod
def supply(cls, software_release, computer_id, state):
cls._supplied[software_release] = computer_id
cls._supply(software_release, computer_id, state)
@staticmethod @staticmethod
def unwrapConnectionDict(connection_dict): def unwrapConnectionDict(connection_dict):
try: try:
......
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