Browse Source

Software image path miss in uploading VNF package

Software image path is not stored in DB while
uploading VNF package.

Closes-Bug: 1879872
Change-Id: Ifac069a06009bb28ad7dc717c9562a52f52ed7df
changes/25/823025/8
Renu 5 months ago
parent
commit
4fa1445d70
  1. 2
      tacker/conductor/conductor_server.py
  2. 11
      tacker/tests/functional/sol/vnfpkgm/test_vnf_package.py

2
tacker/conductor/conductor_server.py

@ -388,7 +388,7 @@ class Conductor(manager.Manager, v2_hook.ConductorV2Hook):
vnf_sw_image.min_ram = 0
vnf_sw_image.min_disk = sw_image.get('min_disk')
vnf_sw_image.size = sw_image.get('size')
vnf_sw_image.image_path = ''
vnf_sw_image.image_path = sw_image.get('image_path')
vnf_sw_image.software_image_id = sw_image['software_image_id']
vnf_sw_image.metadata = sw_image.get('metadata', dict())
vnf_sw_image.create()

11
tacker/tests/functional/sol/vnfpkgm/test_vnf_package.py

@ -526,3 +526,14 @@ class VnfPackageTest(base.BaseTackerTest):
self.assertEqual(206, response[0].status_code)
self.assertEqual('6', response[0].headers['Content-Length'])
self.assertIsNotNone(response[1])
def test_vnf_package_software_image_path(self):
filter_expr = {
'filter': '(eq,id,%s)' % self.package_id2,
'exclude_fields': 'checksum,softwareImages/checksum,'
'additionalArtifacts/checksum'}
filter_url = self.base_url + "?" + urllib.parse.urlencode(filter_expr)
resp, body = self.http_client.do_request(filter_url, "GET")
image_path = body[0]['softwareImages'][0]['imagePath']
expected_result = self.package2.get('softwareImages')[0]['imagePath']
self.assertEqual(image_path, expected_result)

Loading…
Cancel
Save