Use microversion in put allocations in test_report_client

In some places test_report_client uses a raw client.put when
writing allocations. This defaults to the latest microversion.
This means that if the allocations format changes in the latest
microversion in a patch in placement, the nova functional tests
fail.

In this change we pin the microversion to the minimum one providing
the features used in the PUT.

Change-Id: Ia0fee6bb931770792b552ae32ef31f0a4cc466ee
This commit is contained in:
Chris Dent 2019-09-02 11:40:35 +01:00
parent 160d1042b4
commit 5f553f4b1a
1 changed files with 6 additions and 3 deletions

View File

@ -1192,8 +1192,10 @@ class SchedulerReportClientTests(SchedulerReportClientTestBase):
'user_id': uuids.user,
},
}
self.client.put('/allocations/' + uuids.cn_inst1, ret[uuids.cn_inst1])
self.client.put('/allocations/' + uuids.cn_inst2, ret[uuids.cn_inst2])
self.client.put('/allocations/' + uuids.cn_inst1, ret[uuids.cn_inst1],
version='1.28')
self.client.put('/allocations/' + uuids.cn_inst2, ret[uuids.cn_inst2],
version='1.28')
# And on the other compute (with sharing)
self.client.put(
'/allocations/' + uuids.othercn_inst,
@ -1204,7 +1206,8 @@ class SchedulerReportClientTests(SchedulerReportClientTestBase):
'consumer_generation': None,
'project_id': uuids.proj,
'user_id': uuids.user,
})
},
version='1.28')
return ret