Merge branch 'atherton' of github.com:platform9/pf9-mors into atherton
This commit is contained in:
commit
1e515759b3
|
@ -109,7 +109,7 @@ def add_update_vm_lease(tenant_id, instance_id):
|
|||
if request.method == "POST":
|
||||
lease_manager.add_instance_lease(get_context(), tenant_id, lease_obj)
|
||||
else:
|
||||
lease_manager.update_tenant_lease(get_context(), tenant_id, lease_obj)
|
||||
lease_manager.update_instance_lease(get_context(), tenant_id, lease_obj)
|
||||
return jsonify({'success': True}), 200, {'ContentType': 'application/json'}
|
||||
|
||||
|
||||
|
|
|
@ -152,8 +152,25 @@ def test_get_instance():
|
|||
logger.debug(r.text)
|
||||
assert_equal(r.status_code, 200)
|
||||
|
||||
|
||||
@test(depends_on=[test_get_instance])
|
||||
def test_update_instance():
|
||||
expiry = datetime.utcnow()
|
||||
expiry_str = datetime.strftime(expiry, DATE_FORMAT)
|
||||
r = requests.put('http://127.0.0.1:' + port + '/v1/tenant/' + tenant_id1 + '/instance/' + instance_id1,
|
||||
json={"instance_uuid": instance_id1, "expiry": expiry_str},
|
||||
headers=headers)
|
||||
logger.debug(r.text)
|
||||
assert_equal(r.status_code, 200)
|
||||
|
||||
@test(depends_on=[test_update_instance])
|
||||
def test_get_instance2():
|
||||
r = requests.get('http://127.0.0.1:' + port + '/v1/tenant/' + tenant_id1 + '/instance/' + instance_id1,
|
||||
headers=headers)
|
||||
logger.debug(r.text)
|
||||
assert_equal(r.status_code, 200)
|
||||
|
||||
|
||||
@test(depends_on=[test_get_instance2])
|
||||
def test_deleted_instance():
|
||||
eventlet.greenthread.sleep(50)
|
||||
# The instance lease should be deleted by now
|
||||
|
|
Loading…
Reference in New Issue